Sound-alsa: Difference between revisions
No edit summary |
(No difference)
|
Latest revision as of 00:27, 29 July 2014
ALSA (Advanced Linux Sound Architecture)
My main focus when I write these pages is on getting sound to work properly with a Raspberry Pi. The techniques in these notes may work on other systems but I have created this page to keep track of RPi related sound information.
default RPi (Raspbian) sound settings
disabling the on-board sound card =
/etc/modules
/etc/modprobe.d/modules
(to be edited..)
measuring sound volume input level
- display the current input level of sound presented to the recording device
arecord -Dhw:0 -c2 -d 0 -fS16_LE /dev/null -vvv
It just starts a recording but sends the recording to /dev/null rather than saving it, and then around every 10ms it spits back a new line which looks like this:
Max peak (2000 samples): 0x000028ca ####### 31%
Max peak (2000 samples): 0x00002872 ####### 31%
Max peak (2000 samples): 0x000023de ###### 28%
Max peak (2000 samples): 0x00002bf3 ####### 34%
Max peak (2000 samples): 0x00002cb1 ####### 34%
- display the sound system's gain setting of the input channel
123
Nothing here yet
alsa config
/etc/asound.conf or ~/.asoundrc
pcm.!default { type asym playback.pcm { type plug slave.pcm "hw:0,0" } capture.pcm { type plug slave.pcm "hw:1,0" } }
This little ALSA configuration setting uses the default sound card as playback device (hw:0,0) and sets hw:1,0 (that suppose to be your USB-mic) to become the default capture device.