Raspberry pi 4 - no audio

I just discovered Balena while researching for a sound system project. I purchased a new Raspberry pi 4 and installed BalenaOS and BalenaSound. I also have an Iqaudio dac+ hat attached to it. However, Im unable to get any sound out of it, Either from the DAC or the onboard 3.5mm jack.

I have searched the forum and tried various settings suggested in different posts. I have configured it both for using the DAC and not using the DAC. I cant get any sound either way.

I read that there is an open issue with BalenaSound and the 64bit version of BalenaOS. But there is only a 64 bit option for RPi 4.

Current settings:
dtoverlay: “i2c_arm=on”,“spi=on”,“audio=on”
RESIN_HOST_CONFIG_hdmi_ignore_edid_audio: 1
BALENA_HOST_CONFIG_dtoverlay: iqaudio-dacplus

I have checked the volume settings in alsamixer.

Output of aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: bcm2835-jack [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
Subdevices: 8/8
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
Subdevice #7: subdevice #7
card 1: dac [IQaudIODAC], device 0: IQaudIO DAC HiFi pcm512x-hifi-0 [IQaudIO DAC HiFi pcm512x-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0

I have also tried a RPi Zero W where I successfully got sound out of a JustBoom DAC Zero hat.

1 Like

If you set AUDIO_OUTPUT to RPI_HEADPHONES (see here Customization - Home) are you able to get audio from the 3.5mm jack?

Hi Ereski, and thanks for the quick reply.

I added AUDIO_OUTPUT to RPI_HEADPHONES under device variables. Still no sound out of the 3.5mm jack. Also disabled the DAC (removed BALENA_HOST_CONFIG_dtoverlay) hat without any luck.

1 Like

Just to make sure, there isnt a known issue with BalenaSound and 64bit/RPi4 BalenoOS? It should work?

It should work, that is correct. As a very quick troubleshooting test, do you get audio out via the HDMI cable (if your monitor has speakers)?

@koyaanisqatsi You have any ideas on this one? Do you have an IQaudio DAC, by chance?

I will try that, but are unable to do so until tomorrow.

Im not sure it is a problem with the DAC at all. Unconfiguring it and only using the 3.5mm onboard jack produces no sound either. I will also try to flash SD card again to start over with a fresh new installation. Just to make sure its nothing I have broken trying to configure the DAC.

1 Like

That’s actually a good idea as well, let us know how that goes. :slight_smile:

My first thought on this is to try booting up the RPi without anything attached to the HDMI port. I have found that it will override audio even with a DAC sometimes. This may require booting from a power-down, not a reboot.

I’ve never needed to set RESIN_HOST_CONFIG_hdmi_ignore_edid_audio: 1 for a DAC, but it may be necessary. I’ve had to use that setting on the RPi for other purposes, but not balenaSound so far.

Also try the environment variable AUDIO_OUTPUT=DAC, with and without some of the other vars.

In the multiroom-client container, run the following command and paste the output here, so we can see what the snapcast client is seeing for audio interfaces: “snapclient -l”

EDIT: Just realized you already pasted the output of aplay -l in your OP.

Cheers!
Mark

Sorry for late reply. I have re-installed BalenaOS and first tried without any changes, still no sound. Changed AUDIO_OUTPUT to RPI_HEADPHONES and still no sound. Tried (both) hdmi and no sound there either. Output of aplay -l (audio host)

**** List of PLAYBACK Hardware Devices ****
card 0: bcm2835-jack [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  Subdevices: 8/8
  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
  Subdevice #7: subdevice #7```

Output from `snapclient -l` (multiroom-client):
```0: null
Discard all samples (playback) or generate zero samples (capture)

1: pulse
PulseAudio Sound Server

2: default
Default ALSA Output (currently PulseAudio Sound Server)

So, it looks like the multroom-client is seeing the Pulseaudio audio device correctly. But Alsa is not seeing your DAC at the OS. Or at least that info is not propagating into the audio container.

Is this currently configured with the correct dtoverlay for the iqaudio DAC? (BALENA_HOST_CONFIG_dtoverlay=iqaudio-dacplus)

You might also try this: RESIN_HOST_CONFIG_hdmi_ignore_hotplug=1, which should force the HDMI port off.

Can you try swapping DAC hats between the RPi Zero and the RPi 4, and testing both? They should fit, even though it might look a bit funky. That will help rule out whether this is a problem with the Pi, the DAC hat, or software.

Ah, no I havent set up the DAC yet. Right now Im just trying to get any sound out of it. So after I reinstalled it I did no configuration (other then trying to set AUDIO_OUTPUT= RPI_HEADPHONES) to see if I could get any audio of the onboard 3.5mm jack or HDMI.

I have not done any settings for the DAC and have not attached it yet.

Currently Im just trying to take a few steps back trying to get any audio from it. My theory is that its not the DAC that is the main problem.

Excellent. So, without the DAC connected, try letting it be completely stock (no configs anywhere other than defaults) and see if you can get sound out of the HDMI and/or the headphone jack. You will have to boot up with either of those in the state they should be in for testing. I don’t think you can flip between HDMI and headphone jack while the device is already powered up. When testing the headphone jack, make sure you do not have anything connected to the HDMI port(s). And for the HDMI port, you can’t have anything plugged into the headphone jack.

Also, are you running a default deployment of balenaSound, or a custom one?

I have installed a new application using the “Deploy with Balena” button on github. Added a new device, downloaded a new image and flashed the SD card. Booted the RPi (with jack plugged in) and waited for the docker images to install. Tried to play audio using Spotify Connect, AirPlay and bluetooth. Still no audio.

Output from aplay -l

  Subdevices: 8/8
  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
  Subdevice #7: subdevice #7```

Have made no other changes.

Hi

When you say waited for the docker images to install - do you mean they didn’t install?

Sorry, that was not clear. Yes, they did install and all started up. I was able to connect with bluetooth, airplay and spotify connect. But no audio was produced.

Hey there @rlndv I’ve just set myself up a new Pi 4 device running the latest version of balenaSound just to check there are no issues, and everything seems to work OK with the default setup when using the 3.5mm jack. So, we need to figure out what’s different on your device. I didn’t ever plug in an HDMI cable to the device, and the 3.5mm jack worked even without using RPI_HEADPHONES.

I think we’re on the right path by going back to basics and trying to get the 3.5mm jack working before introducing the DAC, so let’s continue to pursue that. The first thing to check would be to make sure that audio=off is not set on the DT parameters.

The next thing to do would be to share the support logs from the device here for us to review. You can obtain these by visiting the local IP address in a web browser like so: http://<DEVICE_IP>:3000/support. Share everything from this page on the forum here.

You can also share the audio block startup logs by filtering by the audio service in the dashboard (see below).

One last thing is using the dashboard to open a terminal to the audio service. From within this terminal run paplay /usr/share/sounds/alsa/Front_Center.wav. This should output a spoken voice saying ‘Front center’ through the 3.5mm jack.

Hopefully with this extra information and tests performed we’ll be able to help figure out what’s going on!

3 Likes

Hi @chrisys and thanks a lot for detailed reply. Good to hear there is hope for getting audio out of my RPi 4. Here is the information you requested:
First, I have removed RPI_HEADPHONES from AUDIO_OUTPUT. DT params is currently "i2c_arm=on","spi=on","audio=on". I have not connected HDMI.

Support logs:
{"config":{"mode":"MULTI_ROOM","device":{"ip":"192.168.0.16","type":"raspberrypi4-64"},"multiroom":{"master":"192.168.0.16","forced":false},"audioBlock":{"_events":{},"_eventsCount":2,"pulseCookie":{"type":"Buffer","data":[0,0,0,0,128,200,244,2,248,200,244,2,248,174,244,2,0,0,0,0,40,175,244,2,0,0,0,0,0,0,0,0,0,0,0,0,0,175,244,2,72,175,244,2,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,96,173,244,2,109,101,115,115,97,103,101,0,24,142,219,2,40,175,244,2,7,0,0,0,74,62,20,111,1,175,244,2,24,175,244,2,150,0,0,0,38,1,32,0,0,0,0,0,1,0,0,0,1,0,0,0,150,0,0,0,255,255,255,255,2,0,0,0,136,175,244,2,112,174,244,2,0,0,0,0,0,0,0,0,0,0,0,0,224,167,244,2,0,0,0,0,0,0,0,0,20,142,219,2,88,174,244,2,0,0,0,0,0,0,0,0,150,0,0,0,1,0,0,0,112,176,244,2,0,0,0,0,72,175,244,2,168,175,244,2,24,101,219,2,8,172,244,2,32,123,27,57,72,170,244,2,72,172,244,2,65,230,249,27,0,0,0,0,0,0,0,0,0,0,0,0,88,174,244,2,112,176,244,2,147,57,185,56]},"connected":true,"chunks":[],"requests":[],"lastRequestId":14,"pulseAddress":{"port":4317,"host":"192.168.0.16"},"address":"tcp:192.168.0.16: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":"14.1","user":"root","hostname":"b138a700ea78","sampleSpec":{"format":3,"channels":2,"rate":44100},"defaultSink":"balena-sound.input","defaultSource":"balena-sound.input.monitor","cookie":451986766,"channelMap":{"channels":2,"types":[1,2]}},"sinks":[{"index":0,"name":"alsa_output.bcm2835-jack.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-jack.stereo-fallback.monitor","latency":"0n","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 Headphones"],["alsa.id","bcm2835 Headphones"],["alsa.subdevice","0"],["alsa.subdevice_name","subdevice #0"],["alsa.device","0"],["alsa.card","0"],["alsa.card_name","bcm2835 Headphones"],["alsa.long_card_name","bcm2835 Headphones"],["alsa.driver_name","snd_bcm2835"],["device.bus_path","/devices/platform/soc/fe00b840.mailbox/bcm2835_audio/sound/card0"],["sysfs.path","/devices/platform/soc/fe00b840.mailbox/bcm2835_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"],["module-udev-detect.discovered","1"],["device.icon_name","audio-card"]],"configLatency":"0n","baseVolume":56210,"state":2,"volumeSteps":65537,"cardIndex":0,"ports":1,"activePortName":"analog-output-headphones","formats":"Headphones"},{"index":9900,"name":0,"description":"analog-output-headphones","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":21,"latency":{"channels":2,"volumes":[49152,49152]},"driverName":false,"flagsRaw":1,"properties":"balena-sound.input.monitor","configLatency":"6588n","baseVolume":"module-null-sink.c","state":418,"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":2,"moduleIndex":"balena-sound.output","channelVolumes":"Null Output","isMuted":{"format":3,"channels":2,"rate":44100},"monitorSourceIndex":{"channels":2,"types":[1,2]},"monitorSourceName":22,"latency":{"channels":2,"volumes":[65536,65536]},"driverName":false,"flagsRaw":2,"properties":"balena-sound.output.monitor","configLatency":"6300n","baseVolume":"module-null-sink.c","state":418,"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":3,"moduleIndex":"snapcast","channelVolumes":"Null Output","isMuted":{"format":3,"channels":2,"rate":44100},"monitorSourceIndex":{"channels":2,"types":[1,2]},"monitorSourceName":23,"latency":{"channels":2,"volumes":[65536,65536]},"driverName":false,"flagsRaw":3,"properties":"snapcast.monitor","configLatency":"29709n","baseVolume":"module-null-sink.c","state":418,"volumeSteps":[["device.description","Null Output"],["device.class","abstract"],["device.icon_name","audio-card"]],"cardIndex":"23219n","ports":65536,"activePortName":0,"formats":65537}],"volume":75,"constants":{"debug":false,"port":3000,"coteDelay":5000,"mode":"MULTI_ROOM","balenaDeviceType":"raspberrypi4-64","multiroom":{"forced":false},"volume":75}}

Audio block startup log:

22.02.21 21:41:11 (+0100)  audio  Routing 'balena-sound.input' to 'snapcast'.
22.02.21 21:41:11 (+0100)  audio  Routing 'balena-sound.output' to 'alsa_output.bcm2835-jack.stereo-fallback'.
22.02.21 21:41:11 (+0100)  audio  W: [pulseaudio] main.c: This program is not intended to be run as root (unless --system is specified).
22.02.21 21:41:12 (+0100)  audio  E: [pulseaudio] module-bluetooth-policy.c: Failed to parse module arguments
22.02.21 21:41:12 (+0100)  audio  E: [pulseaudio] module.c: Failed to load module "module-bluetooth-policy" (argument: "a2dp_source=true hfgw=true auto_switch=2"): initialization failed.
22.02.21 21:41:12 (+0100)  audio  W: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
22.02.21 21:41:12 (+0100)  audio  W: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11

Also, I tried running paplay /usr/share/sounds/alsa/Front_Center.wav from the audio terminal and no audio where produced.

Hey there.

This logging line audio Routing 'balena-sound.input' to 'snapcast'. looks to me like the device is configured to be part of a multiroom setup and waiting for input from another device. But I don’t see from the messages above that you have another device?!? Please could you set a device variable called SOUND_MODE to the value STANDALONE and try playing some music again? I would expect that logging line to say something like Routing 'balena-sound.input' to 'balena-sound.output'. and sound to come out of the 3.5mm jack.

Phil