Discussion:
[Alsa-user] Setting up a Dummy Sound device on a Raspberry Pi running Raspian
Swinney C.
2014-01-12 12:06:55 UTC
Permalink
Hi All,



I have referred to the document on the WiKi at http://www.alsa-project.org/main/index.php/Matrix%3aModule-dummy, but I require some additional help, as I am a bit of a noob at all of this.



I am looking to get a Dummy Audio device working on the Raspberry Pi running Raspian (which is based on Debian). The Raspberry Pi only has an analogue audio output as standard; however, I require a specific application that requires both audio input and output (PJSIP), even though for my instance we will not be using the input.



From the WiKi page above, I can run the following command which sets up a Dummy sound device and is enough to get PJSIP working:



sudo modprobe snd-dummy



I’m not sure what the other commands do (modprobe snd-pcm-oss ; modprobe snd-mixer-oss ; modprobe snd-seq-oss) but as far as I can see, I do not need them. Once the above command is run, I can see a new card list in the ‘/proc/​asound/​cards’ file such that it shows:



0 [ALSA ]: BRCM bcm2835 ALSbcm2835 ALSA - bcm2835 ALSA

bcm2835 ALSA

1 [Dummy ]: Dummy - Dummy

Dummy 1



However, I come unstuck when I reboot and the sound card disappears. In the WiKi, you refer to editing the /etc/​modules.conf file, however both this and the other file referenced (/etc/​conf.modules) do not exist in this distribution. There is a Note section that refers to Debian, but again the folder reference (/etc/​modutils/) does not exist. In fact, the application modutils does not exist and trying to install it using:



sudo apt-get install modutils



Results in the following error:



Package modutils is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source



I can see that in this distribution the kernel module soundcore has indeed been renamed to snd, and I can create a symbolic link to the file using:



sudo ln -s /lib/modules/3.10.25+/kernel/sound/core/snd.ko /lib/modules/3.10.25+/kernel/sound/soundcore.ko



But there is no such application called update-modules





I have created a file called /etc/​modules.conf and put in the following text, but of course this doe nothing and on reboot the card still disappears.



# OSS/Free portion - card #1
alias sound-slot-0 snd-card-0
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss



So, what can I do? Any help would be very much appreciated.







One other point, there is a link in the WiKi that is supposed to point some instructions about copy to the text into the module.conf file (just over half way down), however, the link is broken. I assume it’s just linking to some instruction about using something like nano, but it might still be worth fixing for future reference.





Regards,





Chris
Clemens Ladisch
2014-01-12 17:24:00 UTC
Permalink
Post by Swinney C.
I have referred to the document on the WiKi at http://www.alsa-project.org/main/index.php/Matrix%3aModule-dummy
Most of that page comes from a generic template and does not apply to the dummy
driver, or is outdated.
Post by Swinney C.
I come unstuck when I reboot and the sound card disappears. In the WiKi, you refer to
editing the /etc/​modules.conf file, however both this and the other file referenced
(/etc/​conf.modules) do not exist in this distribution.
You have to find out how to load modules at startup in that distribution.

Try adding "modprobe snd-dummy" to /etc/rc.d/rc.local, or check if there is any
other sript file that gets executed at startup.


Regards,
Clemens
Swinney C.
2014-01-12 19:44:06 UTC
Permalink
Post by Clemens Ladisch
Post by Swinney C.
I have referred to the document on the WiKi at
http://www.alsa-project.org/main/index.php/Matrix%3aModule-dummy
Most of that page comes from a generic template and does not apply to the
dummy driver, or is outdated.
Ah, that makes things awkward for us noobs. Linux in not my strong suit and coming to terms with all of the idiosyncrasies or all the different flavours and dealing with outdated documentation make things a little difficult. Of course, I understand that updating such documentation is time consuming.
Post by Clemens Ladisch
Post by Swinney C.
I come unstuck when I reboot and the sound card disappears. In the
WiKi, you refer to editing the /etc/​modules.conf file, however both
this and the other file referenced
(/etc/​conf.modules) do not exist in this distribution.
You have to find out how to load modules at startup in that distribution.
Try adding "modprobe snd-dummy" to /etc/rc.d/rc.local, or check if there is
any other sript file that gets executed at startup.
Regards,
Clemens
Ah ha - such is the lack of my Linux knowledge, but this little pointer gives me a little bit more understanding. What I had seen is a '/etc/modules' file, which seems to do what you are pointing me toward. The only entry in there is for 'snd-bcm2835' which (I believe) loads the driver for the on-board sound device. Adding 'snd-dummy' on the next line does what I'm after! The Dummy sound driver then loads as the second device on boot.

There are a few other file relating to ALSA in the '/etc/modprobe.d/' directory, namely 'alsa-base.conf' and 'alsa-base-blacklist.conf' that contain other ALSA related info and seem to install lots of different things using 'modprobe'. Not sure if I should add 'options snd-dummy=-2' to the bottom of the 'alsa-base.conf' file (shown below), but it does seem like the on-board driver loads first then the Dummy device load next just using what I have set above.

# autoloader aliases
install sound-slot-0 /sbin/modprobe snd-card-0
install sound-slot-1 /sbin/modprobe snd-card-1
install sound-slot-2 /sbin/modprobe snd-card-2
install sound-slot-3 /sbin/modprobe snd-card-3
install sound-slot-4 /sbin/modprobe snd-card-4
install sound-slot-5 /sbin/modprobe snd-card-5
install sound-slot-6 /sbin/modprobe snd-card-6
install sound-slot-7 /sbin/modprobe snd-card-7
# Cause optional modules to be loaded above generic modules
install snd /sbin/modprobe --ignore-install snd && { /sbin/modprobe --quiet snd-ioctl32 ; /sbin/modprobe --quiet snd-seq ; : ; }
install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi && { /sbin/modprobe --quiet snd-seq-midi ; : ; }
install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 && { /sbin/modprobe --quiet snd-emu10k1-synth ; : ; }
# Keep snd-pcsp from beeing loaded as first soundcard
options snd-pcsp index=-2
# Keep snd-usb-audio from beeing loaded as first soundcard
options snd-usb-audio index=-2
# Prevent abnormal drivers from grabbing index 0
options bt87x index=-2
options cx88_alsa index=-2
options snd-atiixp-modem index=-2
options snd-intel8x0m index=-2
options snd-via82xx-modem index=-2

Many thanks Clemens for your po

Loading...