-
Notifications
You must be signed in to change notification settings - Fork 5.2k
bcm270x: add dtparam to enable onboard sound device #981
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
Conversation
The sound driver loads by default on Raspian, so the default behaviour has not changed. The problem with this PR is that it changes the default behaviour by having onboard audio disabled by default. |
Blacklisting snd-bcm2835 or using dtparam=audio=off with audio
enabled in DT works, too. But I thought that since we have this
nice devicetree thing it would be best to use that to configure
it and do that in the same way as with I2C, SPI etc.
Having the snd-bcm2835 loaded complicates things a lot if you
are using USB or I2S soundcards - then you have to setup an
.asoundrc and/or configure the software to use the correct device.
With just one soundcard in the system things are a lot easier :)
Also people using OpenELEC now have an additional ALSA: entry
at the end of the list, in addition to the PI analog/HDMI/both
entries.
OTOH I absolutely understand that breaking defaults for Raspbian
users is not a good thing - I'd be fine using an audio=off entry
in my config.txt too if that's the general consensus.
|
Switching to blacklisting (opt-out) from /etc/modules (opt-in) runs counter to the "blacklisting bad, device tree good" message. But I also want to preserve the existing enabled-by-default behaviour. I vote for:
|
Report of HifiBerry breakage in OpenELEC after #977 I think the issue is that snd-bcm2835 wasn't enabled by firmware/kernel in the past, but raspbian enabled it (in /etc/modules). OpenELEC/OSMC deliberately didn't enable it in /etc/modules, so their default behaviour has changed. |
This will give back the old behaviour (no module autoloading): diff --git a/sound/arm/bcm2835.c b/sound/arm/bcm2835.c
index 6b545e7..d78cb38 100644
--- a/sound/arm/bcm2835.c
+++ b/sound/arm/bcm2835.c
@@ -312,7 +312,6 @@ static const struct of_device_id snd_bcm2835_of_match_table[] = {
{ .compatible = "brcm,bcm2835-audio", },
{},
};
-MODULE_DEVICE_TABLE(of, snd_bcm2835_of_match_table);
static struct platform_driver bcm2835_alsa0_driver = {
.probe = snd_bcm2835_alsa_probe, But I don't recommend it as the driver will not behave as one would expect. Ideally it's the Device Tree that should decide which devices are present/wanted. |
The audio node is enabled by default and can be disabled with dtparam=audio=off in config.txt
I've updated the commit to only add the dtparam.
I think it's best to leave it at this for now and let you decide
later if you want to change the default or not.
|
bcm270x: add dtparam to enable/disable onboard sound device
Further discussions with @pelwell and we've taken a compromise step: This should means that either snd-bcm2835 in /etc/modules or dtparam=audio=on in config.txt results in working audio. If both are missing then snd-bcm2835 will not be loaded. The concern is that OpenELEC/OSMC/other platforms don't expect snd-bcm2835 to be loaded by default and don't behave well. Expecting all users to add dtparam=audio=off to resolve this will create a lot of support issues. This will be temporary. We'll ensure future raspbian images ship with dtparam=audio=on in config.txt and will look into adding this as part of the apt-get upgrade procedure. When we are happy dtparam=audio=on is commonplace, we'll revert the platform part of this commit (leaving audio disabled in default DT). |
That's a very nice solution!
Just tested the various interactions between config.txt and module
configuration in Linux and everything's working fine.
Thanks a lot!
|
Sync with v6.2
PR977 has the sideeffect of snd-bcm2835 being enabled by default.
This PR changes this back to the previous default and adds a device tree parameter
so snd-bcm2835 can be enabled like the other devices with "dtparam=audio=on".