How to disable Raspberry Pi 3 on-board sound?

Any thoughts on how to disable the Raspi3 on-board sound card? I need to stop the snd_bcm2835 module from loading. I have been unable to disable it inside the resin container.

1 Like

Sorry, what do you mean by being unable to disable it?

Usually modules that are automatically loaded are just removed with rmmod for example in the start script of the application. Just checked, and normally rmmod snd_bcm2835 should work (probably with some thought around it).

By the way, what sort of use case you have in mind?

If you are trying to send the audio over HDMI instead of the onboard audio, then you can do that by enabling these options in config.txt:


(which can be done remotely better with with Fleet or Device configuration RESIN_HOST_CONFIG_hdmi_group set to 1 and RESIN_HOST_CONFIG_hdmi_drive set to 2). See more info in the list of the available config.txt settings on the Raspberry Pi site.

Thanks @imrehg, I’ll give rmmod a try.

It needs to be disabled for hardware timing reasons:

1 Like

Shouldn’t setting the device config variable RESIN_HOST_CONFIG_dtparam to audio=off disable on-board sound? (I tried setting it but snd_bcm2835 was still loaded.)

How come ResinOS loads snd_bcm2835 even though there’s no dtparam=audio=on in config.txt (like in Raspbian)?

First off, whatever works on Raspbian should work on resinOS as well, because we are using their config/kernel/etc, provided that you are comparing the specific Raspbian version where that kernel/firmware was used (that is not to compare across software versions, e.g. kernel 4.4 Raspbian with kernel 4.1.21 resinOS).

I’ve tried it out a bit, and there seems to be indeed a discrepancy, will check it out in more detail and get back with whatever we find!

1 Like

Looks like found the culprit. :frowning: As my colleague @andrei pointed it out, the sound module is actually manually loaded on the Raspberry Pi by the current setup: resin-init-board. I’m guessing this is for historical reasons, but it’s definitely not a correct behaviour (as we are thinking now, based on your feedback and all). We’ll be checking out how to fix this while not breaking existing applications that rely on this behaviour (I do have a couple that would be broken by removing this, even if I didn’t know before :musical_note: ).

In the meantime, manually removing the module with rmmod at the application start is probably the best. In general we think it’s better to explicitly specify and load the modules you need with modprobe in the beginning of your application as well. (explicit requirements and less magic is more reliable for everyone - we are only halfway there in this case)

1 Like

Hey guys, just to let you know, I have popped an issue up on the resinOS repo for this, so just subscribe to this: and hopefully we can get it fixed and working as expected asap.


Thanks all, rmmod does seem to be working for the time being. Though it tells me that the module isn’t loaded when I run it. Is that something that is persisting through restarts, so that maybe it worked the first time but now it still sees the module as unloaded?

If it’s container restarts with the device staying on (e.g. when you git push resin master or restart just the container) that could be the case, yeah. Though it’s not a worry – running rmmod against a module that’s not loaded won’t actually have any bad effects. You just get the warning message that the module isn’t actually loaded.

You could suppress that if you want by doing something like

rmmod modulename 2&> /dev/null

if it is a concern.

1 Like

@danielmahon do you get the libary work on a Pi3 to show images or something to the LEDMatrixes?

@MariusSG5 Yes! I am using a Raspi3 (on resin) to run Pixel Pusher server and display on 12 32x64 led matrix panels from Adafruit. An Intel NUC (on resin) is running an ElectronJS interface which controls a Processing sketch which is broadcasting to the Pixel Pusher server at ~30fps.

Do yo have also tried to get the HDMI Signal from the Pi over the Adafruit Hat on the led matrix panels from Adafruit.
Because i want to display the HDMI Signal of the Pi to 24 32x64 led matrix panels, the libary compiled and works but i did not got any Signals to the panels

I have. But you will never be able to power that many displays over the Pi hat unfortunately (to my knowledge). The signal will degrade too quickly and the entire setup is unstable as it is. Took me weeks to get it stable enough for production. Check out, I used that library and a custom built “active adapter” described there to run my panels in parallel.

Also, the trick is to get it to work with a small number of panels first. Then once it’s running smoothly, start slowly adding sets of panels until you run into problems. My guess is that you will need to run 3 parallel signal lines to get 24 panels to work. Make sure you have plenty of power to the panels. I think I had a 500W supply.

Yes my Problem is maybe the Problem you said 24 are to much for 1 Pi with the Adafruit HAT. I get it work on 12 Display with the library from Adafruit
But when i take 24 only about 19 Panels works but the Signal is at Panel 20 also activ and the Adafruit links to the hzeller library so i want to check if this library maybe works with the Size of the Panels. Do you only work with 12 panels or do you try it also with more panels?

I had twelve but I only used 2 of the 3 available channels on the adapter. The Pi3 can push 3 channels. I think the theoretical limit is higher than 12. Though keep in mind being 32x64 panels, 12 really means 24. Since they are just two joined 32 panels. So you’re pushing 48 panels. Check the issues/wiki in that repo for more info on getting it to work. I think you could make 24 work but I’d bet you’d need that active adapter so you can split the signal power and ditch the adafruit hat. You’ll have to do some SMD soldering if you build the adapter yourself so just watch your connections. Also, not sure if your using pixel pusher but it does work nice although there is also a row length limit that you’d have to dig into if you needed to support something larger.

Sorry to wake up this old thread.
I’m trying to use latest raspberrypi balena.img locallly using the balena-cli to configure.

I need the to have “dtparam=audio=off” on the config.txt file, or to remove the snd_bcm2835
Using as a guide
I have try to modify the config.txt before first init of the image, but it is still being overriden by the balena initialization, I’m not using balenacloud as this is a local development. The only way I have found to remove it is by executing rmmod snd_bcm2835 in my Dockerfile everytime my app is running but I found it not very reliable, the would like to remove it just from the host.
Also the previous link specifies a way using resin-sync.yml but I haven’t found proper documentation regardint such file, its format, where to place etc… However I still think that should be a way to disconnect it directly from the host…
Thank in advance

Hey @gpulido, that’s very strange, as I just tried it out, and worked:

  • flash the SD card
  • modify resin-boot/config.txt
  • boot up the device.

The supervisor handles the contents of the file after the first boot, but will take all the settings inside there as the initial settings, and no “overriding balena initialization” happens, the first load is the source of throught - except if the application config settings overwrite it, but you say it’s not balenaCloud, so don’t think that should be relevant.

What balenaOS version are you using? When you mean “local deployment”, is it a standalone device, not connected to a backend, or somethign else?

Hello @imrehg
First of all thank you for taking the time to check it.
When I started to reproduce it from scratch to document it I found where I made the mistake:
The config.txt file when is open before the first boot, has first the usual config.txt from the raspberrypi images, and after all the text, it has already setted some parameters, one of then is “dtparam=audio=on” so, when I searched for “dtparam=audio” I found the one commented, and as I’m used to do on raspis, just uncommented and setted “dtparam=audio=off”, without noticing that it was overrided again later at the bottom of the file.
I feel stupid, sorry for wasting your time and thanks for the awesome project and for make it OS. My project is OS (I will release soon), not founded, and done on my free time for my archery club, so to have high level tools available with a proper support is a lot easier.

1 Like

That’s great that you worked it out, thank you for letting us know!