ALSA 란?
rpi3 사운드카드 커널모듈 확인하기
$ cat /proc/asound/modules
0 snd_bcm2835
$ snd_bcm2835 모듈정보 확인하기
modinfo snd_bcm2835
filename: /lib/modules/4.14.37-v7+/kernel/drivers/staging/vc04_services/bcm2835-audio/snd-bcm2835.ko
license: GPL
description: Alsa driver for BCM2835 chip
author: Dom Cobley
srcversion: E5D598E47E3BA0AA5049F39
alias: of:N*T*Cbrcm,bcm2835-audioC*
alias: of:N*T*Cbrcm,bcm2835-audio
depends: snd-pcm,snd
staging: Y
intree: Y
name: snd_bcm2835
vermagic: 4.14.37-v7+ SMP mod_unload modversions ARMv7 p2v8
parm: force_bulk:Force use of vchiq bulk for audio (bool)
parm: enable_hdmi:Enables HDMI virtual audio device (bool)
parm: enable_headphones:Enables Headphones virtual audio device (bool)
parm: enable_compat_alsa:Enables ALSA compatibility virtual audio device (bool)
rpi3
Advanced Linux Sound Architecture
$ cat /proc/asound/cards
0 [ALSA ]: bcm2835_alsa - bcm2835 ALSA
bcm2835 ALSA
가상 파일시스템의 사운드 장치 확인하기
ls -l /proc/asound/card*
-r--r--r-- 1 root root 0 7월 5 10:51 id dr-xr-xr-x 9 root root 0 7월 5 10:51 pcm0p dr-xr-xr-x 3 root root 0 7월 5 10:51 pcm1p |
pcm 폴더는 playback device 를 나타낸다.
$ cat /proc/asound/card0/pcm0p/info
card: 0
device: 0
subdevice: 0
stream: PLAYBACK
id: bcm2835 ALSA
name: bcm2835 ALSA
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 7
subdevices_avail: 7
$ cat /proc/asound/card0/pcm1p/info
card: 0
device: 1
subdevice: 0
stream: PLAYBACK
id: bcm2835 ALSA
name: bcm2835 IEC958/HDMI
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 1
subdevices_avail: 1
0은 스피커 짹 1은 HDMI 출력을 나타낸다.
HDMI 출력 테스트
$ speaker-test -Dhw:0,1 -c2 -twav
$ speaker-test -Dhw:ALSA,0 -c2 -twav
speaker-test -Dhw:ALSA,0 -c2 -twav
speaker-test 1.1.3
Playback device is hw:ALSA,0 Stream parameters are 48000Hz, S16_LE, 2 channels WAV file(s) Rate set to 48000Hz (requested 48000Hz) Buffer size range from 256 to 32768 Period size range from 256 to 32768 Using max buffer size 32768 Periods = 4 was set period_size = 8192 was set buffer_size = 32768 0 - Front Left 1 - Front Right |
ALSA Operation
furmuwon : http://pds21.egloos.com/pds/201612/23/62/alsa(embedded_linux).pdf