В Windows 7 я раньше использовал pymedia, библиотеку Python, чтобы перечислить доступные интерфейсы, а также использовать их для проигрывания и записи аудио. Типичный запрос был бы похож на это:
Теперь, я больше не использую Windows 7, поскольку я мигрировал на Ubuntu 16.04. Так, я использовал команды ALSA для наблюдения доступных аудиоинтерфейсов. Следующее является выводом того же:
skrowten_hermit@PC-760:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: AD1984A Analog [AD1984A Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 2: AD1984A Alt Analog [AD1984A Alt Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Eight [M-Track Eight], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
skrowten_hermit@PC-760:~$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: Intel [HDA Intel], device 0: AD1984A Analog [AD1984A Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 2: AD1984A Alt Analog [AD1984A Alt Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Eight [M-Track Eight], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
Как мы видим, моя внешняя звуковая карта, M-Audio перечислена как карта ALSA здесь, что означает, что она обнаруживается правильно. Теперь, когда я прочитал похожие статьи ALSA, я узнал об устройствах и затем использовал-L для просмотра доступных устройств следующим образом:
skrowten_hermit@PC-760:~$ aplay -L
default
Playback/recording through the PulseAudio sound server
null
Discard all samples (playback) or generate zero samples (capture)
pulse
PulseAudio Sound Server
sysdefault:CARD=Intel
HDA Intel, AD1984A Analog
Default Audio Device
front:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
Front speakers
surround21:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
dmix:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
Direct sample mixing device
dmix:CARD=Intel,DEV=2
HDA Intel, AD1984A Alt Analog
Direct sample mixing device
dsnoop:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
Direct sample snooping device
dsnoop:CARD=Intel,DEV=2
HDA Intel, AD1984A Alt Analog
Direct sample snooping device
hw:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
Direct hardware device without any conversions
hw:CARD=Intel,DEV=2
HDA Intel, AD1984A Alt Analog
Direct hardware device without any conversions
plughw:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
Hardware device with all software conversions
plughw:CARD=Intel,DEV=2
HDA Intel, AD1984A Alt Analog
Hardware device with all software conversions
sysdefault:CARD=Eight
M-Track Eight, USB Audio
Default Audio Device
front:CARD=Eight,DEV=0
M-Track Eight, USB Audio
Front speakers
surround21:CARD=Eight,DEV=0
M-Track Eight, USB Audio
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Eight,DEV=0
M-Track Eight, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=Eight,DEV=0
M-Track Eight, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Eight,DEV=0
M-Track Eight, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Eight,DEV=0
M-Track Eight, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Eight,DEV=0
M-Track Eight, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Eight,DEV=0
M-Track Eight, USB Audio
IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=Eight,DEV=0
M-Track Eight, USB Audio
Direct sample mixing device
dsnoop:CARD=Eight,DEV=0
M-Track Eight, USB Audio
Direct sample snooping device
hw:CARD=Eight,DEV=0
M-Track Eight, USB Audio
Direct hardware device without any conversions
plughw:CARD=Eight,DEV=0
M-Track Eight, USB Audio
Hardware device with all software conversions
skrowten_hermit@PC-760:~$ arecord -L
default
Playback/recording through the PulseAudio sound server
null
Discard all samples (playback) or generate zero samples (capture)
pulse
PulseAudio Sound Server
sysdefault:CARD=Intel
HDA Intel, AD1984A Analog
Default Audio Device
front:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
Front speakers
surround21:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
dmix:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
Direct sample mixing device
dmix:CARD=Intel,DEV=2
HDA Intel, AD1984A Alt Analog
Direct sample mixing device
dsnoop:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
Direct sample snooping device
dsnoop:CARD=Intel,DEV=2
HDA Intel, AD1984A Alt Analog
Direct sample snooping device
hw:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
Direct hardware device without any conversions
hw:CARD=Intel,DEV=2
HDA Intel, AD1984A Alt Analog
Direct hardware device without any conversions
plughw:CARD=Intel,DEV=0
HDA Intel, AD1984A Analog
Hardware device with all software conversions
plughw:CARD=Intel,DEV=2
HDA Intel, AD1984A Alt Analog
Hardware device with all software conversions
sysdefault:CARD=Eight
M-Track Eight, USB Audio
Default Audio Device
front:CARD=Eight,DEV=0
M-Track Eight, USB Audio
Front speakers
surround21:CARD=Eight,DEV=0
M-Track Eight, USB Audio
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Eight,DEV=0
M-Track Eight, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=Eight,DEV=0
M-Track Eight, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Eight,DEV=0
M-Track Eight, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Eight,DEV=0
M-Track Eight, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Eight,DEV=0
M-Track Eight, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Eight,DEV=0
M-Track Eight, USB Audio
IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=Eight,DEV=0
M-Track Eight, USB Audio
Direct sample mixing device
dsnoop:CARD=Eight,DEV=0
M-Track Eight, USB Audio
Direct sample snooping device
hw:CARD=Eight,DEV=0
M-Track Eight, USB Audio
Direct hardware device without any conversions
plughw:CARD=Eight,DEV=0
M-Track Eight, USB Audio
Hardware device with all software conversions
Вышеупомянутое несколько отличается от того, что я ожидал (я надеялся получить идентификаторы канала, но вместо этого закончил тем, что получил параметры как sysdefault, передняя сторона, surround21, dsnoop, hw и т.д.). Моя звуковая карта имеет Восемь пар ввода-вывода. Так, я ожидал каналы/идентификаторы портов или что-то как этот.
После немного большего количества рытья в сеть я наткнулся на pyAudio и sounddevice библиотеки Python. Первый дал следующий вывод:
skrowten_hermit@PC-760:~$ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyaudio
>>> p = pyaudio.PyAudio()
ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave
Cannot open PortAudio client
JackShmReadWritePtr1::~JackShmReadWritePtr1 - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
>>> for i in range(p.get_device_count()):
... print p.get_device_info_by_index(i).get('name')
...
HDA Intel: AD1984A Analog (hw:0,0)
HDA Intel: AD1984A Alt Analog (hw:0,2)
M-Track Eight: USB Audio (hw:1,0)
sysdefault
pulse
default
>>> import pyaudio
>>> p = pyaudio.PyAudio()
>>> for i in range(p.get_device_count()):
... print p.get_device_info_by_index(i)
...
{'defaultSampleRate': 44100.0, 'defaultLowOutputLatency': 0.008707482993197279, 'defaultLowInputLatency': 0.008707482993197279, 'maxInputChannels': 2L, 'structVersion': 2L, 'hostApi': 0L, 'index': 0, 'defaultHighOutputLatency': 0.034829931972789115, 'maxOutputChannels': 2L, 'name': u'HDA Intel: AD1984A Analog (hw:0,0)', 'defaultHighInputLatency': 0.034829931972789115}
{'defaultSampleRate': 44100.0, 'defaultLowOutputLatency': -1.0, 'defaultLowInputLatency': 0.008707482993197279, 'maxInputChannels': 2L, 'structVersion': 2L, 'hostApi': 0L, 'index': 1, 'defaultHighOutputLatency': -1.0, 'maxOutputChannels': 0L, 'name': u'HDA Intel: AD1984A Alt Analog (hw:0,2)', 'defaultHighInputLatency': 0.034829931972789115}
{'defaultSampleRate': 44100.0, 'defaultLowOutputLatency': 0.008707482993197279, 'defaultLowInputLatency': 0.008707482993197279, 'maxInputChannels': 8L, 'structVersion': 2L, 'hostApi': 0L, 'index': 2, 'defaultHighOutputLatency': 0.034829931972789115, 'maxOutputChannels': 8L, 'name': u'M-Track Eight: USB Audio (hw:1,0)', 'defaultHighInputLatency': 0.034829931972789115}
{'defaultSampleRate': 48000.0, 'defaultLowOutputLatency': 0.021333333333333333, 'defaultLowInputLatency': 0.021333333333333333, 'maxInputChannels': 128L, 'structVersion': 2L, 'hostApi': 0L, 'index': 3, 'defaultHighOutputLatency': 0.021333333333333333, 'maxOutputChannels': 128L, 'name': u'sysdefault', 'defaultHighInputLatency': 0.021333333333333333}
{'defaultSampleRate': 44100.0, 'defaultLowOutputLatency': 0.008707482993197279, 'defaultLowInputLatency': -1.0, 'maxInputChannels': 0L, 'structVersion': 2L, 'hostApi': 0L, 'index': 4, 'defaultHighOutputLatency': 0.034829931972789115, 'maxOutputChannels': 2L, 'name': u'front', 'defaultHighInputLatency': -1.0}
{'defaultSampleRate': 44100.0, 'defaultLowOutputLatency': 0.008707482993197279, 'defaultLowInputLatency': -1.0, 'maxInputChannels': 0L, 'structVersion': 2L, 'hostApi': 0L, 'index': 5, 'defaultHighOutputLatency': 0.034829931972789115, 'maxOutputChannels': 2L, 'name': u'surround40', 'defaultHighInputLatency': -1.0}
{'defaultSampleRate': 44100.0, 'defaultLowOutputLatency': 0.008707482993197279, 'defaultLowInputLatency': -1.0, 'maxInputChannels': 0L, 'structVersion': 2L, 'hostApi': 0L, 'index': 6, 'defaultHighOutputLatency': 0.034829931972789115, 'maxOutputChannels': 2L, 'name': u'surround51', 'defaultHighInputLatency': -1.0}
{'defaultSampleRate': 44100.0, 'defaultLowOutputLatency': 0.008707482993197279, 'defaultLowInputLatency': -1.0, 'maxInputChannels': 0L, 'structVersion': 2L, 'hostApi': 0L, 'index': 7, 'defaultHighOutputLatency': 0.034829931972789115, 'maxOutputChannels': 2L, 'name': u'surround71', 'defaultHighInputLatency': -1.0}
{'defaultSampleRate': 44100.0, 'defaultLowOutputLatency': 0.008707482993197279, 'defaultLowInputLatency': 0.008707482993197279, 'maxInputChannels': 32L, 'structVersion': 2L, 'hostApi': 0L, 'index': 8, 'defaultHighOutputLatency': 0.034829931972789115, 'maxOutputChannels': 32L, 'name': u'pulse', 'defaultHighInputLatency': 0.034829931972789115}
{'defaultSampleRate': 48000.0, 'defaultLowOutputLatency': 0.021333333333333333, 'defaultLowInputLatency': -1.0, 'maxInputChannels': 0L, 'structVersion': 2L, 'hostApi': 0L, 'index': 9, 'defaultHighOutputLatency': 0.021333333333333333, 'maxOutputChannels': 2L, 'name': u'dmix', 'defaultHighInputLatency': -1.0}
{'defaultSampleRate': 44100.0, 'defaultLowOutputLatency': 0.008707482993197279, 'defaultLowInputLatency': 0.008707482993197279, 'maxInputChannels': 32L, 'structVersion': 2L, 'hostApi': 0L, 'index': 10, 'defaultHighOutputLatency': 0.034829931972789115, 'maxOutputChannels': 32L, 'name': u'default', 'defaultHighInputLatency': 0.034829931972789115}
Вышеупомянутое также не удовлетворяло достаточно. Более внимательное рассмотрение перечислимого вывода списка устройств показывает что, одно соответствие для 'называния': u'M-дорожка Восемь: Аудио USB (hw:1,0)' действительно показывает, что количество входных и выходных каналов равняется 8, но перечисленный как единое устройство. Затем затем sounddevice дал мне следующий вывод:
skrowten_hermit@PC-760:~$ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sounddevice as sd
>>> sd.query_devices()
0 HDA Intel: AD1984A Analog (hw:0,0), ALSA (2 in, 2 out)
1 HDA Intel: AD1984A Alt Analog (hw:0,2), ALSA (2 in, 0 out)
2 M-Track Eight: USB Audio (hw:1,0), ALSA (8 in, 8 out)
3 sysdefault, ALSA (128 in, 128 out)
4 front, ALSA (0 in, 2 out)
5 surround40, ALSA (0 in, 2 out)
6 surround51, ALSA (0 in, 2 out)
7 surround71, ALSA (0 in, 2 out)
8 pulse, ALSA (32 in, 32 out)
9 dmix, ALSA (0 in, 2 out)
* 10 default, ALSA (32 in, 32 out)
Здесь также, устройство 2 шоу 8 в, 8.
То, что я не понимаю:
Мои требования вкратце:
Как я могу достигнуть этого? Я могу получить более четкое изображение ALSA и его роли здесь? Какие-либо драйверы, доступные, который может удовлетворить мои требования?
ОБНОВЛЕНИЕ:
Я создал следующее ~/.asoundrc
от исходных данных я получил:
pcm.!default {
type plug
slave {
pcm "hw:1,0"
}
}
ctl.!default {
type hw
card 1
}
pcm_slave.eightchannels {
pcm "hw:1,0"
channels 8
rate 44100
buffer_size 4096
period_size 2048
}
pcm.ch12 {
type asym
playback.pcm {
type dshare
ipc_key 1111
slave eightchannels
bindings [ 0 1 ]
}
capture.pcm {
type dsnoop
ipc_key 1111
slave eightchannels
bindings [ 0 1 ]
}
hint.description "M-Audio channels 1,2"
}
pcm.ch34 {
type asym
playback.pcm {
type dshare
ipc_key 2222
slave eightchannels
bindings [ 2 3 ]
}
capture.pcm {
type dsnoop
ipc_key 2222
slave eightchannels
bindings [ 2 3 ]
}
hint.description "M-Audio channels 3,4"
}
Так, с вышеупомянутой конфигурацией, когда я пытаюсь работать aplay
, следующее - то, что я получаю:
skrowten_hermit@PC-760:~$ aplay -D ch12 -c 1 -r 8000 male_8k.wav
Playing WAVE 'male_8k.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
aplay: set_params:1233: Sample format non available
Available formats:
- S32_LE
Принятие его является несоответствием с форматом, как обозначено, я пытался передать формат как аргумент в пользу aplay
как указано ниже:
skrowten_hermit@PC-760:~$ aplay -D ch12 -c 1 -r 8000 -f S32_LE male_8k.wav
Warning: format is changed to S16_LE
Playing WAVE 'male_8k.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
aplay: set_params:1233: Sample format non available
Available formats:
- S32_LE
Делает эту ошибку, имеют некоторое отношение к устройствам PCM или .wav
файл играется?
P.S.: .!default
s были добавлены позже. Удаление их не имеет никакого значения!
После проигрывания вокруг много и экспериментирование с плагинами, я смог найти решение вышеупомянутой проблемы. Это было только расширение вышеупомянутого ответа и подсказки, которые я получил отсюда. Прежде всего, следующее .asoundrc
Я раньше получал его работа:
pcm.!default {
type plug
slave {
pcm "hw:1,0"
}
}
ctl.!default {
type hw
card 1
}
pcm_slave.m-audio_m-track_eight_1 {
pcm "hw:1,0"
channels 8
rate 44100
buffer_size 4096
period_size 1024
}
pcm.outch1 {
type dshare
ipc_key 1111
slave m-audio_m-track_eight_1
bindings [ 0 ]
hint.description "M-Audio M-Track Eight output/playback channel 1"
}
pcm.inch1 {
type dsnoop
ipc_key 1111
slave m-audio_m-track_eight_1
bindings [ 0 ]
hint.description "M-Audio M-Track Eight input/capture channel 1"
}
pcm.outch2 {
type dshare
ipc_key 1111
slave m-audio_m-track_eight_1
bindings [ 1 ]
hint.description "M-Audio M-Track Eight output/playback channel 2"
}
pcm.inch2 {
type dsnoop
ipc_key 1111
slave m-audio_m-track_eight_1
bindings [ 1 ]
hint.description "M-Audio M-Track Eight input/capture channel 2"
}
pcm.outch3 {
type dshare
ipc_key 1111
slave m-audio_m-track_eight_1
bindings [ 2 ]
hint.description "M-Audio M-Track Eight output/playback channel 3"
}
pcm.inch3 {
type dsnoop
ipc_key 1111
slave m-audio_m-track_eight_1
bindings [ 2 ]
hint.description "M-Audio M-Track Eight input/capture channel 3"
}
pcm.outch4 {
type dshare
ipc_key 1111
slave m-audio_m-track_eight_1
bindings [ 3 ]
hint.description "M-Audio M-Track Eight output/playback channel 4"
}
pcm.inch4 {
type dsnoop
ipc_key 1111
slave m-audio_m-track_eight_1
bindings [ 3 ]
hint.description "M-Audio M-Track Eight input/capture channel 4"
}
pcm.outch5 {
type dshare
ipc_key 1111
slave m-audio_m-track_eight_1
bindings [ 4 ]
hint.description "M-Audio M-Track Eight output/playback channel 5"
}
pcm.inch5 {
type dsnoop
ipc_key 1111
slave m-audio_m-track_eight_1
bindings [ 4 ]
hint.description "M-Audio M-Track Eight input/capture channel 5"
}
pcm.outch6 {
type dshare
ipc_key 1111
slave m-audio_m-track_eight_1
bindings [ 5 ]
hint.description "M-Audio M-Track Eight output/playback channel 6"
}
pcm.inch6 {
type dsnoop
ipc_key 1111
slave m-audio_m-track_eight_1
bindings [ 5 ]
hint.description "M-Audio M-Track Eight input/capture channel 6"
}
pcm.outch7 {
type dshare
ipc_key 1111
slave m-audio_m-track_eight_1
bindings [ 6 ]
hint.description "M-Audio M-Track Eight output/playback channel 7"
}
pcm.inch7 {
type dsnoop
ipc_key 1111
slave m-audio_m-track_eight_1
bindings [ 6 ]
hint.description "M-Audio M-Track Eight input/capture channel 7"
}
pcm.outch8 {
type dshare
ipc_key 1111
slave m-audio_m-track_eight_1
bindings [ 7 ]
hint.description "M-Audio M-Track Eight output/playback channel 8"
}
pcm.inch8 {
type dsnoop
ipc_key 1111
slave m-audio_m-track_eight_1
bindings [ 7 ]
hint.description "M-Audio M-Track Eight input/capture channel 8"
}
Я попытался сохранить все это простым. Команды ALSA aplay
и arecord
, которые являются плеером звука командной строки и устройством записи соответственно, затем позволил мне делать то, что требовалось, т.е., играйте речевой файл, а также играть речевой файл на одном канале (подключенный к порту аналогового выхода) и записывать его с другим моноканалом (подключенный к порту аналогового входа).
Для тестирования конфигурационного файла я использовал следующее aplay
команда:
skrowten_hermit@PC-760:~$ aplay -D plug:outch1 -c 1 -r 8000 male_8k.wav
С вышеупомянутым работает просто великолепно воспроизведение. Теперь, для приступания к делу, и видеть, использовалось ли и воспроизведение и получение и работа, следующее:
skrowten_hermit@PC-760:~$ aplay -D plug:outch1 -c 1 -r 8000 /home/sreekanth/Downloads/male_8k.wav | arecord -D plug:inch2 -c 1 -r 8000 -d 10 /home/sreekanth/Downloads/out_12.wav
Вышеупомянутый канал 1 использования (подключенный к порту аналогового выхода 1 на моей M-дорожке M-Audio Восемь звуковых карт) к проигрыванию устройства и канала 2 (подключенный к порту аналогового входа 2 на моей M-дорожке M-Audio Восемь звуковых карт) как регистрирующее устройство. Для использования других устройств outch1 может быть заменен любым из outch2, outch3, outch4, outch5, outch6, outch7, outch8 и inch2 любым из inch1, inch3, inch4, inch5, inch6, inch7, inch8 (в соответствии с тем, что было определено в .asoundrc
).
Было немного трудно найти право и хорошо зарегистрированную литературу для ALSA. Но на основе моего опыта это - параметр bindings
необходимо переделать для маршрутизации аудио от аналоговых портов (возможно клиентский канал) к каналам ALSA (ведомые каналы, определенные как выше в .asoundrc
).
Четыре пары не указаны в качестве отдельных устройств, поскольку они не являются отдельными устройствами. M-Track Eight - это одно устройство с восемью каналами.
Можно было бы создать группу виртуальных программных устройств, которые эмулируют четыре стереопары. Для этого добавьте что-то подобное в /etc/asound.conf
или в ~/.asoundrc
:
pcm_slave.eightchannels {
pcm "hw:Eight"
channels 8
rate 48000
buffer_size 8192 # make these sizes smaller for lower latency
period_size 2048
}
pcm.ch12 {
type asym
playback.pcm {
type dshare
ipc_key 2222 # some random number, but the same for the same slave
slave eightchannels
bindings [ 0 1 ]
}
capture.pcm {
type dsnoop
ipc_key 2222
slave eightchannels
bindings [ 0 1 ]
}
hint.description "M-Track channels 1,2"
}
pcm.ch34 {
type asym
playback.pcm {
type dshare
ipc_key 2222
slave eightchannels
bindings [ 2 3 ]
}
capture.pcm {
type dsnoop
ipc_key 2222
slave eightchannels
bindings [ 2 3 ]
}
hint.description "M-Track channels 3,4"
}
...