No sound with Hifiberry AMP+ and Mopidy Iris

Hello everyone,

I had a raspberry pi 3 2 years ago and used it with my Hifiberry AMP+ and Mopidy. All were good but I just bought a new raspberry pi 4 and I tried to install the hifiberry with mopidy but I have no sound when I use Iris to play a music.

Rasp4 + the Hifiberry module work good when I use:

  1. duckduckgo and go on youtube to listen to a video
  2. aplay /usr/share/sounds/alsa/Front_Center.wav

I didnt forget to add mopidy to the video usergroup:
groups mopidy
mopidy : audio video

Iris is working good, I can access to my iris client with on my laptop in the same local network.

I followed the instructions from: https://www.hifiberry.com/docs/software/configuring-linux-3-18-x/ except the debug section.

Here is my mopidy.conf:
cat mopidy.conf

# For further information about options in this file see:
# http://docs.mopidy.com/
#
# The initial commented out values reflect the defaults as of:
# Mopidy 2.3.1
# Mopidy-File 2.3.1
# Mopidy-HTTP 2.3.1
# Mopidy-Local 2.3.1
# Mopidy-M3U 2.3.1
# Mopidy-MPD 2.3.1
# Mopidy-SoftwareMixer 2.3.1
# Mopidy-Spotify 3.1.0
# Mopidy-Stream 2.3.1
#
# Available options and defaults might have changed since then,
# run mopidy config to see the current effective config and
# mopidy --version to check the current version.

[core]
#cache_dir = $XDG_CACHE_DIR/mopidy
#config_dir = $XDG_CONFIG_DIR/mopidy
#data_dir = $XDG_DATA_DIR/mopidy
#max_tracklist_length = 10000
#restore_state = false

[logging]
#color = true
#console_format = %(levelname)-8s %(message)s
#debug_format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n %(message)s
#debug_file = mopidy.log
#config_file =

[audio]
#mixer = software
#mixer_volume =
#output = autoaudiosink
#buffer_time =

[proxy]
#scheme =
#hostname = 192.168.0.36
#port = 6680
#username =
#password =

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

[http]
enabled = true
hostname = ::
port = 6680
#static_dir =
#zeroconf = Mopidy HTTP server on $hostname
#allowed_origins =
#csrf_protection = true

[stream]
enabled = true
protocols =

  • http*
    # https
    # mms
    # rtmp
    # rtmps
    # rtsp
    #metadata_blacklist =
    #timeout = 5000

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

[softwaremixer]
#enabled = true

[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

[local]
#enabled = true
library = sqlite
#media_dir = $XDG_MUSIC_DIR
#scan_timeout = 1000
scan_flush_threshold = 100
#scan_follow_symlinks = false
#excluded_file_extensions =
# .directory
# .html
# .jpeg
# .jpg
# .log
# .nfo
# .pdf
# .png
# .txt
# .zip

[spotify]
enabled = true
*username = *****
*password = *****
*client_id = *****
*client_secret = *****

I dont know what to do more, if someone could help me!
Thank a lot and sorry for my bad english.

Are you running as a service? If so then use sudo mopidyctl config to show your configuration. Assuming you are using the service then please take a look in /varl/log/mopidy/mopidy.log for any warnings or errors, share the file if you are ensure.

I do not, I use mopidy command to start the application. Should I run it as service?

No that’s not necessary if you don’t want to. It certainly makes debugging easier to not run it as a service (I only asked since adding the mopidy user to the video group is only strictly necessary when running as a service).

When you run mopidy are there any errors or warning in the output at startup and when you select a song in iris? Can you confirm you disabled the onboard audio and provide the output of aplay -l. When you select a song, does playback appear to start in iris i.e. does the current position increase?

Here is what I have when I start Mopidy and when I play a music from Iris:

pi@raspberrypi:~ $ mopidy
INFO Starting Mopidy 2.3.1
INFO Loading config from builtin defaults
INFO Loading config from /home/pi/.config/mopidy/mopidy.conf
INFO Loading config from command line options
INFO Enabled extensions: iris, mpd, http, stream, spotify, local-sqlite, musicbox_webclient, softwaremixer, file, local-images, local, m3u
INFO Disabled extensions: none
INFO Starting Mopidy mixer: SoftwareMixer
INFO Starting Mopidy audio
INFO Starting Mopidy backends: StreamBackend, M3UBackend, FileBackend, LocalBackend, SpotifyBackend
INFO Audio output set to “autoaudiosink”
INFO Loaded 0 local tracks using sqlite
INFO Starting Mopidy core
INFO Starting Mopidy frontends: IrisFrontend, MpdFrontend, HttpFrontend
INFO Starting Iris 3.41.2
INFO MPD server running at [::]:6600
INFO HTTP server running at [::]:6680
INFO Starting GLib mainloop
INFO Logged in to Spotify in online mode

The music bar moves forward on the web interface but as you can see above, there is nothing telling I played a song or change with another song.

What do you mean by " Can you confirm you disabled the onboard audio and provide the output of aplay -l "?

I did this, I dont know if this is what you mean?

Create /etc/asound.conf with the following content:

pcm.!default {
  type hw card 0
}
ctl.!default {
  type hw card 0
}

Here is what I have when I do aplay -l:

**** Liste des Périphériques Matériels PLAYBACK ****
carte 0: sndrpihifiberry [snd_rpi_hifiberry_amp], périphérique 0: HifiBerry AMP HiFi tas5713.1-001b-0 [HifiBerry AMP HiFi tas5713.1-001b-0]
Sous-périphériques: 1/1
Sous-périphérique #0: subdevice #0