Raspberry pi headphone jack no longer works with latest OS

I have just upgraded my device to production balenaOS 2.41.0+rev3 on my raspberry pi and I can no longer play audio through the headphone jack.

The following command lists all alsa playback devices on my raspberry pi.

bash-5.0# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: vc4hdmi [vc4-hdmi], device 0: MAI PCM vc4-hdmi-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
bash-5.0# 

When I executed the same command on another rapsberry pi 3 running development balenaOS 2.38.0+rev1 I get the following:

root@70c82e027ec4:/# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 7/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: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
root@70c82e027ec4:/# 

I am not specialist but it looks like the raspberry pi audio driver has changed when upgrading the OS and I don’t know how I can play now audio through the headphone jack.

All help is much appreciated
Jan.

Maybe it is due to configuration variable RESIN_HOST_CONFIG_dtoverlay which is set to "vc4-kms-v3d" while the same configuration variable is not set on the older raspberry pi installation.

I tried the following (inspired by what I found on google) without any success:

  1. increased RESIN_HOST_CONFIG_gpu_mem from 16 to 126 => no success
  2. changed RESIN_HOST_CONFIG_dtparam from "i2c_arm=on","spi=on","audio=on" into "i2c_arm=on","spi=on" => no success
  3. deleted configuration variable RESIN_HOST_CONFIG_dtoverlay => problem got worse. The command aplay -l hanged. I think this is a similar problem as link.

Hi @janvda , it looks like we recreated the issue here. It seems like if you remove or overwrite dtoverlay=vc4-kms-v3d it should make the audio work. We will also test on earlier versions, but it seems like this overlay, added for Pi 4 support might be causing the issue.

Thanks for looking into it.

For me deleting RESIN_HOST_CONFIG_dtoverlay didn’t work. (see point 3 above). It made the problem worse. running command aplay -l never returned had to control-c to interrupt it.

I am going back now to a previous balenaOS version and will check if I still have the problem.

Hmm, interesting. We will continue testing on our side to try narrow down where the change was caused. Thanks for helping us figuring it out.

I went back to BalenaOS balenaOS 2.38.0+rev1 and it is working again:

bash-5.0# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: 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: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
bash-5.0# 

Okay cool, I just tested 2.41.0+rev1 (grabbed it from our staging environment because it wasn’t officially released) and this version the audio jack works correctly (just running our balena-sound project).

I’m going to test 2.41.0+rev3 again with the exact test (balena-sound) and see where it breaks. I suspect its the introduction of new firmware for pi4 that could be causing it, we will see.

Hi, i am working with raspberrypi3-2.38.0+rev1-v9.15.7 very well but i upgrade of raspberrypi3-2.38.0+rev1-v9.15.7 to raspberrypi3-2.41.0+rev3-v10.2.2 and now the hdmi display not rotate not work, and if i remove the new parameter RESIN_HOST_CONFIG_dtoverlay=vc4-kms-v3d the display not work and still in boot splash screen

Thanks for the additional info @dcanob , it is looking like the Pi4 firmware update introduced in https://github.com/balena-os/balena-raspberrypi/blob/master/CHANGELOG.md#2019-08-26 might have caused issues on the pi3 devices. We will have to confirm what is going on and see what fixes we can make.

Hi, this is something from the kernel update apparently: https://github.com/raspberrypi/linux/issues/3181
So if you use the resin dashboard, go to “Device Configuration” section, then modify the existing RESIN_HOST_CONFIG_dtoverlay variable to “vc4-fkms-v3d” then audio will be working again

2 Likes

I think we need to also update the rpi firmware. Stay tuned, will let you know when there’s a new release fixing this

It has been reported that these issues (headphone jack and HDMI rotation) do not occur with balenaOS release 2.43 and later. I understand it’s due to upstream changes. If that’s not your experience, let us know.

Hi @pdcastro ,

Thanks a lot: indeed upgrading the host OS to version balenaOS 2.43.0+rev1 fixed the issue.

See following output:

root@ba7c427:/# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: 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: ALSA [bcm2835 ALSA], device 1: bcm2835 IEC958/HDMI [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: ALSA [bcm2835 ALSA], device 2: bcm2835 IEC958/HDMI1 [bcm2835 IEC958/HDMI1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Device [USB2.0 Device], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
root@ba7c427:/# 

Hi,
Great to see that it works now.