2013-02-06 2 views
2

파이썬 오디오 alsa 라이브러리를 사용하여 M-Audio Delta 1010LT PCI 오디오 인터페이스와 상호 작용합니다. 이 오디오 인터페이스에는 8 개의 아날로그 입력이 있습니다. 특정 모노 입력 신호를 분석하고 싶습니다. 카드가 인식되고있다 : 그 후ALSA & Python - 다중 모노 오디오 입력 캡쳐

cat /proc/asound/cards 0 [M1010LT  ]: ICE1712 - M Audio Delta 1010LT 
        M Audio Delta 1010LT at 0xa000, irq 18 

I 그 후

... 
Simple mixer control 'ADC',0 
Capabilities: volume volume-joined penum 
Playback channels: Mono 
Capture channels: Mono 
Limits: 0 - 164 
Mono: 142 [87%] [7.50dB] 
Simple mixer control 'ADC',1 
Capabilities: volume volume-joined penum 
Playback channels: Mono 
Capture channels: Mono 
Limits: 0 - 164 
Mono: 164 [100%] [18.50dB] 
Simple mixer control 'ADC',2 
Capabilities: volume volume-joined penum 
Playback channels: Mono 
Capture channels: Mono 
Limits: 0 - 164 
Mono: 164 [100%] [18.50dB] 
Simple mixer control 'ADC',3 
Capabilities: volume volume-joined penum 
Playback channels: Mono 
Capture channels: Mono 
Limits: 0 - 164 
Mono: 164 [100%] [18.50dB] 
Simple mixer control 'ADC',4 
Capabilities: volume volume-joined penum 
Playback channels: Mono 
Capture channels: Mono 
Limits: 0 - 164 
Mono: 164 [100%] [18.50dB] 
Simple mixer control 'ADC',5 
Capabilities: volume volume-joined penum 
Playback channels: Mono 
Capture channels: Mono 
Limits: 0 - 164 
Mono: 164 [100%] [18.50dB] 
Simple mixer control 'ADC',6 
Capabilities: volume volume-joined penum 
Playback channels: Mono 
Capture channels: Mono 
Limits: 0 - 164 
Mono: 164 [100%] [18.50dB] 
Simple mixer control 'ADC',7 
Capabilities: volume volume-joined penum 
Playback channels: Mono 
Capture channels: Mono 
Limits: 0 - 164 
Mono: 164 [100%] [18.50dB] 
... 

"amixer"모든 장치 이름을 명령 (여기 입력의 ADC를 도시)를 열거 나 명령을 사용하여 기록 harware 장치 나열 "arecord -l"

arecord -l**** List of CAPTURE Hardware Devices **** 
card 0: M1010LT [M Audio Delta 1010LT], device 0: ICE1712 multi [ICE1712 multi] 
Subdevices: 1/1 
Subdevice #0: subdevice #0 

맞습니까? 이 디스플레이 장치는 1 개의 녹화 하위 장치 만 표시합니까? 8을 보여줄 수 없습니까?

나는 또한 Mudita24 - envy24 비주얼 믹서를 설치했다. 이것으로 모든 입력 채널의 레벨을 완벽하게 조정하고 모니터 할 수 있습니다.

gst-launch-0.10 alsasrc card-name=0 device-name='ADC 0' ! queue ! alsasink card-name=0 device-name='DAC 0' 

하지만 다음 카드 및 장치 디스크립터를 사용하여 파이썬의 ALSA의 특정 모노 채널을 ​​해결하기 위해 문제에 봉착 :

는 그 후 나는 아주 잘 또한 일있는 GStreamer를 사용하여 약간의 테스트를했다

'default' // This one get's me channel 1 & 2 MIXED (I'd like to get them as seperated mono inputs) 
'hw:0,0' // recognizes device but the input value is 0 
'hw:0,0,0' // returns same as hw:0,0 
'hw:0,0,1' // Device or resource busy (pretty much every other value than 0 returns this) 
'hw:0,1' // No such file or directory 

어떻게 ALSA를 사용하여 특정 모노 입력 채널을 지정합니까? link

이 내가 각 채널에 대한 장치를 만들려고 해요 어떻게이 :

pcm.one_channel { 
@args [ CHANNEL ] 
@args.CHANNEL { type integer } 
type dsnoop 
ipc_key 20130206 
slave { 
    pcm "hw:0" 
    channels 12 
    rate 44000 
} 
bindings [ $CHANNEL ] 
} 

pcm.two_channel { 
    @args [ CHANNEL ] 
    @args.CHANNEL { type integer } 
    type dsnoop 
    ipc_key 20130206 
    slave { 
     pcm "hw:0" 
     channels 12 
     rate 44000 
    } 
    bindings [ $CHANNEL ] 
} 

pcm.three_channel { 
    @args [ CHANNEL ] 
    @args.CHANNEL { type integer } 
    type dsnoop 
    ipc_key 20130206 
    slave { 
     pcm "hw:0" 
     channels 12 
     rate 44000 
    } 
    bindings [ $CHANNEL ] 
} 

pcm.four_channel { 
    @args [ CHANNEL ] 
    @args.CHANNEL { type integer } 
    type dsnoop 
    ipc_key 20130206 
    slave { 
     pcm "hw:0" 
     channels 12 
     rate 44000 
    } 
    bindings [ $CHANNEL ] 
} 

pcm.five_channel { 
    @args [ CHANNEL ] 
    @args.CHANNEL { type integer } 
    type dsnoop 
    ipc_key 20130206 
    slave { 
     pcm "hw:0" 
     channels 12 
     rate 44000 
    } 
    bindings [ $CHANNEL ] 
} 

