💾 Archived View for thrig.me › tech › openbsd › icecast.gmi captured on 2023-09-28 at 17:27:42. Gemini links have been rewritten to link to archived content

View Raw

More Information

➡️ Next capture (2023-11-04)

-=-=-=-=-=-=-

icecast

Icecast can be a bit tricky to setup for testing purposes.

    $ doas pkg_add icecast
    ...

Maybe not the package addition part, but rather the configuration. In this case I was testing whether client software to stream to anonradio on SDF would work with a local icecast server, so I needed something that acts at least superficially like the SDF anonradio. Hence the "openmic" and "anonradio" stuff in the following configuration file. Probably you will want to change the passwords?

icecast.xml

The configuration file probably needs more work.

    $ ls -l /var/icecast/icecast.xml
    -rw-------  1 _icecast  _icecast  1882 Sep 26 12:01 /var/icecast/icecast.xml
    $ doas icecast -c /var/icecast/icecast.xml
    ...

Ezstream

ezstream is what I picked to stream files to the server.

    $ doas pkg_add ezstream madplay lame
    ...

It is slightly buggy on OpenBSD 7.3 in that streaming MP3 files fails.

    ezstream[5310]: stream: default: format: MP3: This libshout doesn't support the requested option

One can patch and compile a local version of ezstream and to put that binary somewhere in your PATH. Hopefully this patch (from 2021, this document written 2023) or maybe a better fix gets applied to upstream and then eventually makes its way to the OpenBSD ports system?

--- src/stream.c.orig   2021-02-11 00:52:27.000000000 +0100
+++ src/stream.c    2021-04-08 11:50:26.480297394 +0200
@@ -225,7 +225,7 @@
        break;
    case CFG_STREAM_MP3:
        if (SHOUTERR_SUCCESS !=
-           shout_set_content_format(s->shout, SHOUT_FORMAT_MP3, 0, NULL)) {
+           shout_set_content_format(s->shout, SHOUT_FORMAT_MP3, SHOUT_USAGE_AUDIO, NULL)) {
            log_error("stream: %s: format: %s: %s",
                s->name, cfg_stream_get_format_str(cfg_stream),
                shout_get_error(s->shout));

ezstream needs a configuration file, which is also XML. This assumes a localhost server running on a particular port, and that a playlist.m3u file has been created, which should have some paths to some MP3 files, one per line.

localhost.xml

    $ ezstream -c localhost.xml
    ...

Listen

A bunch of different audio programs can listen to streams, e.g. mpv, mpg123, and others.

    $ mpv http://localhost:8010/openmic
    ...

https://anonradio.net/

tags #anonradio #ezstream #icecast