Skip to content

Is it possible to disable VC4 sound? #2489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
vanfanel opened this issue Apr 5, 2018 · 38 comments
Open

Is it possible to disable VC4 sound? #2489

vanfanel opened this issue Apr 5, 2018 · 38 comments
Labels
Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator. Waiting for internal comment Waiting for comment from a member of the Raspberry Pi engineering team

Comments

@vanfanel
Copy link

vanfanel commented Apr 5, 2018

Hi,

Using the BRCM drivers, there's the "dtparam=audio=off" option in config.txt to disable loading the audio modules, but what's the way to do the same with the VC4 drivers?
I am having problems with my HifiBerry DAC+ and I would like to disable the onboard audio.
I suppose I could build a kernel without VC4 audio support, but I'm sure there must be a way to archieve the same without rebuilding the kernel, right?

Thanks

@JamesH65
Copy link
Contributor

@popcornmix @pelwell Not quite sure what is wanted here. Is there such a thing as VC4 audio support? Nothing in the kernel config about it.

@vanfanel What do you mean by VC4 audio with regard to the Linux kernel?

@JamesH65 JamesH65 added Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator. Waiting for internal comment Waiting for comment from a member of the Raspberry Pi engineering team labels May 11, 2018
@JamesH65
Copy link
Contributor

@popcornmix Any ideas?

@JamesH65
Copy link
Contributor

The audio driver is bcm2835-audio, it's a module, so can you simply remove the module to disable it?

This issue will be closed within 30 days unless further interactions are posted. If you wish this issue to remain open, please add a comment. A closed issue may be reopened if requested.

@JamesH65 JamesH65 added the Close within 30 days Issue will be closed within 30 days unless requested to stay open label Jul 31, 2019
@pelwell
Copy link
Contributor

pelwell commented Jul 31, 2019

I'm pretty sure he's referring to the HDMI audio support available from the VC4 driver, but why he couldn't reply to that effect beats me.

Audio is part of the regular vc4_hdmi driver, which is itself bundled into the overall vc4 module, so blacklisting won't work. It will skip the audio initialisation without failing to create everything else if the Device Tree node has no dmas property, but deleting a property isn't possible with an overlay. Fortunately a present-but-empty dmas doesn't make any sense, so we can modify the driver to treat an empty dmas the same as an absent one.

If @vanfanel shows an interest I can make that change and add an overlay parameter to control it, otherwise I have more important things to do.

@vanfanel
Copy link
Author

@JamesH65 and @pelwell : I am VERY sorry I did nor reply earlier. I thought I had! Sorry.

I am referring to the VC4-related vc4-hdmi ALSA card, yes, not the bcm2835 ALSA card. The bcm2835 card works fine, and I know it can be disabled on config.txt very easily.
But the vc4-hdmi audio card provided by the VC4 stack only seems to support one format and frequency:

#3043

So, yes, disabling the vc4-hdmi in config.txt card via an overlay parameter would be desirable.
But even better would be having the vc4-hdmi audio card working instead of depending on the (deprecated?) bmc2835 interface.

@pelwell
Copy link
Contributor

pelwell commented Jul 31, 2019

Tweaking the driver and adding the overlay parameter is something I can do in a few minutes, getting the driver to work could take days/weeks for me.

@vanfanel
Copy link
Author

@pelwell: I perfectly understand.
Do you have an idea on why the vc4-hdmi driver only supports one audio format? Is it still being developed?

@pelwell
Copy link
Contributor

pelwell commented Jul 31, 2019

Is it still being developed?

Yes and no - it isn't finished (in that it isn't fully featured), but the developer isn't actively working on it.

@vanfanel
Copy link
Author

@pelwell : This is shocking! The vc4 development is abandoned? What will be the graphics standard for the Pi then?

@pelwell
Copy link
Contributor

pelwell commented Jul 31, 2019

Others are being moved onto the project, but progress will be slow for a while.

@popcornmix
Copy link
Collaborator

Note: you can still use the legacy alsa driver with vc4-fkms-v3d (and vc4-kms-v3d).
That is how LibreELEC is configured on Pi4.

@vanfanel
Copy link
Author

@popcornmix : full vc4-kms-v3d is what I use on my projects involving small Pi systems. I know the legacy alsa driver (bmc2835) works fine with that, but having two ALSA drivers (legacy bmc2835 and vc4-hdmi) is causing problems, thats why I was asking if the non-working vc4-hdmi alsa driver could be somehow disabled.

@pelwell
Copy link
Contributor

pelwell commented Jul 31, 2019

I'll add the ability to disable it when I get a spare moment.

