VAR-SOM-MX6 Audio record play: Difference between revisions
From Variscite Wiki
Line 8: | Line 8: | ||
imx-hdmi-soc | imx-hdmi-soc | ||
</pre> | </pre> | ||
List device names: | |||
<pre> | <pre> | ||
root@var-som-mx6:~# aplay -L | root@var-som-mx6:~# aplay -L | ||
Line 36: | Line 37: | ||
</pre> | </pre> | ||
= Audio Playback = | |||
<pre>$ amixer set PCM 125 | <pre>$ amixer set PCM 125 | ||
$ aplay /usr/share/sounds/alsa/Front_Center.wav | $ aplay /usr/share/sounds/alsa/Front_Center.wav | ||
</pre> | |||
Example: | |||
<pre> | |||
root@var-som-mx6:~# amixer set PCM 125 | |||
Simple mixer control 'PCM',0 | |||
Capabilities: pvolume | |||
Playback channels: Front Left - Front Right | |||
Limits: Playback 0 - 127 | |||
Mono: | |||
Front Left: Playback 125 [98%] [-1.00dB] | |||
Front Right: Playback 125 [98%] [-1.00dB] | |||
root@var-som-mx6:~# aplay /usr/share/sounds/alsa/Front_Center.wav | |||
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono | |||
</pre> | |||
= Audio Record = | |||
<pre> | |||
$ arecord -f cd -d 10 -D hw:0,0 test.wav | $ arecord -f cd -d 10 -D hw:0,0 test.wav | ||
$ aplay test.wav | $ aplay test.wav | ||
</pre> | |||
Example: | |||
<pre> | |||
root@var-som-mx6:~# arecord -f cd -d 10 -D hw:0,0 test.wav | |||
Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo | |||
root@var-som-mx6:~# ^C | |||
root@var-som-mx6:~# aplay test.wav | |||
Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo | |||
</pre> | </pre> |
Revision as of 13:19, 16 December 2015
VAR-SOM-MX6 - Audio Record/Play
Get information on the Sound Cards
root@var-som-mx6:~# cat /proc/asound/cards 0 [tlv320aic3xaudi]: tlv320aic3x-aud - tlv320aic3x-audio tlv320aic3x-audio 1 [imxhdmisoc ]: imx-hdmi-soc - imx-hdmi-soc imx-hdmi-soc
List device names:
root@var-som-mx6:~# aplay -L null Discard all samples (playback) or generate zero samples (capture) sysdefault:CARD=tlv320aic3xaudi tlv320aic3x-audio, Default Audio Device sysdefault:CARD=imxhdmisoc imx-hdmi-soc, Default Audio Device surround40:CARD=imxhdmisoc,DEV=0 imx-hdmi-soc, 4.0 Surround output to Front and Rear speakers surround41:CARD=imxhdmisoc,DEV=0 imx-hdmi-soc, 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=imxhdmisoc,DEV=0 imx-hdmi-soc, 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=imxhdmisoc,DEV=0 imx-hdmi-soc, 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=imxhdmisoc,DEV=0 imx-hdmi-soc, 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
Audio Playback
$ amixer set PCM 125 $ aplay /usr/share/sounds/alsa/Front_Center.wav
Example:
root@var-som-mx6:~# amixer set PCM 125 Simple mixer control 'PCM',0 Capabilities: pvolume Playback channels: Front Left - Front Right Limits: Playback 0 - 127 Mono: Front Left: Playback 125 [98%] [-1.00dB] Front Right: Playback 125 [98%] [-1.00dB] root@var-som-mx6:~# aplay /usr/share/sounds/alsa/Front_Center.wav Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
Audio Record
$ arecord -f cd -d 10 -D hw:0,0 test.wav $ aplay test.wav
Example:
root@var-som-mx6:~# arecord -f cd -d 10 -D hw:0,0 test.wav Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo root@var-som-mx6:~# ^C root@var-som-mx6:~# aplay test.wav Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo