Icecast2 fails with error mopidy.audio.gst GStreamer error: Could not connect to server

I have been trying to get network streaming working via icecast. I keep getting the error [MainThread] mopidy.audio.gst GStreamer error: Could not connect to server.

I get the error when I play music from Spotify and local media.

I am running this in a proxmox container.

I have added the fallback stream config.

  <mount>
  <mount-name>/mopidy</mount-name>
  <fallback-mount>/silence.mp3</fallback-mount>
  <fallback-override>1</fallback-override>
</mount>

Mopidy:

/usr/bin/mopidy --version
Mopidy 3.0.2

icecast2

/usr/bin/icecast2 --version
Icecast 2.4.4

OS

lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04 LTS
Release:	20.04
Codename:	focal
sudo mopidy deps
Executable: /usr/bin/mopidy
Platform: Linux-4.15.18-28-pve-x86_64-with-glibc2.29
Python: CPython 3.8.2 from /usr/lib/python3.8
Mopidy: 3.0.2 from /usr/lib/python3/dist-packages
Mopidy-MusicBox-Webclient: 3.1.0 from /usr/local/lib/python3.8/dist-packages
  Mopidy: 3.0.2 from /usr/lib/python3/dist-packages
  setuptools: 45.2.0 from /usr/lib/python3/dist-packages
  Pykka: 2.0.2 from /usr/lib/python3/dist-packages
Mopidy-TuneIn: 1.0.0 from /usr/lib/python3/dist-packages
Mopidy-Mopify: 1.7.3 from /usr/local/lib/python3.8/dist-packages
  ConfigObj: 5.0.6 from /usr/local/lib/python3.8/dist-packages
    six: 1.14.0 from /usr/lib/python3/dist-packages
  Mopidy: 3.0.2 from /usr/lib/python3/dist-packages
  setuptools: 45.2.0 from /usr/lib/python3/dist-packages
Mopidy-Scrobbler: 2.0.0 from /usr/lib/python3/dist-packages
Mopidy-Iris: 3.49.0 from /usr/local/lib/python3.8/dist-packages
  setuptools: 45.2.0 from /usr/lib/python3/dist-packages
  Pykka: 2.0.2 from /usr/lib/python3/dist-packages
  Mopidy: 3.0.2 from /usr/lib/python3/dist-packages
Mopidy-Spotify: 4.0.1 from /usr/lib/python3/dist-packages
Mopidy-MPD: 3.0.0 from /usr/lib/python3/dist-packages
Mopidy-Local: 3.1.1 from /usr/lib/python3/dist-packages
GStreamer: 1.16.2.0 from /usr/lib/python3/dist-packages/gi
  Detailed information:
    Python wrapper: python-gi 3.36.0
    Relevant elements:
      Found:
        uridecodebin
        souphttpsrc
        appsrc
        alsasink
        osssink
        oss4sink
        pulsesink
        id3demux
        id3v2mux
        lamemp3enc
        mpegaudioparse
        mpg123audiodec
        vorbisdec
        vorbisenc
        vorbisparse
        oggdemux
        oggmux
        oggparse
        flacdec
        flacparse
        shout2send
      Not found:
        flump3dec
        mad
sudo mopidyctl config
Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf config" as user mopidy
[core]
cache_dir = /var/cache/mopidy
config_dir = /etc/mopidy
data_dir = /var/lib/mopidy
max_tracklist_length = 10000
restore_state = false

[logging]
verbosity = 0
format = %(levelname)-8s [%(threadName)s] %(name)s %(message)s
color = false
config_file =

[audio]
mixer = software
mixer_volume = 100
output = lamemp3enc ! shout2send async=true mount=/mopidy ip=127.0.0.1 port=8000 password=hackme
buffer_time =

[proxy]
scheme =
hostname =
port =
username =
password =

[musicbox_webclient]
enabled = true
musicbox = false
websocket_host =
websocket_port =
on_track_click = PLAY_ALL

[mopify]
enabled = true
debug = false