@vanfanel
Copy link
Author

@pelwell : Thanks!

pelwell pushed a commit that referenced this issue Jul 31, 2019
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
pelwell pushed a commit that referenced this issue Jul 31, 2019
The audio parameter to the vc4-kms-v3d overlay allows audio support
to be disabled (it defaults to on) by adding "audio=off" to the
dtoverlay parameters.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
@pelwell
Copy link
Contributor

pelwell commented Jul 31, 2019

I've pushed patches that should resolve this issue for you. They'll get picked up by future kernel builds.

@vanfanel
Copy link
Author

@pelwell: Great! I hope one day we can rely on the vc4-hdmi ALSA driver... but for now, this will do!

@6by9
Copy link
Contributor

6by9 commented Aug 1, 2019

The hardware only supports one format, and that is SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE.
Questions were asked on the relevant kernel mailing lists as to who or what should be responsible
for adding that encapsulation when the client wants to provide something else, but no answers were forthcoming.

Duplication in all relevant drivers seems wrong and alsa should in theory support it, but getting the magic runes in asoundrc correct is non-trivial. There is some reference in https://anholt.livejournal.com/49474.html?nojs=1, but I can't find the kernel mailing list references at present.
Memory says Pulseaudio will also deal with it all for you, and allows mixing of the streams prior to encapsulation which AIUI alsalib won't allow you to do.

popcornmix added a commit to raspberrypi/firmware that referenced this issue Aug 1, 2019
kernel: Correct the name of the Raspberry Pi video decoder
See: raspberrypi/linux#3111

kernel: Fixup FKMS interrupt handing for non-existent display
See: raspberrypi/linux#3110

kernel: katana volume minimum value correction
See: raspberrypi/linux#3109

kernel: can: mcp251x: Allow more time after a reset
See: raspberrypi/linux#2767

kernel: overlays: Update the upstream overlay

kernel: overlays: Add audio parameter to vc4-kms-v3d
See: raspberrypi/linux#2489

firmware: pwm_audio: Use the correct DREQs on Pi4
See: #1214

firmware: pixelvalve_2711: Alter back porch for widths of 1366
See: #1202

firmware: Clear the SMIDSW1 display interrupt flag on startup

firmware: dt-blob: Declare Pi 4B's SD_IO voltage selector
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this issue Aug 1, 2019
kernel: Correct the name of the Raspberry Pi video decoder
See: raspberrypi/linux#3111

kernel: Fixup FKMS interrupt handing for non-existent display
See: raspberrypi/linux#3110

kernel: katana volume minimum value correction
See: raspberrypi/linux#3109

kernel: can: mcp251x: Allow more time after a reset
See: raspberrypi/linux#2767

kernel: overlays: Update the upstream overlay

kernel: overlays: Add audio parameter to vc4-kms-v3d
See: raspberrypi/linux#2489

firmware: pwm_audio: Use the correct DREQs on Pi4
See: raspberrypi/firmware#1214

firmware: pixelvalve_2711: Alter back porch for widths of 1366
See: raspberrypi/firmware#1202

firmware: Clear the SMIDSW1 display interrupt flag on startup

firmware: dt-blob: Declare Pi 4B's SD_IO voltage selector
@popcornmix
Copy link
Collaborator

@vanfanel this is in latest rpi-update kernel. Can you test? I think you want:

dtoverlay=vc4-kms-v3d,audio=off

@vanfanel
Copy link
Author

vanfanel commented Aug 3, 2019

@popcornmix : Yes! It works! 👍

@6by9 : I put all the information I could find regarding a possible asoundrc here: #3043
There is a supposedly working asoundrc in: https://github.com/raw/takaswie/alsa-lib/master/src/conf/cards/vc4-hdmi.conf
...but sadly it does not work for me.
As you can see, I tried different combinations with no success... I believe ALSA can take care of format conversions.

pelwell pushed a commit that referenced this issue Sep 13, 2019
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
pelwell pushed a commit that referenced this issue Sep 13, 2019
The audio parameter to the vc4-kms-v3d overlay allows audio support
to be disabled (it defaults to on) by adding "audio=off" to the
dtoverlay parameters.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
pelwell pushed a commit that referenced this issue Sep 13, 2019
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
pelwell pushed a commit that referenced this issue Sep 13, 2019
The audio parameter to the vc4-kms-v3d overlay allows audio support
to be disabled (it defaults to on) by adding "audio=off" to the
dtoverlay parameters.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Jun 6, 2022
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Jun 6, 2022
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Jun 6, 2022
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Jun 14, 2022
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Jun 14, 2022
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Jun 20, 2022
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
herrnst pushed a commit to herrnst/linux-raspberrypi that referenced this issue Jun 21, 2022
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: raspberrypi#2489

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Jun 23, 2022
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Jun 27, 2022
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Jul 4, 2022
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Jul 4, 2022
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
herrnst pushed a commit to herrnst/linux-raspberrypi that referenced this issue Jul 10, 2022
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: raspberrypi#2489

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Jul 11, 2022
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Jul 11, 2022
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Jul 18, 2022
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Jul 18, 2022
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Aug 1, 2022
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Aug 1, 2022
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Aug 1, 2022
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Aug 15, 2022
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this issue Aug 15, 2022
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: #2489

