Bug 1177169 - No sound on Raspi4
No sound on Raspi4
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Sound
Current
aarch64 Other
: P5 - None : Normal with 5 votes (vote)
: ---
Assigned To: Nicolas Patricio Saenz Julienne
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-10-01 07:46 UTC by Axel Braun
Modified: 2021-05-24 12:54 UTC (History)
10 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Axel Braun 2020-10-01 07:46:54 UTC
As discussed here https://lists.opensuse.org/opensuse-arm/2020-08/msg00001.html
followed up by https://lists.infradead.org/pipermail/linux-rpi-kernel/2020-September/007865.html there is no sound using the jack output, both on Leap and Tumbleweed.
This is a reminder to kindly pick this issue up
Comment 1 Nicolas Patricio Saenz Julienne 2020-10-01 08:16:06 UTC
Just for the record, there isn't sound on the jack output upstream either.
Comment 2 Axel Braun 2020-10-01 09:54:03 UTC
(In reply to Nicolas Patricio Saenz Julienne from comment #1)
> Just for the record, there isn't sound on the jack output upstream either.

In Raspian? I understood this different from https://lists.infradead.org/pipermail/linux-rpi-kernel/2020-September/007872.html (and it would be...no good move)
Comment 3 Nicolas Patricio Saenz Julienne 2020-10-01 10:11:19 UTC
(In reply to Axel Braun from comment #2)
> (In reply to Nicolas Patricio Saenz Julienne from comment #1)
> > Just for the record, there isn't sound on the jack output upstream either.
> 
> In Raspian? I understood this different from
> https://lists.infradead.org/pipermail/linux-rpi-kernel/2020-September/007872.
> html (and it would be...no good move)

Stefan's right. Sound over HDMI will most likely be available as of Linux v5.10, the patches are already in linux-next. Sound over the Jack depends on VCHIQ, which is a staging driver and has no support for RPi4 at the moment.

Obviously, all this works with Raspberry Pi OS, but they use their own tailor made downstream kernels. We can use that, as we have a single kernel image for all arm64 devices.
Comment 4 Axel Braun 2020-10-08 16:03:27 UTC
(In reply to Nicolas Patricio Saenz Julienne from comment #3)

> Obviously, all this works with Raspberry Pi OS, but they use their own
> tailor made downstream kernels. We can use that, as we have a single kernel
> image for all arm64 devices.

You mean we should take the Raspian kernel and build it in OBS?
Comment 5 Nicolas Patricio Saenz Julienne 2020-10-08 16:05:28 UTC
Sorry, I meant to say "We can't use that".
Comment 6 Axel Braun 2020-10-08 16:24:31 UTC
(In reply to Nicolas Patricio Saenz Julienne from comment #5)
> Sorry, I meant to say "We can't use that".

Too bad, so we need to wait for upstream...
Comment 7 Takashi Iwai 2020-10-09 08:40:26 UTC
I took a quick look at rpi-5.4.y git tree, but I couldn't find relevant changes about vc04_service audio wrt RPi4.  Something else to check?
Comment 8 Nicolas Patricio Saenz Julienne 2020-10-09 08:47:45 UTC
See patches (in the rpi linux tree):

0ba0f7abb01b5433b80a43ac11d0698833729654
1228cc85e937a64573eefb5d74d7428cca3c29d2
c57f8e4665da3e48356138ad45565219331c7818

They most probably depend on other patches I didn't take into account. 

Note that, they might need a lot of clean-up before being acceptable for upstream, but feel free to have a go at it :). It's staging code so it doesn't have to be perfect.
Comment 9 Takashi Iwai 2020-10-09 09:01:15 UTC
Thanks, so it's a matter of DMA.
Then this fits better with you :)  Reassigned.
Comment 10 Zlatko Michailov 2020-12-30 22:44:45 UTC
The P5 priority is bothersome - Raspberry Pi 4 was officially released in June 2019 - 18 months ago. Media center is one of its key use cases. Raspbian even has a dedicated image for that. It would be a shame if Raspbery releases its next generation Pi before we were able to hear anything from the current one.

There hasn't been any update since the week when the bug was filed.

What are the current obstacles to the fix?

Do you need any help, including testing?
Comment 11 Zlatko Michailov 2021-01-15 02:29:32 UTC
Today's Tumbleweed upgrade installed kernel 5.10.5, but it still doesn't detect a sound card.

What is missing? Can somebody describe the exact problem with the audio?

I don't know if I'll be able to help, but I am willing to.
Comment 12 Axel Braun 2021-01-16 16:12:34 UTC
(In reply to Zlatko Michailov from comment #11)
> Today's Tumbleweed upgrade installed kernel 5.10.5, but it still doesn't
> detect a sound card.

Yes, I noticed as well....the pulseaudio-trick from https://bugzilla.opensuse.org/show_bug.cgi?id=1180926 did not work for me
Comment 13 Nicolas Patricio Saenz Julienne 2021-01-18 11:14:52 UTC
Hi Zlatko,
with v5.10 the new display controller is indeed available. It should also take care of HDMI sound. I've been looking into enabling it by default for all Tumbleweed users, but some use-cases are broken at the moment. Specifically DSI displays. The RPi foundation guys are working on it and I don't think we can enable it by default until that's fixed.

As for HDMI, some other fixes are needed[1]. They'll eventually make their way into the stable branches.

Once they are available and as long as you're using HDMI, you'll be able to test it by editing the config.txt file in the EFI partition (on a live system you'll find it in /boot/efi/config.txt).

replacing this:

  dtoverlay=disable-vc4

with,

  dtoverlay=vc4-kms-v3d,cma-default

I'll update this issue once TW's kernel is ready. pulseaudio should then work out of the box (as long as it's installed in the system). 

[1] https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg2443433.html
Comment 14 Zlatko Michailov 2021-01-20 08:13:47 UTC
Thanks for the update, Nicolas!

Yes, I mean HDMI. What I understand from your response is that a fix is in the pipeline. We are waiting for it to propagate through the kernel branches to land in Tumbleweed. If that is a correct understanding, I'll be waiting for your next update once the fixed kernel starts rolling out.
Comment 15 Nicolas Patricio Saenz Julienne 2021-01-20 09:37:27 UTC
(In reply to Zlatko Michailov from comment #14)
> Thanks for the update, Nicolas!
> 
> Yes, I mean HDMI. What I understand from your response is that a fix is in
> the pipeline. We are waiting for it to propagate through the kernel branches
> to land in Tumbleweed. If that is a correct understanding, I'll be waiting
> for your next update once the fixed kernel starts rolling out.

Yes, that's it.
Comment 16 Guillaume GARDET 2021-02-03 10:31:21 UTC
Snapshot 20210202 includes include "drm/vc4: Unify PCM card's driver_name" which seems to be the missing patch for sound via HDMI on RPi4.

So, if snapshot 20210202 goes green in openQA, you should have sound on RPi4 soon.
Comment 17 Zlatko Michailov 2021-02-03 22:44:03 UTC
Thanks for the update! Please don't close the bug until Axel Brown and/or I confirm that the fix is publicly available.
Comment 18 Zlatko Michailov 2021-02-06 07:36:45 UTC
I just installed the latest Tumbleweed update.
Replaced the dtoverlay setting under [pi4] with the value from [pi3].
Rebooted.

No sound card shows up in Yast > Hardware > Sound.
Comment 19 Zlatko Michailov 2021-02-07 23:49:12 UTC
@SUSE_Insiders, don't you have a way to deploy a debugable kernel and a debuggable driver, so you can step through the code?
Comment 20 Nicolas Patricio Saenz Julienne 2021-02-08 13:12:52 UTC
Hi Zlatko,
please try this replacing this in config.txt:

  dtoverlay=vc4-kms-v3d,cma-default

with 

  dtoverlay=vc4-kms-v3d-pi4,cma-default

and provide the output of "aplay -L".
Comment 21 Zlatko Michailov 2021-02-09 02:02:02 UTC
Set the dtoverlay as suggested. Rebooted.

1) Yast > Hardware > Sound
Still nothing shows up

2) aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
sysdefault
    Default Audio Device
iec958
    IEC958 (S/PDIF) Digital Audio Output
speexrate
    Rate Converter Plugin Using Speex Resampler
pulse
    PulseAudio Sound Server
upmix
    Plugin for channel upmix (4,6,8)
default
    Default ALSA Output (currently PulseAudio Sound Server)
sysdefault:CARD=vc4hdmi0
    vc4-hdmi-0, MAI PCM vc4-hdmi-hifi-0
    Default Audio Device
front:CARD=vc4hdmi0,DEV=0
    vc4-hdmi-0, MAI PCM vc4-hdmi-hifi-0
    Front output / input
iec958:CARD=vc4hdmi0,DEV=0
    vc4-hdmi-0, MAI PCM vc4-hdmi-hifi-0
    IEC958 (S/PDIF) Digital Audio Output
sysdefault:CARD=vc4hdmi1
    vc4-hdmi-1, MAI PCM vc4-hdmi-hifi-0
    Default Audio Device
front:CARD=vc4hdmi1,DEV=0
    vc4-hdmi-1, MAI PCM vc4-hdmi-hifi-0
    Front output / input
iec958:CARD=vc4hdmi1,DEV=0
    vc4-hdmi-1, MAI PCM vc4-hdmi-hifi-0
    IEC958 (S/PDIF) Digital Audio Output

3) aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM vc4-hdmi-hifi-0 [MAI PCM vc4-hdmi-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: vc4hdmi1 [vc4-hdmi-1], device 0: MAI PCM vc4-hdmi-hifi-0 [MAI PCM vc4-hdmi-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
Comment 22 Zlatko Michailov 2021-02-09 03:25:03 UTC
I apologize. There is sound!

I was looking for a sound card in yast as well as for the sound control widget on the system trey. Those are still not there. But there is sound!

As far as the kernel is concerned, the bug is fixed. There is some update scripting needed - to modify the dtoverlay setting, to show the sound control widget, and to show a sound card in yast. But each of those should have a separate bug.

Please file those separate bugs, as you know what needs to be done.

You can close this one. Thank you!
Comment 23 Matthias Brugger 2021-02-09 08:26:04 UTC
(In reply to Zlatko Michailov from comment #22)
> I apologize. There is sound!
> 
> I was looking for a sound card in yast as well as for the sound control
> widget on the system trey. Those are still not there. But there is sound!
> 
> As far as the kernel is concerned, the bug is fixed. There is some update
> scripting needed - to modify the dtoverlay setting, to show the sound
> control widget, and to show a sound card in yast. But each of those should
> have a separate bug.
> 
> Please file those separate bugs, as you know what needs to be done.
> 

I think the best person to file these bugs are you not someone else. You have the setup in place and care enough to push people to look into this. So feel free to open the bugs.
Comment 24 Zlatko Michailov 2021-02-09 18:45:06 UTC
(In reply to Matthias Brugger from comment #23)
> I think the best person to file these bugs are you not someone else. You
> have the setup in place and care enough to push people to look into this. So
> feel free to open the bugs.

Please provide a responsible Component for each of those bugs:
1. dtoverlay setting in /boot/efi/config.txt.
2. Sound card in Yast > Hardware > Sound.
3. Sound Control widget on the XFCE task bar.

The last time I filed new bugs for SUSE, they ended up assigned to me. (And they still are. You can look them up.) As an outsider, I am not familiar with your internal ownership. I don't want them to bounce back to me again.
Comment 25 Matthias Brugger 2021-02-10 09:40:36 UTC
(In reply to Zlatko Michailov from comment #24)
> (In reply to Matthias Brugger from comment #23)
> > I think the best person to file these bugs are you not someone else. You
> > have the setup in place and care enough to push people to look into this. So
> > feel free to open the bugs.
> 
> Please provide a responsible Component for each of those bugs:
> 1. dtoverlay setting in /boot/efi/config.txt.

Bootloader

> 2. Sound card in Yast > Hardware > Sound.

Yast2

> 3. Sound Control widget on the XFCE task bar.

Xfce

> 
> The last time I filed new bugs for SUSE, they ended up assigned to me. (And
> they still are. You can look them up.) As an outsider, I am not familiar
> with your internal ownership. I don't want them to bounce back to me again.

I commented in the corresponding bugs.
Comment 26 Zlatko Michailov 2021-02-10 19:39:55 UTC
(In reply to Matthias Brugger from comment #25)
> 1. dtoverlay setting in /boot/efi/config.txt.
> Bootloader
bug 1182080
 
> 2. Sound card in Yast > Hardware > Sound.
> Yast2
bug 1182081

> 3. Sound Control widget on the XFCE task bar.
> Xfce
bug 1182082
Comment 27 Axel Braun 2021-02-17 15:54:04 UTC
(In reply to Nicolas Patricio Saenz Julienne from comment #20)

> please try this replacing this in config.txt:

precisely......
removing this line from [rp3] section....
 
>   dtoverlay=vc4-kms-v3d,cma-default
> 
> with 

and adding this line in [rp4] section:
 
>   dtoverlay=vc4-kms-v3d-pi4,cma-default

and removing 

dtoverlay=disable-vc4
dtoverlay=disable-v3d

from [rp4] section

aplay -l gives me the same output, but I cant get sound to work:

Raspi:~/Downloads # speaker-test

speaker-test 1.2.4

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
ALSA lib pulse.c:242:(pulse_connect) PulseAudio: Unable to connect: Connection refused

Playback open error: -111,Connection refused

Tumbleweed 20210209, XFCE
Comment 28 Kasimir _ 2021-02-19 16:53:27 UTC
I tested version openSUSE-Tumbleweed-ARM-X11-raspberrypi.aarch64-2021.02.19-Build1.2 and did the following: 
in config.txt
> adding this line in [rp4] section:
>   dtoverlay=vc4-kms-v3d-pi4,cma-default

> and removing 
>   dtoverlay=disable-vc4
>   dtoverlay=disable-v3d

With a normal user, I could play an audio stream in Firefox and had sound on the HDMI.

The same audio stream was not played as root.
Comment 29 Axel Braun 2021-02-22 07:06:33 UTC
(In reply to Kasimir _ from comment #28)
> I tested version
> openSUSE-Tumbleweed-ARM-X11-raspberrypi.aarch64-2021.02.19-Build1.2 and did
> the following: 
> in config.txt
> > adding this line in [rp4] section:
> >   dtoverlay=vc4-kms-v3d-pi4,cma-default
> 
> > and removing 
> >   dtoverlay=disable-vc4
> >   dtoverlay=disable-v3d
> 
> With a normal user, I could play an audio stream in Firefox and had sound on
> the HDMI.
> 
> The same audio stream was not played as root.

I can confirm this! Sound via HDMI for user, but not for root.
Jack output still dead.

@Takashi - is there a chance that the driver is backported to Leap 15.2/3?
Comment 30 Nicolas Patricio Saenz Julienne 2021-02-22 09:20:35 UTC
(In reply to Axel Braun from comment #29)
> (In reply to Kasimir _ from comment #28)
> > I tested version
> > openSUSE-Tumbleweed-ARM-X11-raspberrypi.aarch64-2021.02.19-Build1.2 and did
> > the following: 
> > in config.txt
> > > adding this line in [rp4] section:
> > >   dtoverlay=vc4-kms-v3d-pi4,cma-default
> > 
> > > and removing 
> > >   dtoverlay=disable-vc4
> > >   dtoverlay=disable-v3d
> > 
> > With a normal user, I could play an audio stream in Firefox and had sound on
> > the HDMI.
> > 
> > The same audio stream was not played as root.
> 
> I can confirm this! Sound via HDMI for user, but not for root.
> Jack output still dead.
> 
> @Takashi - is there a chance that the driver is backported to Leap 15.2/3?

The fixes will be available in leap 15.3.
Comment 31 Nicolas Patricio Saenz Julienne 2021-03-04 09:51:13 UTC
The fixes are available in Tumbleweed and in Leap 15.3 (whenever it's released).