#2121·mopidy

Switching the audio source gets mopidy to produce no sound though seems to play

Author: adrhcCreated Aug 31, 2023Updated Aug 14, 2026
LabelsA-audio

Describe the bug Right after starting the mopidy service, any audio I try to play it works (I hear the audio); as long as I'm not changing the audio source (or even replay the current one while it's still playing!) mopidy continues to play picking the next available audio when completing the current one (well, if it encounters an online radio, it sticks to it). If I switch to another source mopidy stops producing sounds. If the switch-to source is an online radio I see with mpc current that mopidy plays it (I see the song names changing from time to time) but I hear nothing; if the switch-to source is a local disk file (e.g. mp3) then I see with mpc current that mopidy briefly "tries" it for few seconds (0s - 3s) then skips to the next one and so on till gets to the 1st online radio where sticks to; if the playlist contains no online radio (i.e. something that has no end) it'll continuously try to play something but never succeed. I tried by using mpc commands or some mopidy UI and is the same.

Actions that don't gets mopidy to produce no sound:

  • changing the volume
  • moving forward into the current play (local disk file only): I moved to forward for 3 songs, one after another, but at the 3rd it stopped producing sounds and started to search for next song to play (continuously)

My mopidy configuration is the same for years, the only suspect I see is an update which forced me to restart today.

UPDATE After more thought I suspect that most probably never worked on Ubuntu 23.04; I remember that I restarted with the purpose of solving the issue.