Signed-off-by: Phil Elwell <[email protected]>
papamoose pushed a commit to papamoose/ubuntu-kernel-raspi-jammy that referenced this issue Sep 3, 2022
BugLink: https://bugs.launchpad.net/bugs/1958146

Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: raspberrypi/linux#2489

Signed-off-by: Phil Elwell <[email protected]>

(cherry picked from commit af76f3fa05e1586a39597dcc2e0e8bd71f533e1e rpi-5.15.y)
Signed-off-by: Juerg Haefliger <[email protected]>
@DennisFury
Copy link

just wanted to say I also ran into this issue. Mine was a bit different, my USB speaker and one of the HDMI audios (vc4hdmi#) kept switching positions as the card # (result of aplay -l ) after each reboot. I use this as a personal kisok display and my script would fail to run after 1/2 the reboots because no audio device found (wrong default device set).

Using this command in /boot/config.txt and now I only see 1 HDMI audio in aplay -l
dtoverlay=vc4-kms-v3d,audio=off

so far so good, I would expect both HDMI audio devices to be gone ( I still see vc4hdmi1, but at least vc4hdmi0 is gone).

4 reboots and he card numbers for the devices appear to be sticking.

thanks

@uxigene
Copy link

uxigene commented May 17, 2023

just wanted to say I also ran into this issue. Mine was a bit different, my USB speaker and one of the HDMI audios (vc4hdmi#) kept switching positions as the card # (result of aplay -l ) after each reboot. I use this as a personal kisok display and my script would fail to run after 1/2 the reboots because no audio device found (wrong default device set).

Using this command in /boot/config.txt and now I only see 1 HDMI audio in aplay -l dtoverlay=vc4-kms-v3d,audio=off

so far so good, I would expect both HDMI audio devices to be gone ( I still see vc4hdmi1, but at least vc4hdmi0 is gone).

4 reboots and he card numbers for the devices appear to be sticking.

thanks

Have same issue. Can't disable vc4hdmi1 in my rasberrypi 4

@strilov
Copy link

strilov commented May 23, 2023

Hi. In case this is still an issue, there seems to be a pi4 specific overlay, which has audio options for hdmi0 and hdmi1: https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/vc4-kms-v3d-pi4-overlay.dts#L181

@mightyoakbob
Copy link

Interesting, thanks for the info, just wish i understood it.
Bob.

@vanfanel
Copy link
Author

Hi. In case this is still an issue, there seems to be a pi4 specific overlay, which has audio options for hdmi0 and hdmi1: https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/vc4-kms-v3d-pi4-overlay.dts#L181

Can you please give an example on how to use that overlay to get video & audio on HDMI-1 only?

Thanks

@pelwell
Copy link
Contributor

pelwell commented May 27, 2023

There is help available: $ dtoverlay -h vc4-kms-v3d (or browse the README directly).
The answer you are looking for is:

dtoverlay=vc4-kms-v3d,nohdmi0

Unless you are labelling the connectors 1 & 2, in which case you want:

dtoverlay=vc4-kms-v3d,nohdmi1

@vanfanel
Copy link
Author

There is help available: $ dtoverlay -h vc4-kms-v3d (or browse the README directly). The answer you are looking for is:

dtoverlay=vc4-kms-v3d,nohdmi0

Unless you are labelling the connectors 1 & 2, in which case you want:

dtoverlay=vc4-kms-v3d,nohdmi1

Ah, yes, thanks for that :)

jai-raptee pushed a commit to jai-raptee/iliteck1 that referenced this issue Apr 30, 2024
Overlays are unable to remove properties in the base DTB, but they
can overwrite them. Allow a present but empty 'dmas' property
to also disable the HDMI audio interface.

See: raspberrypi/linux#2489

Signed-off-by: Phil Elwell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator. Waiting for internal comment Waiting for comment from a member of the Raspberry Pi engineering team
Projects
None yet
Development

No branches or pull requests