내가 제대로 조언을 해석 했 이것은 내가 사용 파이썬 라이브러리입니다? 나는 또한 이것에 대해 웹 주위를 둘러 보았고이 카드에 대한 두 개의 다른 .asoundrc를 발견했다. (불행하게도 역시 작동하지 않는다.)

# 
# M-Audio Delta 1010 
# 

pcm.ice1712_capture { 
    type dsnoop 
    ipc_key 1024 
    slave { 
     pcm "hw:0" 
     period_size 0 
     buffer_size 65536 
     rate 44100 
     channels 10 
     format "S16_LE" 
    } 
} 

pcm.ice1712_playback { 
    type dsnoop 
    ipc_key 1024 
    slave { 
     pcm "hw:0" 
     period_size 0 
     buffer_size 65536 
     rate 44100 
     channels 10 
     format "S16_LE" 
    } 
} 

pcm.ice1712_duplex { 
    type asym 
    playback.pcm ice1712_playback 
    capture.pcm ice1712_capture 
} 

pcm.ch1 { 
    type plug 
    ttable.0.0 1 
    slave.pcm ice1712_duplex 
} 

pcm.ch2 { 
    type plug 
    ttable.1.1 1 
    slave.pcm ice1712_duplex 
} 

pcm.ch3 { 
    type plug 
    ttable.0.2 1 
    slave.pcm ice1712_duplex 
} 

pcm.ch4 { 
    type plug 
    ttable.1.3 1 
    slave.pcm ice1712_duplex 
} 

pcm.ice1712_ch5 { 
    type plug 
    ttable.0.4 1 
    slave.pcm ice1712_duplex 
} 

pcm.ice1712_ch6 { 
    type plug 
    ttable.1.5 1 
    slave.pcm ice1712_duplex 
} 

pcm.ice1712_ch7 { 
    type plug 
    ttable.0.6 1 
    slave.pcm ice1712_duplex 
} 

pcm.ice1712_ch8 { 
    type plug 
    ttable.1.7 1 
    slave.pcm ice1712_duplex 
} 

pcm.ice1712_ch9 { 
    type plug 
    ttable.0.8 1 
    slave.pcm ice1712_duplex 
} 

pcm.ice1712_ch10 { 
    type plug 
    ttable.1.9 1 
    slave.pcm ice1712_duplex 
} 

여기에 또 다른 하나 : 장치 이름하지만 믹서 컨트롤을 표시하지 않습니다

pcm.multi_capture { 
    type multi 
    slaves.a.pcm hw:0 
    slaves.a.channels 12 

# First 8 channels of first soundcard (capture) 
    bindings.0.slave a 
    bindings.0.channel 0 
    bindings.1.slave a 
    bindings.1.channel 1 
    bindings.2.slave a 
    bindings.2.channel 2 
    bindings.3.slave a 
    bindings.3.channel 3 
    bindings.4.slave a 
    bindings.4.channel 4 
    bindings.5.slave a 
    bindings.5.channel 5 
    bindings.6.slave a 
    bindings.6.channel 6 
    bindings.7.slave a 
    bindings.7.channel 7 

# S/PDIF section. Uncomment bindings if required. 

# S/PDIF first soundcard (capture) 
    #bindings.16.slave a 
    #bindings.16.channel 8 
    #bindings.17.slave a 
    #bindings.17.channel 9 
} 

ctl.multi_capture { 
    type hw 
    card 0 
} 

pcm.multi_playback { 
    type multi 
    slaves.a.pcm hw:0 
    slaves.a.channels 10 

# First 8 channels of first soundcard (playback) 
    bindings.0.slave a 
    bindings.0.channel 0 
    bindings.1.slave a 
    bindings.1.channel 1 
    bindings.2.slave a 
    bindings.2.channel 2 
    bindings.3.slave a 
    bindings.3.channel 3 
    bindings.4.slave a 
    bindings.4.channel 4 
    bindings.5.slave a 
    bindings.5.channel 5 
    bindings.6.slave a 
    bindings.6.channel 6 
    bindings.7.slave a 
    bindings.7.channel 7 

# S/PDIF section. Uncomment bindings if required. 

# S/PDIF first soundcard (playback) 
    #bindings.16.slave a 
    #bindings.16.channel 8 
    #bindings.17.slave a 
    #bindings.17.channel 9 
} 

ctl.multi_playback { 
    type hw 
    card 0 
} 

답변

1

amixer 도구입니다.

실제로 ICE1712 칩에는 정확히 12 개의 채널이있는 캡처 장치가 하나만 있습니다. 등 one_channel:1, one_channel:0처럼

pcm.one_channel { 
    @args [ CHANNEL ] 
    @args.CHANNEL { type integer } 
    type dsnoop 
    ipc_key 20130206 
    slave { 
     pcm "hw:0" 
     channels 12 
     rate 48000 
    } 
    bindings [ $CHANNEL ] 
} 

후 사용 장치 이름

+0

을 :


개별 채널의 가상 장치를 얻으려면, 당신의 ~/.asoundrc 또는 /etc/asound.conf에 다음과 같이 무언가를 추가하려고 감사! 그렇다면이 문제를 어떻게 해결할 수 있습니까? 이것은 카드 = 0, 장치 = 0 및 0-11이 내 채널이라는 것을 의미합니까? 예 : "hw : 0,0,1"? 0 (아무것도 반환하지 않는) 이외의 모든 입력에 대해 "장치 또는 리소스 사용 중"이 나타납니다. –

+0

그냥'hw : 0'을 사용하십시오; 다른 번호는 장치 및 하위 장치를 선택하는 데 사용되지만 어쨌든 하나만 사용합니다. –

+0

하나의 장치에서 항상 12 개의 채널을 모두 얻을 수 있습니다.(자동 포맷 변환을하는'default'와 같은 장치를 사용한다면, 일부 채널은 다운 믹싱됩니다.) –

관련 문제