Atualmente, estou trabalhando em um pequeno aplicativo que é executado em um cubieboard (ARMv7, parecido com o grosa-pi).
O que eu realmente preciso fazer é acessar e gravar o sinal de áudio de entrada de linha de dois aplicativos diferentes.
O primeiro é o PyAudio e o segundo um Media Streamer do Darkice . A placa de som usa o driver de kernel sun4i-CODEC dos desenvolvedores do cubieboard. A camada de áudio é atualmente fornecida pelo ALSA Audio .
Atualmente, ambos os aplicativos registram a partir de hw: 0,0 e eles interagem. Então, se eu iniciar o Darkice Client, meu Script Python não terá acesso e vice-verca.
O Ouput do meu arecord -L
:
null
Discard all samples (playback) or generate zero samples (capture)
default
sysdefault:CARD=sun4icodec
sun4i-CODEC, sun4i PCM
Default Audio Device
dmix:CARD=sun4icodec,DEV=0
sun4i-CODEC, sun4i PCM
Direct sample mixing device
dsnoop:CARD=sun4icodec,DEV=0
sun4i-CODEC, sun4i PCM
Direct sample snooping device
hw:CARD=sun4icodec,DEV=0
sun4i-CODEC, sun4i PCM
Direct hardware device without any conversions
plughw:CARD=sun4icodec,DEV=0
sun4i-CODEC, sun4i PCM
Hardware device with all software conversions
Esta é minha amixer
Saída:
imple mixer control 'Master',0
Capabilities: pvolume pvolume-joined penum
Playback channels: Mono
Limits: Playback 0 - 63
Mono: Playback 63 [100%]
Simple mixer control 'LineL',0
Capabilities: pswitch pswitch-joined penum
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'LineR',0
Capabilities: pswitch pswitch-joined penum
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Mic Input Mux',0
Capabilities: volume volume-joined penum
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 15
Mono: 15 [100%]
Simple mixer control 'MicL',0
Capabilities: volume volume-joined penum
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 3
Mono: 1 [33%]
Simple mixer control 'MicR',0
Capabilities: volume volume-joined penum
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 3
Mono: 3 [100%]
Simple mixer control 'Playback',0
Capabilities: pswitch pswitch-joined penum
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Capture',0
Capabilities: cvolume cvolume-joined penum
Capture channels: Mono
Limits: Capture 0 - 7
Mono: Capture 7 [100%]
Simple mixer control 'ADC Input Mux',0
Capabilities: volume volume-joined penum
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 7
Mono: 7 [100%]
Simple mixer control 'Fm',0
Capabilities: volume volume-joined penum
Playback channels: Mono
Capture channels: Mono
Limits: 0 - 7
Mono: 7 [100%]
Simple mixer control 'FmL',0
Capabilities: pswitch pswitch-joined penum
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'FmR',0
Capabilities: pswitch pswitch-joined penum
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Ldac Left Mixer',0
Capabilities: pswitch pswitch-joined penum
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Ldac Right Mixer',0
Capabilities: pswitch pswitch-joined penum
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Rdac Right Mixer',0
Capabilities: pswitch pswitch-joined penum
Playback channels: Mono
Mono: Playback [off]
Então, qual é a melhor solução para resolver este problema? Dividindo a entrada estéreo em dois decices diferentes? Use outra camada de áudio? Eu não sei!
Obrigado antecipadamente,
~ MxAgent
Tags python alsa linux audio sound-card