[iris]
enabled = true
country = NZ
locale = en_NZ
spotify_authorization_url = https://jamesbarnsley.co.nz/iris/auth_spotify.php
lastfm_authorization_url = https://jamesbarnsley.co.nz/iris/auth_lastfm.php
genius_authorization_url = https://jamesbarnsley.co.nz/iris/auth_genius.php
data_dir = $XDG_DATA_DIR/iris

[file]
enabled = true
media_dirs =
  $XDG_MUSIC_DIR|Music
  ~/|Home
excluded_file_extensions =
  .directory
  .html
  .jpeg
  .jpg
  .log
  .nfo
  .pdf
  .png
  .txt
  .zip
show_dotfiles = false
follow_symlinks = false
metadata_timeout = 1000

[http]
enabled = true
hostname = 0.0.0.0
port = 6680
zeroconf = Mopidy HTTP server on $hostname
allowed_origins =
csrf_protection = true
default_app = mopidy

[m3u]
enabled = true
base_dir =
default_encoding = latin-1
default_extension = .m3u8
playlists_dir =

[softwaremixer]
enabled = true

[stream]
enabled = true
protocols =
  http
  https
  mms
  rtmp
  rtmps
  rtsp
metadata_blacklist =
timeout = 5000

[tunein]
enabled = true
timeout = 5000
filter =

[spotify]
enabled = true
username = REDACTED
password = REDACTED
client_id = REDACTED
client_secret = REDACTED
bitrate = 160
volume_normalization = true
private_session = false
timeout = 10
allow_cache = true
allow_network = true
allow_playlists = true
search_album_count = 20
search_artist_count = 10
search_track_count = 50
toplist_countries =

[scrobbler]
enabled = true
username = gravyflex
password = ********

[mpd]
enabled = true
hostname = 0.0.0.0
port = 6600
password = ********
max_connections = 20
connection_timeout = 60
zeroconf = Mopidy MPD server on $hostname
command_blacklist =
  listall
  listallinfo
default_playlist_scheme = m3u

[local]
enabled = true
media_dir = /var/music
scan_timeout = 1000
scan_flush_threshold = 100
scan_follow_symlinks = false
included_file_extensions =
excluded_file_extensions =
  .cue
  .directory
  .html
  .jpeg
  .jpg
  .log
  .nfo
  .pdf
  .png
  .txt
  .zip
directories =
  Albums                  local:directory?type=album
  Artists                 local:directory?type=artist
  Composers               local:directory?type=artist&role=composer
  Genres                  local:directory?type=genre
  Performers              local:directory?type=artist&role=performer
  Release Years           local:directory?type=date&format=%25Y
  Tracks                  local:directory?type=track
  Last Week's Updates     local:directory?max-age=604800
  Last Month's Updates    local:directory?max-age=2592000
timeout = 10
use_artist_sortname = false
album_art_files =
  *.jpg
  *.jpeg
  *.png

I am able to play audio successfully via snapcast with the following Audio settings

output = audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/snapfifo

I tried to get this working myself and hit the same problem. It’s due to https://gitlab.xiph.org/xiph/icecast-libshout/-/issues/2316 in the version of libshout (v2.4.3) that was shipped in Ubuntu 20.04. The fix in that issue works, as does the latest version of libshout from gitlab. But it’s really annoying that shout2send is pretty much dead in an Ubuntu LTS release. More reason to roll our own HTTP streaming server.

hi,
can i ask what have you done exactly to resolve the issue?

Nothing, I don’t have any need for icecast myself. If I wanted a browser streaming solution today I would use snapcast maybe.

1 Like

On Ubuntu 21.04, an easy solution is to downgrade the libshout3 package: download and install the deb from Ubuntu – Details of package libshout3 in groovy.
Using the command line, assuming you are on amd64:

wget http://hr.archive.ubuntu.com/ubuntu/pool/main/libs/libshout/libshout3_2.4.4-1_amd64.deb
sudo dpkg -i libshout3_2.4.4-1_amd64.deb

You can then prevent automatic upgrade following e.g., updates - How to prevent updating of a specific package? - Ask Ubuntu