Alsa: Difference between revisions
No edit summary |
(No difference)
|
Latest revision as of 08:39, 6 November 2013
how-to-determine-your-audio-cards-or-usb-mics-maximum-sampling-rate
arecord -f dat -r 60000 -D hw:0,0 -d 5 test.wav
---> 48,000Hz
check volume:
sox recordedfile.wav -n stat
near-realtime audio levels:
arecord -Dhw:0 -c2 -d 0 -fdat /dev/null -vvv
find out the alsa device id's:
root@raspberrypi:/home/map# cat /proc/asound/cards
0 [Device ]: USB-Audio - USB Sound Device
USB Sound Device at usb-bcm2708_usb-1.3, full speed
1 [ALSA ]: BRCM bcm2835 ALSbcm2835 ALSA - bcm2835 ALSA
bcm2835 ALSA
Therefore, the hardware device id for the BRCM device is: $hw:1
To specify a recording device, first find out which device id is set for the input device:
root@raspberrypi:/home/map# arecord -l
- List of CAPTURE Hardware Devices ****
card 0: Device [USB Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
root@raspberrypi:/home/map#
Therefore, the alsa hardware device id for the capture device on the USB Sound Device (there is only one) is: $hw:0,0
CLI setting of audio parameters
The command line can be used to set many values of the sound device. Most options are to set volume, capture device, balance, etc..
For example, lets say we want to Unmute and then Set the Master Volume.
First, find out what your sound card device is capable of:
amixer -L
Troubleshooting:
arecord: set_params:1145: Unable to install hw params:
Seems to be a fault with the usb stack or something silly, a reboot fixed this problem for me.