How to reproduce

  1. I start with no audio playing (mopidy or else)
  2. I start playing some audio source (online radio, youtube, local disk mp3, doesn't matter): I can hear it
  3. I switch to some another audio source or I only start from the beginning the current one (i.e. replay it while still playing)
  4. mopidy no longer produces sounds (I hear nothing no matter how long I wait)
  5. I stop the current play
  6. I check that both work: sudo -u mopidy gst-launch-1.0 audiotestsrc ! audioresample ! autoaudiosink sudo -u mopidy aplay '/home/adr/Music/MUZICA/Diverse11/Oasis - Go Let Me Out.wav'
  7. I stop then start the mopidy service then go back to step 1 and is all the same

I tried by using mpc commands (e.g. mpc play or next) or some mopidy UI and is the same.

Expected behaviour After switching the audio source I would expect to hear it.

Environment Ubuntu 23.04 with mopidy version 3.4.1-1 libgstreamer1.0-0 ver 1.22.2-1 (see below the dpkg -l libgstreamer1.0-0 output) Python 3.11.4

Running Mopidy as a service (see it at the bottom)

Any specific hardware (e.g. an exotic USB soundcard)

aplay -l; sudo lshw -C sound
**** List of PLAYBACK Hardware Devices ****
PuTTY X11 proxy: unable to connect to forwarded X server: Network error: Connection refused

xcb_connection_has_error() returned true
card 0: PCH [HDA Intel PCH], device 0: ALC1220 Analog [ALC1220 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC1220 Digital [ALC1220 Digital]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [LG TV SSCR2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
  *-multimedia
       description: Audio device
       product: Cannon Lake PCH cAVS
       vendor: Intel Corporation
       physical id: 1f.3
       bus info: pci@0000:00:1f.3
       logical name: card0
       logical name: /dev/snd/controlC0
       logical name: /dev/snd/hwC0D0
       logical name: /dev/snd/hwC0D2
       logical name: /dev/snd/pcmC0D0c
       logical name: /dev/snd/pcmC0D0p
       logical name: /dev/snd/pcmC0D1p
       logical name: /dev/snd/pcmC0D2c
       logical name: /dev/snd/pcmC0D3p
       logical name: /dev/snd/pcmC0D7p
       logical name: /dev/snd/pcmC0D8p
       version: 10
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi bus_master cap_list
       configuration: driver=snd_hda_intel latency=32
       resources: iomemory:600-5ff iomemory:600-5ff irq:140 memory:6001110000-6001113fff memory:6001000000-60010fffff

sudo mopidyctl deps outcome:

Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf deps" as user mopidy
Executable: /usr/bin/mopidy
Platform: Linux-6.2.0-31-generic-x86_64-with-glibc2.37
Python: CPython 3.11.4 from /usr/lib/python3.11
Mopidy: 3.4.1 from /usr/lib/python3/dist-packages
Mopidy-Bandcamp: 1.1.5 from /usr/local/lib/python3.11/dist-packages
  setuptools: 66.1.1 from /usr/lib/python3/dist-packages
  Mopidy: 3.4.1 from /usr/lib/python3/dist-packages
  Pykka: 3.1.1 from /usr/lib/python3/dist-packages
Mopidy-Mixcloud: 3.1415.9265 from /usr/local/lib/python3.11/dist-packages
  Mopidy: 3.4.1 from /usr/lib/python3/dist-packages
  Pykka: 3.1.1 from /usr/lib/python3/dist-packages
  setuptools: 66.1.1 from /usr/lib/python3/dist-packages
  youtube-dl: 2021.12.17 from /usr/local/lib/python3.11/dist-packages
Mopidy-Podcast: 3.0.1 from /usr/lib/python3/dist-packages
Mopidy-Podcast-iTunes: 3.0.1 from /usr/lib/python3/dist-packages
Mopidy-Moped: 0.7.1 from /usr/local/lib/python3.11/dist-packages
  Mopidy: 3.4.1 from /usr/lib/python3/dist-packages
  setuptools: 66.1.1 from /usr/lib/python3/dist-packages
Mopidy-TuneIn: 1.1.0 from /usr/lib/python3/dist-packages
Mopidy-MPD: 3.3.0 from /usr/lib/python3/dist-packages
Mopidy-InternetArchive: 3.0.1 from /usr/lib/python3/dist-packages
Mopidy-Mobile: 1.10.0 from /usr/local/lib/python3.11/dist-packages
  Mopidy: 3.4.1 from /usr/lib/python3/dist-packages
  setuptools: 66.1.1 from /usr/lib/python3/dist-packages
Mopidy-SomaFM: 2.0.2 from /usr/lib/python3/dist-packages
Mopidy-ALSAMixer: 2.0.1 from /usr/lib/python3/dist-packages
Mopidy-Local: 3.2.1 from /usr/lib/python3/dist-packages
Mopidy-Autoplay: 0.2.3 from /usr/local/lib/python3.11/dist-packages
  Mopidy: 3.4.1 from /usr/lib/python3/dist-packages
  Pykka: 3.1.1 from /usr/lib/python3/dist-packages
  setuptools: 66.1.1 from /usr/lib/python3/dist-packages
Mopidy-MusicBox-Webclient: 3.1.0 from /usr/local/lib/python3.11/dist-packages
  Mopidy: 3.4.1 from /usr/lib/python3/dist-packages
  Pykka: 3.1.1 from /usr/lib/python3/dist-packages
  setuptools: 66.1.1 from /usr/lib/python3/dist-packages
Mopidy-YouTube: 3.7 from /usr/local/lib/python3.11/dist-packages
  beautifulsoup4: 4.11.2 from /usr/lib/python3/dist-packages
  cachetools: 5.2.0 from /usr/lib/python3/dist-packages
  Mopidy: 3.4.1 from /usr/lib/python3/dist-packages
  Pykka: 3.1.1 from /usr/lib/python3/dist-packages
  requests: 2.28.1 from /usr/lib/python3/dist-packages
  setuptools: 66.1.1 from /usr/lib/python3/dist-packages
Mopidy-Jamendo: 0.1.0 from /usr/local/lib/python3.11/dist-packages
  cachetools: 5.2.0 from /usr/lib/python3/dist-packages
  Mopidy: 3.4.1 from /usr/lib/python3/dist-packages
  Pykka: 3.1.1 from /usr/lib/python3/dist-packages
  requests: 2.28.1 from /usr/lib/python3/dist-packages
  setuptools: 66.1.1 from /usr/lib/python3/dist-packages
Mopidy-RadioNet: 0.2.2 from /usr/local/lib/python3.11/dist-packages
  Mopidy: 3.4.1 from /usr/lib/python3/dist-packages
  Pykka: 3.1.1 from /usr/lib/python3/dist-packages
  setuptools: 66.1.1 from /usr/lib/python3/dist-packages
  uritools: 4.0.0 from /usr/lib/python3/dist-packages
mopidy-ytmusic: 0.3.8 from /usr/local/lib/python3.11/dist-packages
  Mopidy: 3.4.1 from /usr/lib/python3/dist-packages
  pytube: 12.1.3 from /usr/local/lib/python3.11/dist-packages
  ytmusicapi: 0.25.2 from /usr/local/lib/python3.11/dist-packages
    requests: 2.28.1 from /usr/lib/python3/dist-packages
Mopidy-Iris: 3.68.0 from /usr/local/lib/python3.11/dist-packages
  Mopidy: 3.4.1 from /usr/lib/python3/dist-packages
  Pykka: 3.1.1 from /usr/lib/python3/dist-packages
  setuptools: 66.1.1 from /usr/lib/python3/dist-packages
Mopidy-ORFRadio: 2.2.0 from /usr/local/lib/python3.11/dist-packages
  Mopidy: 3.4.1 from /usr/lib/python3/dist-packages
  Pykka: 3.1.1 from /usr/lib/python3/dist-packages
  setuptools: 66.1.1 from /usr/lib/python3/dist-packages
  python-dateutil: 2.8.2 from /usr/lib/python3/dist-packages
  beaker: 1.12.1 from /usr/local/lib/python3.11/dist-packages
GStreamer: 1.22.2.0 from /usr/lib/python3/dist-packages/gi
  Detailed information:
    Python wrapper: python-gi 3.44.1
    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 outcome:

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 = true

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

[audio]
mixer = software
mixer_volume = 25
output = alsasink device=iec958:CARD=PCH,DEV=0
buffer_time =

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

[autoplay]
enabled = false  ; Extension disabled by user config.

[bandcamp]
enabled = true
discover_pages = 1
collection_items = 50
discover_genres =
  All
  Electronic
  Rock
  Metal
  Alternative
  Hip-Hop/Rap
  Experimental
  Punk
  Folk
  Pop
  Ambient
  Soundtrack
  World
  Jazz
  Acoustic
  Funk
  R&B/Soul
  Devotional
  Classical
  Reggae
  Podcasts
  Country
  Spoken Word
  Comedy
  Blues
  Kids
  Audiobooks
  Latin
discover_tags =
  Outrun
  Future Funk
  Alternative Hip-Hop
  Tokyo, Japan
image_sizes =
  10
  5
  2
identity = 7%09X9jAGaYoD29PawCi2cS9j6j4QH2%2BtkDOOCoHxmZxpnI%3D%09%7B%22ex%22%3A0%2C%22id%22%3A3595959075%7D

[iris]
enabled = true
country = NZ
locale = en_NZ
verify_certificates = true
snapcast_enabled = true
snapcast_host = localhost
snapcast_port = 1780
snapcast_ssl = false
snapcast_stream = Default
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

[jamendo]
enabled = true
client_id = ********

[mixcloud]
enabled = true
users =
tags =
search_max = 30
refresh_period = 600
ignore_exclusive = true

[mobile]
enabled = true
title = Mopidy Mobile on $hostname
ws_url =

[moped]
enabled = true

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

[orfradio]
enabled = true
stations =
  oe1
  oe3
  fm4
  campus
  bgl
  ktn
  noe
  ooe
  sbg
  stm
  tir
  vbg
  wie
afterhours = false
archive_types =
  M
livestream_bitrate = 192

[radionet]
enabled = false  ; Extension disabled by user config.

[youtube]
enabled = true
allow_cache =
youtube_api_key = 12345678
search_results = 15
playlist_max_videos = 20
api_enabled = true
channel_id = UCfIN7NDKAK6mU7eRgSecCLg
musicapi_enabled = false
musicapi_cookie =
musicapi_cookiefile =
autoplay_enabled = false
strict_autoplay = false
max_autoplay_length = 600
max_degrees_of_separation = 3
youtube_dl_package = yt_dlp

[ytmusic]
enabled = true
auth_json = /var/lib/mopidy/.config/auth.json
auto_playlist_refresh = 19
youtube_player_refresh = 15
playlist_item_limit = 9999
subscribed_artist_limit = 9999
enable_history = true
enable_liked_songs = true
enable_mood_genre = true
enable_scrobbling = true
stream_preference =
  141
  251
  140
  250
  249
verify_track_url = true

[file]
enabled = true
media_dirs =
  /home/gigi/Music/CDs Germana/
  /home/gigi/Music/Clamavi De Profundis/
  /home/gigi/Music/MUZICA/
  /home/gigi/Music/MUZICA Amalia/
  /home/gigi/Music/Youtube_mp3/
excluded_file_extensions =
  .directory
  .html
  .jpeg
  .jpg
  .log
  .nfo
  .pdf
  .png
  .txt
  .zip
show_dotfiles = false
follow_symlinks = true
metadata_timeout = 5000

[http]
enabled = true
hostname = 0.0.0.0
port = 6680
zeroconf = Mopidy HTTP server on $hostname
allowed_origins =
  192.168.0.1:6680
  192.168.0.1
  127.0.0.1
  192.168.1.1:6680
  127.0.0.1:6680
  192.168.1.31
  192.168.1.31:6680
  192.168.1.1
csrf_protection = false
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

[alsamixer]
enabled = true
card = 0
control = Master
min_volume = 0
max_volume = 100
volume_scale = cubic

[internetarchive]
enabled = true
base_url = http://archive.org
collections =
  audio
  etree
  librivoxaudio
  audio_bookspoetry
  audio_tech
  audio_music
  audio_news
  audio_foreign
  audio_podcast
  audio_religion
audio_formats =
  VBR MP3
  64Kbps MP3
image_formats =
  JPEG
  JPEG Thumb
browse_limit = 100
browse_views =
  downloads desc|Views
  titleSorter asc|Title
  publicdate desc|Date Archived
  date desc|Date Published
  creatorSorter asc|Creator
search_limit = 20
search_order =
cache_size = 128
cache_ttl = 86400
retries = 3
timeout = 10

[local]
enabled = true
max_search_results = 1000
media_dir = /home/gigi/Music/MUZICA
scan_timeout = 5000
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

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

[podcast]
enabled = true
browse_root = Podcasts.opml
browse_order = desc
lookup_order = asc
cache_size = 64
cache_ttl = 86400
timeout = 10

[podcast-itunes]
enabled = true
base_url = http://itunes.apple.com/
country = US
explicit =
charts = audioPodcasts
charts_limit = 20
search_limit = 20
timeout = 10
retries = 3

[somafm]
enabled = true
encoding = aac
quality = highest
dj_as_artist = true

[tunein]
enabled = true
timeout = 5000
filter =

Additional context

# /lib/systemd/system/mopidy.service
[Unit]
Description=Mopidy music server
After=avahi-daemon.service
After=dbus.service
After=network-online.target
Wants=network-online.target
After=nss-lookup.target
After=pulseaudio.service
After=remote-fs.target
After=sound.target

[Service]
User=mopidy
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /var/cache/mopidy
ExecStartPre=/bin/chown mopidy:audio /var/cache/mopidy
ExecStart=/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf

[Install]
WantedBy=multi-user.target