giaur500
Posts: 36
Joined: Sat Sep 08, 2012 11:07 pm

How to disable integrated sound card?

Thu Sep 27, 2012 8:29 am

Hello,

I want to entirely disable pi integrated sound card. I want to use external usb card (confirmed it works), because it has mic input. How can I disable internal sound card? I've tried to add its module to blacklist, but after restart nothing changes, still device is created.

kyelo
Posts: 64
Joined: Sun Oct 23, 2011 6:31 pm

Re: How to disable integrated sound card?

Fri Sep 28, 2012 4:15 pm

I assume you are using Raspbian.

Without the USB card plugged in, boot your system, and at the command line type "aplay -l", and you should see "Card 0 :ALSA [bcm2835 ALSA] device 0 etc"..

Now plug in the USB sound card, and re-type "aplay -l". You will probably see in addition your USB soundcard listed as "Card 1".

I think what you need to do is to alter the boot priorities for the sound modules, not "disable the integrated sound card".

To do this, at the command line, enter "sudo leafpad /etc/modprobe.d/alsa-base.conf". Look at the last line which reads "options snd-usb-audio index=-2". You need to "comment this out" by inserting a "#" at the beginning of the line, which makes it a non-executing or information-only line.

Now you need to save the file and reboot.

After rebooting,(with USB card plugged in) "aplay -l" should show your USB as Card 0 (and sound should go to your USB system), and bcm2835 as Card 1. If USB sound card is not plugged in at boot, bcm2835 should show up as card 0 (and sound should go to the 3,5 mm jack)

You may also have to adjust or create an /etc/asound.conf. an example of a file that works for me is at http://www.raspberrypi.org/phpBB3/viewt ... &start=100,

At the command line, do "sudo leafpad /etc/asound.conf" and copy the above example and save it.

Hope this helps.

giaur500
Posts: 36
Joined: Sat Sep 08, 2012 11:07 pm

Re: How to disable integrated sound card?

Fri Sep 28, 2012 4:23 pm

It may work. But, I didn't mean changing card priority. I meant how to prevent integrated card module to load? On desktop system (PC, debian), it's enough to add kernel module to modprobe's blacklist.conf. And after reboot - module won't load and card will not be supported.

But - when I do the same on pi and raspbian, it don't change anything. Even if module name is added to blacklist, still card module will load, so adding to blacklist has no any effect. I suspect there are some scripts and they loads card driver kernel module and this is the reason?

There are also some issues with pi sound card and its drivers (alsaequal don't work, some applications are unable to open audio device etc). So I want to definitely disable it and use only external usb card.

kyelo
Posts: 64
Joined: Sun Oct 23, 2011 6:31 pm

Re: How to disable integrated sound card?

Fri Sep 28, 2012 4:29 pm

Here is the /etc/asound.conf that I tried to link to above:

Code: Select all

pcm.mmap0 {
    type mmap_emul;
    slave {
      pcm "hw:0,0";
    }
}

pcm.!default {
  type plug;
  slave {
    pcm mmap0;
  }
This config file works for me whether I am using external USB audio or the built-in bcm2835 analog audio.

bugmenot3
Posts: 39
Joined: Wed Aug 15, 2012 12:27 pm
Contact: Website

Re: How to disable integrated sound card?

Sat Jun 01, 2013 2:13 pm

Sorry for the necroposting but I easily managed to disable all the snd related modules on the RPi just commenting out the related line in the file /etc/modules

Default:

Code: Select all

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

snd-bcm2835
Commented out:

Code: Select all

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

#snd-bcm2835
I'm using the RPi as an headless server for nginx and torrenting; right now (I've removed the unnecessary packets) this is the output of the sudo lsmod command:

Code: Select all

Module                  Size  Used by
leds_gpio               2235  0
led_class               3562  1 leds_gpio
Hope it will be useful for someone. :mrgreen:

kursus
Posts: 25
Joined: Thu Oct 31, 2013 2:36 pm

Re: How to disable integrated sound card?

Fri Dec 20, 2013 3:05 am

Thank you it was at least helpful for me ! :)

I'm using an audio USB DAC on the Pi and really don't need the integrated soundcard.

zarcondeegrissom
Posts: 3
Joined: Tue Aug 11, 2015 12:26 am

Re: How to disable integrated sound card?

Tue Aug 11, 2015 12:43 am

