Hifiberry DAC2 HD not recognized in balenasound in raspberrypi2

Hello,
I am using balenasound with a raspberry pi 2 and Hifiberry DAC2 HD.
Host: balenaOS 2.48.0+rev1 (production)
Supervisor version: 10.8.0

The project has been created with the button “Deploy with Balena”.
I have added BALENA_HOST_CONFIG_dtoverlay=hifiberry-dacplushd for the device (custom configuration variables) but it is not recognized. When I connect to the audio container, I get the following:
bash-5.0# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: bcm2835-alsa [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 6/7
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
card 0: bcm2835-alsa [bcm2835 ALSA], device 1: bcm2835 IEC958/HDMI [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: bcm2835-alsa [bcm2835 ALSA], device 2: bcm2835 IEC958/HDMI1 [bcm2835 IEC958/HDMI1]
Subdevices: 1/1
Subdevice #0: subdevice #0

When I use HifiBerryOS, the DAC is recognized though.

Could you please help me?
Thanks.

Hi @atm, welcome to the Forums. Looking at the balenaOS version and Supervisor versions, which are a bit old, was this device previously running balenaSound without the DAC? If so, did it work?

Or, if this is a new build, then I am wondering if you can try version 2.80.5 of the OS (available from the drop-down menu) when adding a new device in balenaCloud. Flash that to SD Card, boot, wait for the containers to download, and see if that works with the DAC.

Hello,
Indeed, balenaSound works fine without the DAC.

I see that 2.80.5 is available only for rapsberrypi4. For raspberrypi2, the latest available in the dropdown is 2.48.0, so I guess I can’t test 2.80.5.

Thanks.

Sorry for the delayed reply on this one @atm … I missed the fact that you were using a Pi 2, so you are correct, version 2.48 is the latest. I will ping the OS team to see if we could actually build and release a newer version for the Pi 2. However, in the meantime, with the DAC installed, can you navigate to http://:3000/support and paste the logs here, so we can have a look? Thanks!

Hello,
Here are the logs:

{"version":"3.6.8","config":{"mode":"STANDALONE","device":{"ip":"192.168.50.144","type":"raspberry-pi2"},"multiroom":{"master":"192.168.50.144","forced":false},"audioBlock":{"_events":{},"_eventsCount":2,"pulseCookie":{"type":"Buffer","data":[144,230,217,3,124,228,217,3,144,228,217,3,144,228,217,3,144,230,217,3,124,228,217,3,8,0,0,0,0,228,217,3,0,228,217,3,48,33,205,3,0,0,0,0,54,8,0,0,0,0,0,0,144,228,217,3,0,0,0,0,128,228,217,3,0,0,0,0,136,228,217,3,0,0,0,0,129,29,0,0,176,29,0,0,0,0,0,0,0,0,0,0,6,1,0,0,0,0,0,0,240,230,217,3,112,227,217,3,0,0,0,0,64,166,217,3,96,166,217,3,0,0,0,0,112,118,54,82,62,23,0,0,0,0,0,0,0,166,217,3,216,228,217,3,0,0,0,0,54,8,0,0,64,166,217,3,0,0,0,0,78,23,0,0,54,8,0,0,0,0,0,0,248,228,217,3,81,23,0,0,0,0,0,0,64,166,217,3,48,227,217,3,137,29,0,0,54,8,0,0,208,33,212,3,24,229,217,3,144,29,0,0,54,8,0,0,128,166,217,3,40,229,217,3,151,29,0,0,54,8,0,0,72,172,217,3,56,229,217,3,165,29,0,0,54,8,0,0,168,24,212,3,232,227,217,3]},"connected":true,"chunks":[],"requests":[],"lastRequestId":9,"pulseAddress":{"port":4317,"host":"192.168.50.144"},"address":"tcp:192.168.50.144:4317","subToEvents":true,"name":"BalenaAudio","socket":{"connecting":false,"_hadError":false,"_parent":null,"_host":null,"_readableState":{"objectMode":false,"highWaterMark":16384,"buffer":{"head":null,"tail":null,"length":0},"length":0,"pipes":null,"pipesCount":0,"flowing":false,"ended":false,"endEmitted":false,"reading":true,"sync":false,"needReadable":true,"emittedReadable":false,"readableListening":true,"resumeScheduled":false,"emitClose":false,"autoDestroy":false,"destroyed":false,"defaultEncoding":"utf8","awaitDrainWriters":null,"multiAwaitDrain":false,"readingMore":false,"decoder":null,"encoding":null},"readable":true,"_events":{},"_eventsCount":4,"_writableState":{"objectMode":false,"highWaterMark":16384,"finalCalled":false,"needDrain":false,"ending":false,"ended":false,"finished":false,"destroyed":false,"decodeStrings":false,"defaultEncoding":"utf8","length":0,"writing":false,"corked":0,"sync":false,"bufferProcessing":false,"writecb":null,"writelen":0,"afterWriteTickInfo":null,"bufferedRequest":null,"lastBufferedRequest":null,"pendingcb":0,"prefinished":false,"errorEmitted":false,"emitClose":false,"autoDestroy":false,"bufferedRequestCount":0,"corkedRequestsFree":{"next":null,"entry":null}},"writable":true,"allowHalfOpen":false,"_sockname":null,"_pendingData":null,"_pendingEncoding":"","server":null,"_server":null},"defaultSink":"balena-sound.input"}},"audio":{"name":"pulseaudio","version":"13.0","user":"root","hostname":"f0a161d3d1d7","sampleSpec":{"format":3,"channels":2,"rate":44100},"defaultSink":"balena-sound.input","defaultSource":"balena-sound.input.monitor","cookie":2949328897,"channelMap":{"channels":2,"types":[1,2]}},"sinks":[{"index":0,"name":"alsa_output.bcm2835-alsa.stereo-fallback","description":"Built-in Audio Stereo","sampleSpec":{"format":3,"channels":2,"rate":44100},"channelMap":{"channels":2,"types":[1,2]},"moduleIndex":6,"channelVolumes":{"channels":2,"volumes":[56210,56210]},"isMuted":false,"monitorSourceIndex":0,"monitorSourceName":"alsa_output.bcm2835-alsa.stereo-fallback.monitor","latency":"53614n","driverName":"module-alsa-card.c","flagsRaw":183,"properties":[["alsa.resolution_bits","16"],["device.api","alsa"],["device.class","sound"],["alsa.class","generic"],["alsa.subclass","generic-mix"],["alsa.name","bcm2835 ALSA"],["alsa.id","bcm2835 ALSA"],["alsa.subdevice","0"],["alsa.subdevice_name","subdevice #0"],["alsa.device","0"],["alsa.card","0"],["alsa.card_name","bcm2835 ALSA"],["alsa.long_card_name","bcm2835 ALSA"],["alsa.driver_name","snd_bcm2835"],["device.bus_path","/devices/platform/soc/soc:audio/sound/card0"],["sysfs.path","/devices/platform/soc/soc:audio/sound/card0"],["device.form_factor","internal"],["device.string","hw:0"],["device.buffering.buffer_size","131072"],["device.buffering.fragment_size","131072"],["device.access_mode","mmap+timer"],["device.profile.name","stereo-fallback"],["device.profile.description","Stereo"],["device.description","Built-in Audio Stereo"],["alsa.mixer_name","Broadcom Mixer"],["module-udev-detect.discovered","1"],["device.icon_name","audio-card"]],"configLatency":"66666n","baseVolume":56210,"state":0,"volumeSteps":65537,"cardIndex":0,"ports":1,"activePortName":"analog-output","formats":"Analog Output"},{"index":9900,"name":0,"description":"analog-output","sampleSpec":[{"encoding":1,"properties":[]}],"channelMap":1,"moduleIndex":"balena-sound.input","channelVolumes":"Null Output","isMuted":{"format":3,"channels":2,"rate":44100},"monitorSourceIndex":{"channels":2,"types":[1,2]},"monitorSourceName":23,"latency":{"channels":2,"volumes":[49152,49152]},"driverName":false,"flagsRaw":1,"properties":"balena-sound.input.monitor","configLatency":"58613n","baseVolume":"module-null-sink.c","state":162,"volumeSteps":[["device.description","Null Output"],["device.class","abstract"],["device.icon_name","audio-card"]],"cardIndex":"66666n","ports":65536,"activePortName":1,"formats":65537},{"index":4294967295,"name":0,"description":"","sampleSpec":[{"encoding":1,"properties":[]}],"channelMap":2,"moduleIndex":"balena-sound.output","channelVolumes":"Null Output","isMuted":{"format":3,"channels":2,"rate":44100},"monitorSourceIndex":{"channels":2,"types":[1,2]},"monitorSourceName":24,"latency":{"channels":2,"volumes":[65536,65536]},"driverName":false,"flagsRaw":2,"properties":"balena-sound.output.monitor","configLatency":"58431n","baseVolume":"module-null-sink.c","state":162,"volumeSteps":[["device.description","Null Output"],["device.class","abstract"],["device.icon_name","audio-card"]],"cardIndex":"66666n","ports":65536,"activePortName":0,"formats":65537},{"index":4294967295,"name":0,"description":"","sampleSpec":[{"encoding":1,"properties":[]}],"channelMap":3,"moduleIndex":"snapcast","channelVolumes":"Null Output","isMuted":{"format":3,"channels":2,"rate":44100},"monitorSourceIndex":{"channels":2,"types":[1,2]},"monitorSourceName":25,"latency":{"channels":2,"volumes":[65536,65536]},"driverName":false,"flagsRaw":3,"properties":"snapcast.monitor","configLatency":"0n","baseVolume":"module-null-sink.c","state":162,"volumeSteps":[["device.description","Null Output"],["device.class","abstract"],["device.icon_name","audio-card"]],"cardIndex":"0n","ports":65536,"activePortName":2,"formats":65537}],"volume":75,"constants":{"debug":false,"port":80,"coteDelay":5000,"mode":"STANDALONE","balenaDeviceType":"raspberry-pi2","multiroom":{"forced":false,"pollInterval":60000,"disallowUpdates":false},"volume":75,"inputSink":"balena-sound.input"}}

Thanks a lot !

Hello @atm ,

Can you share the kernel version that balenaOS and HiFiBerryOS are running. You can copy paste the result of uname -a. It seems that particular HAT needs kernel 4.19.97 or above.

Cheers,

Hello,
for balenaOS: Linux balena 4.19.75 #1 SMP Mon Mar 23 10:56:41 UTC 2020 armv7l armv7l armv7l GNU/Linux
for HiFiBerryOS: Linux hifiberry 5.10.42-v7 #1 SMP Wed Aug 4 09:13:42 UTC 2021 armv7l GNU/Linux
Thanks.

Hello

Can you please try and update your RPi2 to latest available os image? v2.83.21+rev1 should be available with an updated kernel version.

Let us know if it works
Thanks

Hello,

With this new image, it works fine now. Awesome !

Thanks a lot !