raspberrypi / linux

Kernel source tree for Raspberry Pi-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://forums.raspberrypi.com/
Other
11.2k stars 5.02k forks source link

dummy output with hifiberry sound card #5763

Closed tartanpion closed 11 months ago

tartanpion commented 11 months ago

Describe the bug

No sound after kernel linux-rpi4 6.1.64-1 or linux-rpi4-mainline 6.6.3-1 aplay -l **** Liste des périphériques matériels PLAYBACK **** carte 0 : sndrpihifiberry [snd_rpi_hifiberry_dacplus], périphérique 0 : HiFiBerry DAC+ Pro HiFi pcm512x-hifi-0 [HiFiBerry DAC+ Pro HiFi pcm512x-hifi-0] Sous-périphériques : 1/1 Sous-périphérique #0 : subdevice #0

Steps to reproduce the behaviour

Install new kernel

Device (s)

Raspberry Pi 4 Mod. B

System

Linux bloodmoon-pc 6.6.3-1-MANJARO-RPI4 #1 SMP PREEMPT Thu Nov 30 12:20:36 UTC 2023 aarch64 GNU/Linux

config.txt

`# Enable audio (loads snd_bcm2835)

force_eeprom_read=0 dtoverlay=

dtparam=audio=on

dtoverlay=hifiberry-dacplus `

Logs

` nov. 30 22:22:32 bloodmoon-pc wireplumber[1534]: [0:00:40.819045770] [1534] ERROR IPAModule ipa_module.cpp:172 Symbol ipaModuleInfo not found

nov. 30 22:22:32 bloodmoon-pc wireplumber[1534]: [0:00:40.819115363] [1534] ERROR IPAModule ipa_module.cpp:292 v4l2-compat.so: IPA module has no valid info nov. 30 22:22:32 bloodmoon-pc wireplumber[1534]: [0:00:40.819239844] [1534] INFO Camera camera_manager.cpp:284 libcamera v0.1.0 nov. 30 22:22:32 bloodmoon-pc kernel: pcm512x 1-004d: ASoC: error at snd_soc_pcm_component_pm_runtime_get on pcm512x.1-004d: -22 nov. 30 22:22:32 bloodmoon-pc kernel: pcm512x 1-004d: ASoC: error at snd_soc_pcm_component_pm_runtime_get on pcm512x.1-004d: -22 nov. 30 22:22:32 bloodmoon-pc kernel: pcm512x 1-004d: ASoC: error at snd_soc_pcm_component_pm_runtime_get on pcm512x.1-004d: -22 nov. 30 22:22:32 bloodmoon-pc kernel: pcm512x 1-004d: ASoC: error at snd_soc_pcm_component_pm_runtime_get on pcm512x.1-004d: -22 nov. 30 22:22:32 bloodmoon-pc bluetoothd[441]: Failed to add UUID: Failed (0x03) nov. 30 22:22:32 bloodmoon-pc bluetoothd[441]: Failed to add UUID: Failed (0x03) `

Additional context

No response

pelwell commented 11 months ago

Is the 6.1.64 kernel also mainline?

And what's the most recent kernel you can remember with working sound? You may find something in the system logs (perhaps from journalctl).

tartanpion commented 11 months ago

Working sound with all the kernels before. Last good kernels : linux-rpi4 6.1.63-1 or linux-rpi4-mainline 6.6.2-1. Mainline is just the name for manjaro to differentiate 6.1/6.6.

pelwell commented 11 months ago

Thanks - that helps a lot.

Dark-Sky commented 11 months ago

_nov. 30 22:22:32 bloodmoon-pc wireplumber[1534]: [0:00:40.819115363] [1534] ERROR IPAModule ipa_module.cpp:292 v4l2-compat.so: IPA module has no valid info nov. 30 22:22:32 bloodmoon-pc wireplumber[1534]: [0:00:40.819239844] [1534] INFO Camera cameramanager.cpp:284 libcamera v0.1.0

At least this looks like it is getting blamed on an ARCH-ARM packaging issue here:

https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3411

Tag me here if I need to compile a test kernel for the OP.

pelwell commented 11 months ago

Interesting, but it's the later error messages that looked more relevant:

nov. 30 22:22:32 bloodmoon-pc kernel: pcm512x 1-004d: ASoC: error at snd_soc_pcm_component_pm_runtime_get on pcm512x.1-004d: -22
nov. 30 22:22:32 bloodmoon-pc kernel: pcm512x 1-004d: ASoC: error at snd_soc_pcm_component_pm_runtime_get on pcm512x.1-004d: -22
nov. 30 22:22:32 bloodmoon-pc kernel: pcm512x 1-004d: ASoC: error at snd_soc_pcm_component_pm_runtime_get on pcm512x.1-004d: -22
nov. 30 22:22:32 bloodmoon-pc kernel: pcm512x 1-004d: ASoC: error at snd_soc_pcm_component_pm_runtime_get on pcm512x.1-004d: -22
HiassofT commented 11 months ago

From a quick test this commit https://github.com/raspberrypi/linux/commit/1985fab7f8520e4629c09eba8d40ebf57a862851 which landed in 6.6.3 and 6.1.64 seems to be triggering that - I also noticed that on LibreELEC with kernel 6.6.3 on RPi5 and 6.1.64 on RPi4

[   13.206401] pcm512x 1-004c: Failed to sync cache: -22
[   13.211506] pcm512x 1-004c: ASoC: error at snd_soc_pcm_component_pm_runtime_get on pcm512x.1-004c: -22

EDIT: using an iqaudio DAC here (guess pretty much all pcm512x cards should be affected)

pelwell commented 11 months ago

Thanks, @HiassofT. Can you confirm that reverting that commit fixes the problem?

HiassofT commented 11 months ago

yes, with the commit reverted pcm512x is back to normal

LibreELEC:~ # dmesg | grep pcm512x
[   11.153738] pcm512x 1-004c: No SCLK, using BCLK: -2

and I have working audio (RPi5, LibreELEC master, kernel 6.6.3)

pelwell commented 11 months ago

That's great - it's reverted on rpi-6.1.y. and on its way to the others.

tartanpion commented 11 months ago

I have working audio too after the revert.

pelwell commented 11 months ago

Cool. That reversion will remain in our kernel builds until the problem is fixed upstream.

You can close the issue if you feel the matter has been dealt with.

HiassofT commented 11 months ago

@pelwell I've reported the issue upstream https://lore.kernel.org/stable/ZWo45hiK-n8W_yWJ@camel3.lan/

pelwell commented 11 months ago

Thanks - I think your proposed patch will be the accepted fix.

HiassofT commented 11 months ago

I've submitted the fix, hope it dribbles down to stable soon https://lore.kernel.org/lkml/20231203222216.96547-1-hias@horus.com/T/#u

HiassofT commented 11 months ago

@pelwell @popcornmix quick heads up: the upstream fix will be in the next stable kernels, Greg just added it to his queues

HiassofT commented 11 months ago

The fix is now upstream in 6.1.68/6.6.7 kernels.

@popcornmix could you please update rpi 6.1 and 6.6 branches?

pelwell commented 11 months ago

That's done now - thanks for the diagnosis, and for getting a fix upstreamed so rapidly.

pelwell commented 11 months ago

Oh dear - re-reading your message I should just have waited for the next merge.