Just an F.Y.I. lol. that hint about commenting out the "snd-bcm2835" line, is not so good if your using the GUI. :shock:

It is kind of funny to watch the task-bar blink in and out without anything on it. :lol:
In-fact, it kind of made the GUI absolutely useless. and the noobs thing doesn't exactly give you access to fix that "#snd-bcm2835" line in the 'modules' file.

If your trying to get sound out of a USB device, and the GUI is refusing to set it as default after getting the thing to be device '0' in the ALSA thing, this is not for you. I don't know what the answer is yet, tho this is not it.

time to wipe the SD card, and try this, yet again. Or perhaps let noobs reinstall the whole thing after holding the 'Shift' key on boot.

diederik
Posts: 389
Joined: Wed Mar 26, 2014 11:17 pm

Re: How to disable integrated sound card?

Tue Aug 11, 2015 8:52 am

zarcondeegrissom wrote:Just an F.Y.I. lol. that hint about commenting out the "snd-bcm2835" line, is not so good if your using the GUI. :shock:
Learning how to edit files in a terminal window is an important skill which you should consider learning ;)

zarcondeegrissom
Posts: 3
Joined: Tue Aug 11, 2015 12:26 am

Re: How to disable integrated sound card?

Tue Aug 11, 2015 1:21 pm

ah, yea. That's exactly what I was doing. Editing the config files in that thing that I guess is supposed to resemble 'vi' in some other universe. When I went to reboot the microscopic-computer after editing that line, the GUI went nuts before it finished loading. In fact it never finished loading.

I'm sure it was not the other changes, as I did reboot the thing multiple times before, and even tho the USB thing was at '0', and the bcm2835 was at '1', the GUI was still refusing to keep the USB sound-card as the default output. :?:

Point taken. Even tho I only have about four days worth of experience with any form of "Linux" at this point (the amount of time I've had the Raspberry), I know nothing. :|

As for the USB thing. A single check-box in ubuntu-mate, and it worked perfectly. So I'm at least sure it's not a bad USB device. :roll:

zarcondeegrissom
Posts: 3
Joined: Tue Aug 11, 2015 12:26 am

Re: How to disable integrated sound card?

Wed Aug 12, 2015 12:19 am

After some much needed rest, I think I have an idea what happened. Based on the simple fact that the Raspberry dose not have a BIOS, and the DMA/IRQ/whatever arrangement of devices on the thing is set up by text files on the SD card during boot. That and there is a bunch of lines in other config files that state things about preventing things from arbitrarily grabbing ID numbers.

By ought right removing that line that somehow assigned DMA/IRQ/whatever numbers to the device, the device grabbed whatever happens to be in it's grasp (or whatever residual voltage happened to be in the Flip-flops for that, lol). So assuming the bcm2835 just happened to grab the same DMA assigned to the GPU (for whatever reason), That would explain the instant crash as soon as Raspbian attempted to initialize the GUI.

That also raises potential stability concerns for everyone that is not using the GUI, with “snd-bcm2835 “ commented out in the “/etc/modules” file. I'm not completely sure how keeping the bcm2835 driver from loading would cause this, tho if the driver is assigning something akin to DMA addresses to the device, that would explain allot. And also raises other questions about just how the DMA/IRQ/whatever are set up in the Raspberry, and how intelligent is the driver interface in Linux.

There has got to be a simple way, to tell the bcm2835 to take some specific DMA/IRQ/whatever numbers out of the way, and not load the driver for it. And to tell the GUI stuff, that there is no bcm2835 device for it to waste it's time trying to talk to, lol.

himanshum
Posts: 5
Joined: Thu Feb 16, 2017 1:44 pm

Re: How to disable integrated sound card?

Wed Apr 19, 2017 10:12 am

Hello - any idea how to disable integrated sound card if the OS is windows IOT core?
thanks,

User avatar
PeterO
Posts: 3561
Joined: Sun Jul 22, 2012 4:14 pm

Re: How to disable integrated sound card?

Wed Apr 19, 2017 10:29 am

himanshum wrote:Hello - any idea how to disable integrated sound card if the OS is windows IOT core?
thanks,
Please don't hijack old threads. Start a new thread in the right sub forum with your question.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),Aeromodelling,1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

Return to “Raspbian”

Who is online

Users browsing this forum: No registered users and 12 guests