요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
========================================================
Guide to using M-Audio Audiophile USB with ALSA and Jack
========================================================
v1.5
Thibault Le Meur <[email protected]>
This document is a guide to using the M-Audio Audiophile USB (tm) device with
ALSA and JACK.
History
=======
* v1.4 - Thibault Le Meur (2007-07-11)
- Added Low Endianness nature of 16bits-modes
found by Hakan Lennestal <[email protected]>
- Modifying document structure
* v1.5 - Thibault Le Meur (2007-07-12)
- Added AC3/DTS passthru info
Audiophile USB Specs and correct usage
======================================
This part is a reminder of important facts about the functions and limitations
of the device.
The device has 4 audio interfaces, and 2 MIDI ports:
* Analog Stereo Input (Ai)
- This port supports 2 pairs of line-level audio inputs (1/4" TS and RCA)
- When the 1/4" TS (jack) connectors are connected, the RCA connectors
are disabled
* Analog Stereo Output (Ao)
* Digital Stereo Input (Di)
* Digital Stereo Output (Do)
* Midi In (Mi)
* Midi Out (Mo)
The internal DAC/ADC has the following characteristics:
* sample depth of 16 or 24 bits
* sample rate from 8kHz to 96kHz
* Two interfaces can't use different sample depths at the same time.
Moreover, the Audiophile USB documentation gives the following Warning:
Please exit any audio application running before switching between bit depths
Due to the USB 1.1 bandwidth limitation, a limited number of interfaces can be
activated at the same time depending on the audio mode selected:
* 16-bit/48kHz ==> 4 channels in + 4 channels out
- Ai+Ao+Di+Do
* 24-bit/48kHz ==> 4 channels in + 2 channels out,
or 2 channels in + 4 channels out
- Ai+Ao+Do or Ai+Di+Ao or Ai+Di+Do or Di+Ao+Do
* 24-bit/96kHz ==> 2 channels in _or_ 2 channels out (half duplex only)
- Ai or Ao or Di or Do
Important facts about the Digital interface:
--------------------------------------------
* The Do port additionally supports surround-encoded AC-3 and DTS passthrough,
though I haven't tested it under Linux
- Note that in this setup only the Do interface can be enabled
* Apart from recording an audio digital stream, enabling the Di port is a way
to synchronize the device to an external sample clock
- As a consequence, the Di port must be enable only if an active Digital
source is connected
- Enabling Di when no digital source is connected can result in a
synchronization error (for instance sound played at an odd sample rate)
Audiophile USB MIDI support in ALSA
===================================
The Audiophile USB MIDI ports will be automatically supported once the
following modules have been loaded:
* snd-usb-audio
* snd-seq-midi
No additional setting is required.
Audiophile USB Audio support in ALSA
====================================
Audio functions of the Audiophile USB device are handled by the snd-usb-audio
module. This module can work in a default mode (without any device-specific
parameter), or in an "advanced" mode with the device-specific parameter called
``device_setup``.
Default Alsa driver mode
------------------------
The default behavior of the snd-usb-audio driver is to list the device
capabilities at startup and activate the required mode when required
by the applications: for instance if the user is recording in a
24bit-depth-mode and immediately after wants to switch to a 16bit-depth mode,
the snd-usb-audio module will reconfigure the device on the fly.
This approach has the advantage to let the driver automatically switch from sample
rates/depths automatically according to the user's needs. However, those who
are using the device under windows know that this is not how the device is meant to
work: under windows applications must be closed before using the m-audio control
panel to switch the device working mode. Thus as we'll see in next section, this
Default Alsa driver mode can lead to device misconfigurations.
Let's get back to the Default Alsa driver mode for now. In this case the
Audiophile interfaces are mapped to alsa pcm devices in the following
way (I suppose the device's index is 1):
* hw:1,0 is Ao in playback and Di in capture
* hw:1,1 is Do in playback and Ai in capture
* hw:1,2 is Do in AC3/DTS passthrough mode
In this mode, the device uses Big Endian byte-encoding so that
supported audio format are S16_BE for 16-bit depth modes and S24_3BE for
24-bits depth mode.
One exception is the hw:1,2 port which was reported to be Little Endian
compliant (supposedly supporting S16_LE) but processes in fact only S16_BE streams.
This has been fixed in kernel 2.6.23 and above and now the hw:1,2 interface
is reported to be big endian in this default driver mode.
Examples:
* playing a S24_3BE encoded raw file to the Ao port::
% aplay -D hw:1,0 -c2 -t raw -r48000 -fS24_3BE test.raw
* recording a S24_3BE encoded raw file from the Ai port::
% arecord -D hw:1,1 -c2 -t raw -r48000 -fS24_3BE test.raw
* playing a S16_BE encoded raw file to the Do port::
% aplay -D hw:1,1 -c2 -t raw -r48000 -fS16_BE test.raw
* playing an ac3 sample file to the Do port::
% aplay -D hw:1,2 --channels=6 ac3_S16_BE_encoded_file.raw
If you're happy with the default Alsa driver mode and don't experience any
issue with this mode, then you can skip the following chapter.
Advanced module setup
---------------------
Due to the hardware constraints described above, the device initialization made
by the Alsa driver in default mode may result in a corrupted state of the
device. For instance, a particularly annoying issue is that the sound captured
from the Ai interface sounds distorted (as if boosted with an excessive high
volume gain).
For people having this problem, the snd-usb-audio module has a new module
parameter called ``device_setup`` (this parameter was introduced in kernel
release 2.6.17)
Initializing the working mode of the Audiophile USB
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
As far as the Audiophile USB device is concerned, this value let the user
specify:
* the sample depth
* the sample rate
* whether the Di port is used or not
When initialized with ``device_setup=0x00``, the snd-usb-audio module has
the same behaviour as when the parameter is omitted (see paragraph "Default
Alsa driver mode" above)
Others modes are described in the following subsections.
16-bit modes
~~~~~~~~~~~~
The two supported modes are:
* ``device_setup=0x01``
- 16bits 48kHz mode with Di disabled
- Ai,Ao,Do can be used at the same time
- hw:1,0 is not available in capture mode
- hw:1,2 is not available
* ``device_setup=0x11``
- 16bits 48kHz mode with Di enabled
- Ai,Ao,Di,Do can be used at the same time
- hw:1,0 is available in capture mode
- hw:1,2 is not available
In this modes the device operates only at 16bits-modes. Before kernel 2.6.23,
the devices where reported to be Big-Endian when in fact they were Little-Endian
so that playing a file was a matter of using:
::
% aplay -D hw:1,1 -c2 -t raw -r48000 -fS16_BE test_S16_LE.raw
where "test_S16_LE.raw" was in fact a little-endian sample file.
Thanks to Hakan Lennestal (who discovered the Little-Endiannes of the device in
these modes) a fix has been committed (expected in kernel 2.6.23) and
Alsa now reports Little-Endian interfaces. Thus playing a file now is as simple as
using:
::
% aplay -D hw:1,1 -c2 -t raw -r48000 -fS16_LE test_S16_LE.raw
24-bit modes
~~~~~~~~~~~~
The three supported modes are:
* ``device_setup=0x09``
- 24bits 48kHz mode with Di disabled
- Ai,Ao,Do can be used at the same time
- hw:1,0 is not available in capture mode
- hw:1,2 is not available
* ``device_setup=0x19``
- 24bits 48kHz mode with Di enabled
- 3 ports from {Ai,Ao,Di,Do} can be used at the same time
- hw:1,0 is available in capture mode and an active digital source must be
connected to Di
- hw:1,2 is not available
* ``device_setup=0x0D`` or ``0x10``
- 24bits 96kHz mode
- Di is enabled by default for this mode but does not need to be connected
to an active source
- Only 1 port from {Ai,Ao,Di,Do} can be used at the same time
- hw:1,0 is available in captured mode
- hw:1,2 is not available
In these modes the device is only Big-Endian compliant (see "Default Alsa driver
mode" above for an aplay command example)
AC3 w/ DTS passthru mode
~~~~~~~~~~~~~~~~~~~~~~~~
Thanks to Hakan Lennestal, I now have a report saying that this mode works.
* ``device_setup=0x03``
- 16bits 48kHz mode with only the Do port enabled
- AC3 with DTS passthru
- Caution with this setup the Do port is mapped to the pcm device hw:1,0
The command line used to playback the AC3/DTS encoded .wav-files in this mode:
::
% aplay -D hw:1,0 --channels=6 ac3_S16_LE_encoded_file.raw
How to use the ``device_setup`` parameter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The parameter can be given:
* By manually probing the device (as root):::
# modprobe -r snd-usb-audio
# modprobe snd-usb-audio index=1 device_setup=0x09
* Or while configuring the modules options in your modules configuration file
(typically a .conf file in /etc/modprobe.d/ directory:::
alias snd-card-1 snd-usb-audio
options snd-usb-audio index=1 device_setup=0x09
CAUTION when initializing the device
-------------------------------------
* Correct initialization on the device requires that device_setup is given to
the module BEFORE the device is turned on. So, if you use the "manual probing"
method described above, take care to power-on the device AFTER this initialization.
* Failing to respect this will lead to a misconfiguration of the device. In this case
turn off the device, unprobe the snd-usb-audio module, then probe it again with
correct device_setup parameter and then (and only then) turn on the device again.
* If you've correctly initialized the device in a valid mode and then want to switch
to another mode (possibly with another sample-depth), please use also the following
procedure:
- first turn off the device
- de-register the snd-usb-audio module (modprobe -r)
- change the device_setup parameter by changing the device_setup
option in ``/etc/modprobe.d/*.conf``
- turn on the device
* A workaround for this last issue has been applied to kernel 2.6.23, but it may not
be enough to ensure the 'stability' of the device initialization.
Technical details for hackers
-----------------------------
This section is for hackers, wanting to understand details about the device
internals and how Alsa supports it.
Audiophile USB's ``device_setup`` structure
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you want to understand the device_setup magic numbers for the Audiophile
USB, you need some very basic understanding of binary computation. However,
this is not required to use the parameter and you may skip this section.
The device_setup is one byte long and its structure is the following:
::
+---+---+---+---+---+---+---+---+
| b7| b6| b5| b4| b3| b2| b1| b0|
+---+---+---+---+---+---+---+---+
| 0 | 0 | 0 | Di|24B|96K|DTS|SET|
+---+---+---+---+---+---+---+---+
Where:
* b0 is the ``SET`` bit
- it MUST be set if device_setup is initialized
* b1 is the ``DTS`` bit
- it is set only for Digital output with DTS/AC3
- this setup is not tested
* b2 is the Rate selection flag
- When set to ``1`` the rate range is 48.1-96kHz
- Otherwise the sample rate range is 8-48kHz
* b3 is the bit depth selection flag
- When set to ``1`` samples are 24bits long
- Otherwise they are 16bits long
- Note that b2 implies b3 as the 96kHz mode is only supported for 24 bits
samples
* b4 is the Digital input flag
- When set to ``1`` the device assumes that an active digital source is
connected
- You shouldn't enable Di if no source is seen on the port (this leads to
synchronization issues)
- b4 is implied by b2 (since only one port is enabled at a time no synch
error can occur)
* b5 to b7 are reserved for future uses, and must be set to ``0``
- might become Ao, Do, Ai, for b7, b6, b4 respectively
Caution:
* there is no check on the value you will give to device_setup
- for instance choosing 0x05 (16bits 96kHz) will fail back to 0x09 since
b2 implies b3. But _there_will_be_no_warning_ in /var/log/messages
* Hardware constraints due to the USB bus limitation aren't checked
- choosing b2 will prepare all interfaces for 24bits/96kHz but you'll
only be able to use one at the same time
USB implementation details for this device
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You may safely skip this section if you're not interested in driver
hacking.
This section describes some internal aspects of the device and summarizes the
data I got by usb-snooping the windows and Linux drivers.
The M-Audio Audiophile USB has 7 USB Interfaces:
a "USB interface":
* USB Interface nb.0
* USB Interface nb.1
- Audio Control function
* USB Interface nb.2
- Analog Output
* USB Interface nb.3
- Digital Output
* USB Interface nb.4
- Analog Input
* USB Interface nb.5
- Digital Input
* USB Interface nb.6
- MIDI interface compliant with the MIDIMAN quirk
Each interface has 5 altsettings (AltSet 1,2,3,4,5) except:
* Interface 3 (Digital Out) has an extra Alset nb.6
* Interface 5 (Digital In) does not have Alset nb.3 and 5
Here is a short description of the AltSettings capabilities:
* AltSettings 1 corresponds to
- 24-bit depth, 48.1-96kHz sample mode
- Adaptive playback (Ao and Do), Synch capture (Ai), or Asynch capture (Di)
* AltSettings 2 corresponds to
- 24-bit depth, 8-48kHz sample mode
- Asynch capture and playback (Ao,Ai,Do,Di)
* AltSettings 3 corresponds to
- 24-bit depth, 8-48kHz sample mode
- Synch capture (Ai) and Adaptive playback (Ao,Do)
* AltSettings 4 corresponds to
- 16-bit depth, 8-48kHz sample mode
- Asynch capture and playback (Ao,Ai,Do,Di)
* AltSettings 5 corresponds to
- 16-bit depth, 8-48kHz sample mode
- Synch capture (Ai) and Adaptive playback (Ao,Do)
* AltSettings 6 corresponds to
- 16-bit depth, 8-48kHz sample mode
- Synch playback (Do), audio format type III IEC1937_AC-3
In order to ensure a correct initialization of the device, the driver
*must* *know* how the device will be used:
* if DTS is chosen, only Interface 2 with AltSet nb.6 must be
registered
* if 96KHz only AltSets nb.1 of each interface must be selected
* if samples are using 24bits/48KHz then AltSet 2 must me used if
Digital input is connected, and only AltSet nb.3 if Digital input
is not connected
* if samples are using 16bits/48KHz then AltSet 4 must me used if
Digital input is connected, and only AltSet nb.5 if Digital input
is not connected
When device_setup is given as a parameter to the snd-usb-audio module, the
parse_audio_endpoints function uses a quirk called
``audiophile_skip_setting_quirk`` in order to prevent AltSettings not
corresponding to device_setup from being registered in the driver.
Audiophile USB and Jack support
===============================
This section deals with support of the Audiophile USB device in Jack.
There are 2 main potential issues when using Jackd with the device:
* support for Big-Endian devices in 24-bit modes
* support for 4-in / 4-out channels
Direct support in Jackd
-----------------------
Jack supports big endian devices only in recent versions (thanks to
Andreas Steinmetz for his first big-endian patch). I can't remember
exactly when this support was released into jackd, let's just say that
with jackd version 0.103.0 it's almost ok (just a small bug is affecting
16bits Big-Endian devices, but since you've read carefully the above
paragraphs, you're now using kernel >= 2.6.23 and your 16bits devices
are now Little Endians ;-) ).
You can run jackd with the following command for playback with Ao and
record with Ai:
::
% jackd -R -dalsa -Phw:1,0 -r48000 -p128 -n2 -D -Chw:1,1
Using Alsa plughw
-----------------
If you don't have a recent Jackd installed, you can downgrade to using
the Alsa ``plug`` converter.
For instance here is one way to run Jack with 2 playback channels on Ao and 2
capture channels from Ai:
::
% jackd -R -dalsa -dplughw:1 -r48000 -p256 -n2 -D -Cplughw:1,1
However you may see the following warning message:
You appear to be using the ALSA software "plug" layer, probably a result of
using the "default" ALSA device. This is less efficient than it could be.
Consider using a hardware device instead rather than using the plug layer.
Getting 2 input and/or output interfaces in Jack
------------------------------------------------
As you can see, starting the Jack server this way will only enable 1 stereo
input (Di or Ai) and 1 stereo output (Ao or Do).
This is due to the following restrictions:
* Jack can only open one capture device and one playback device at a time
* The Audiophile USB is seen as 2 (or three) Alsa devices: hw:1,0, hw:1,1
(and optionally hw:1,2)
If you want to get Ai+Di and/or Ao+Do support with Jack, you would need to
combine the Alsa devices into one logical "complex" device.
If you want to give it a try, I recommend reading the information from
this page: http://www.sound-man.co.uk/linuxaudio/ice1712multi.html
It is related to another device (ice1712) but can be adapted to suit
the Audiophile USB.
Enabling multiple Audiophile USB interfaces for Jackd will certainly require:
* Making sure your Jackd version has the MMAP_COMPLEX patch (see the ice1712 page)
* (maybe) patching the alsa-lib/src/pcm/pcm_multi.c file (see the ice1712 page)
* define a multi device (combination of hw:1,0 and hw:1,1) in your .asoundrc
file
* start jackd with this device
I had no success in testing this for now, if you have any success with this kind
of setup, please drop me an email.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
문서 이력, 장치 사양과 MIDI 지원
1-96이 문서는 M-Audio Audiophile USB 장치를 ALSA와 JACK에서 사용하는 방법을 설명하는 버전 1.5 안내서이며, 작성자는 Thibault Le Meur이다. 버전 1.4(2007-07-11)에서는 Hakan Lennestal이 발견한 16비트 모드의 리틀 엔디언 특성을 추가하고 문서 구조를 바꾸었으며, 버전 1.5(2007-07-12)에서는 AC-3/DTS 패스스루 정보를 추가했다.
장치는 네 개의 오디오 인터페이스와 두 개의 MIDI 포트를 제공한다. 아날로그 스테레오 입력(Ai)은 1/4인치 TS와 RCA라는 두 쌍의 라인 레벨 입력을 지원하지만, 1/4인치 TS 잭을 연결하면 RCA 단자는 비활성화된다. 나머지는 아날로그 스테레오 출력(Ao), 디지털 스테레오 입력(Di), 디지털 스테레오 출력(Do), MIDI 입력(Mi), MIDI 출력(Mo)이다.
내부 DAC/ADC는 16비트 또는 24비트 표본 깊이와 8kHz~96kHz 표본률을 지원한다. 두 인터페이스가 서로 다른 표본 깊이를 동시에 사용할 수는 없다. Audiophile USB 설명서는 비트 깊이를 전환하기 전에 실행 중인 모든 오디오 응용 프로그램을 종료하라고 경고한다.
USB 1.1 대역폭 때문에 동시에 활성화할 수 있는 인터페이스 수는 오디오 모드에 따라 제한된다. 16비트/48kHz에서는 입력 4채널과 출력 4채널, 즉 Ai+Ao+Di+Do를 모두 쓸 수 있다. 24비트/48kHz에서는 입력 4채널+출력 2채널 또는 입력 2채널+출력 4채널만 가능하며 조합은 Ai+Ao+Do, Ai+Di+Ao, Ai+Di+Do, Di+Ao+Do이다. 24비트/96kHz에서는 Ai, Ao, Di, Do 가운데 하나만 쓰는 2채널 입력 또는 2채널 출력의 반이중 모드만 가능하다.
Do 포트는 서라운드 인코딩 AC-3와 DTS 패스스루도 지원하지만 작성자는 Linux에서 시험하지 않았다. 이 구성에서는 Do 인터페이스만 활성화할 수 있다. Di 포트는 디지털 오디오 녹음뿐 아니라 외부 표본 클록에 장치를 동기화하는 용도로도 쓰이므로, 활성 디지털 소스가 연결된 경우에만 켜야 한다. 소스 없이 Di를 켜면 재생 속도가 이상해지는 것과 같은 동기화 오류가 날 수 있다.
Audiophile USB의 MIDI 포트는 `snd-usb-audio`와 `snd-seq-midi` 모듈을 적재하면 ALSA가 자동으로 지원하며, 별도 설정은 필요 없다.
문서가 사용하는 약어와 포트의 역할을 정리한다.
표본 깊이와 표본률에 따라 허용되는 입출력 조합이다.
========================================================
Guide to using M-Audio Audiophile USB with ALSA and Jack
========================================================
v1.5
Thibault Le Meur <[email protected]>
This document is a guide to using the M-Audio Audiophile USB (tm) device with
ALSA and JACK.
History
=======
* v1.4 - Thibault Le Meur (2007-07-11)
- Added Low Endianness nature of 16bits-modes
found by Hakan Lennestal <[email protected]>
- Modifying document structure
* v1.5 - Thibault Le Meur (2007-07-12)
- Added AC3/DTS passthru info
Audiophile USB Specs and correct usage
======================================
This part is a reminder of important facts about the functions and limitations
of the device.
The device has 4 audio interfaces, and 2 MIDI ports:
* Analog Stereo Input (Ai)
- This port supports 2 pairs of line-level audio inputs (1/4" TS and RCA)
- When the 1/4" TS (jack) connectors are connected, the RCA connectors
are disabled
* Analog Stereo Output (Ao)
* Digital Stereo Input (Di)
* Digital Stereo Output (Do)
* Midi In (Mi)
* Midi Out (Mo)
The internal DAC/ADC has the following characteristics:
* sample depth of 16 or 24 bits
* sample rate from 8kHz to 96kHz
* Two interfaces can't use different sample depths at the same time.
Moreover, the Audiophile USB documentation gives the following Warning:
Please exit any audio application running before switching between bit depths
Due to the USB 1.1 bandwidth limitation, a limited number of interfaces can be
activated at the same time depending on the audio mode selected:
* 16-bit/48kHz ==> 4 channels in + 4 channels out
- Ai+Ao+Di+Do
* 24-bit/48kHz ==> 4 channels in + 2 channels out,
or 2 channels in + 4 channels out
- Ai+Ao+Do or Ai+Di+Ao or Ai+Di+Do or Di+Ao+Do
* 24-bit/96kHz ==> 2 channels in _or_ 2 channels out (half duplex only)
- Ai or Ao or Di or Do
Important facts about the Digital interface:
--------------------------------------------
* The Do port additionally supports surround-encoded AC-3 and DTS passthrough,
though I haven't tested it under Linux
- Note that in this setup only the Do interface can be enabled
* Apart from recording an audio digital stream, enabling the Di port is a way
to synchronize the device to an external sample clock
- As a consequence, the Di port must be enable only if an active Digital
source is connected
- Enabling Di when no digital source is connected can result in a
synchronization error (for instance sound played at an odd sample rate)
Audiophile USB MIDI support in ALSA
===================================
The Audiophile USB MIDI ports will be automatically supported once the
following modules have been loaded:
* snd-usb-audio
* snd-seq-midi
No additional setting is required.
기본 ALSA 드라이버 모드
97-160Audiophile USB의 오디오 기능은 `snd-usb-audio` 모듈이 담당한다. 이 모듈은 장치 전용 매개변수 없이 기본 모드로 동작하거나, `device_setup` 매개변수를 사용하는 고급 모드로 동작할 수 있다.
기본 모드에서 드라이버는 시작할 때 장치 기능을 열거하고 응용 프로그램이 요구할 때 해당 모드를 활성화한다. 예를 들어 24비트 녹음 직후 16비트 모드로 바꾸려 하면 모듈이 장치를 즉석에서 재구성한다. 사용 요구에 따라 표본률과 깊이를 자동 전환한다는 장점이 있지만, Windows에서는 모드를 바꾸기 전에 응용 프로그램을 닫아야 하는 장치이므로 이 자동 전환은 장치를 잘못 구성할 수 있다.
장치 인덱스를 1로 가정하면 기본 모드의 ALSA PCM 매핑은 다음과 같다. `hw:1,0`은 재생에서 Ao, 캡처에서 Di이고, `hw:1,1`은 재생에서 Do, 캡처에서 Ai이다. `hw:1,2`는 AC-3/DTS 패스스루용 Do이다.
기본 모드는 빅 엔디언 바이트 인코딩을 사용하므로 16비트 형식은 `S16_BE`, 24비트 형식은 `S24_3BE`이다. 예외인 `hw:1,2`는 한때 리틀 엔디언(`S16_LE`) 호환으로 보고됐지만 실제로는 `S16_BE` 스트림만 처리했다. 커널 2.6.23 이상에서 수정되어 기본 드라이버 모드의 `hw:1,2`도 빅 엔디언으로 보고된다.
Ao로 `S24_3BE` raw 파일을 재생하고 Ai에서 같은 형식으로 녹음하며, Do로 `S16_BE` raw 파일 또는 6채널 AC-3 표본을 재생하는 예는 다음과 같다.
% aplay -D hw:1,0 -c2 -t raw -r48000 -fS24_3BE test.raw
% arecord -D hw:1,1 -c2 -t raw -r48000 -fS24_3BE test.raw
% aplay -D hw:1,1 -c2 -t raw -r48000 -fS16_BE test.raw
% aplay -D hw:1,2 --channels=6 ac3_S16_BE_encoded_file.raw
기본 ALSA 드라이버 모드에 문제가 없다면 뒤의 고급 모드 설명은 건너뛰어도 된다.
장치 인덱스가 1일 때 재생과 캡처 방향별 포트가 다르다.
Audiophile USB Audio support in ALSA
====================================
Audio functions of the Audiophile USB device are handled by the snd-usb-audio
module. This module can work in a default mode (without any device-specific
parameter), or in an "advanced" mode with the device-specific parameter called
``device_setup``.
Default Alsa driver mode
------------------------
The default behavior of the snd-usb-audio driver is to list the device
capabilities at startup and activate the required mode when required
by the applications: for instance if the user is recording in a
24bit-depth-mode and immediately after wants to switch to a 16bit-depth mode,
the snd-usb-audio module will reconfigure the device on the fly.
This approach has the advantage to let the driver automatically switch from sample
rates/depths automatically according to the user's needs. However, those who
are using the device under windows know that this is not how the device is meant to
work: under windows applications must be closed before using the m-audio control
panel to switch the device working mode. Thus as we'll see in next section, this
Default Alsa driver mode can lead to device misconfigurations.
Let's get back to the Default Alsa driver mode for now. In this case the
Audiophile interfaces are mapped to alsa pcm devices in the following
way (I suppose the device's index is 1):
* hw:1,0 is Ao in playback and Di in capture
* hw:1,1 is Do in playback and Ai in capture
* hw:1,2 is Do in AC3/DTS passthrough mode
In this mode, the device uses Big Endian byte-encoding so that
supported audio format are S16_BE for 16-bit depth modes and S24_3BE for
24-bits depth mode.
One exception is the hw:1,2 port which was reported to be Little Endian
compliant (supposedly supporting S16_LE) but processes in fact only S16_BE streams.
This has been fixed in kernel 2.6.23 and above and now the hw:1,2 interface
is reported to be big endian in this default driver mode.
Examples:
* playing a S24_3BE encoded raw file to the Ao port::
% aplay -D hw:1,0 -c2 -t raw -r48000 -fS24_3BE test.raw
* recording a S24_3BE encoded raw file from the Ai port::
% arecord -D hw:1,1 -c2 -t raw -r48000 -fS24_3BE test.raw
* playing a S16_BE encoded raw file to the Do port::
% aplay -D hw:1,1 -c2 -t raw -r48000 -fS16_BE test.raw
* playing an ac3 sample file to the Do port::
% aplay -D hw:1,2 --channels=6 ac3_S16_BE_encoded_file.raw
If you're happy with the default Alsa driver mode and don't experience any
issue with this mode, then you can skip the following chapter.
고급 설정과 16비트 모드
161-226앞에서 설명한 하드웨어 제약 때문에 기본 ALSA 초기화가 장치를 손상된 상태로 만들 수 있다. 대표적으로 Ai에서 캡처한 소리가 지나치게 큰 이득으로 증폭된 것처럼 왜곡될 수 있다. 이를 겪는 사용자를 위해 커널 2.6.17에서 `snd-usb-audio`의 `device_setup` 매개변수가 도입되었다.
Audiophile USB에서 `device_setup`은 표본 깊이, 표본률, Di 포트 사용 여부를 지정한다. `device_setup=0x00`은 매개변수를 생략한 기본 ALSA 모드와 같다.
`device_setup=0x01`은 Di를 끈 16비트/48kHz 모드다. Ai, Ao, Do를 동시에 쓸 수 있지만 `hw:1,0` 캡처와 `hw:1,2`는 사용할 수 없다. `device_setup=0x11`은 Di를 켠 16비트/48kHz 모드로 Ai, Ao, Di, Do를 모두 동시에 쓸 수 있고 `hw:1,0` 캡처도 가능하지만 `hw:1,2`는 여전히 사용할 수 없다.
이 두 모드에서 장치는 16비트로만 동작한다. 커널 2.6.23 전에는 실제 장치가 리틀 엔디언인데도 빅 엔디언으로 보고되어, 리틀 엔디언 표본 파일을 `-fS16_BE`로 지정해 재생해야 했다. Hakan Lennestal의 발견을 바탕으로 수정된 뒤 ALSA는 인터페이스를 리틀 엔디언으로 보고하므로 이제 `-fS16_LE`를 그대로 사용한다.
% aplay -D hw:1,1 -c2 -t raw -r48000 -fS16_BE test_S16_LE.raw
% aplay -D hw:1,1 -c2 -t raw -r48000 -fS16_LE test_S16_LE.raw
두 모드의 Di 사용 여부와 사용 가능한 PCM 기능을 비교한다.
커널 2.6.23 전후에 응용 프로그램이 지정해야 하는 형식이 달라졌다.
Advanced module setup
---------------------
Due to the hardware constraints described above, the device initialization made
by the Alsa driver in default mode may result in a corrupted state of the
device. For instance, a particularly annoying issue is that the sound captured
from the Ai interface sounds distorted (as if boosted with an excessive high
volume gain).
For people having this problem, the snd-usb-audio module has a new module
parameter called ``device_setup`` (this parameter was introduced in kernel
release 2.6.17)
Initializing the working mode of the Audiophile USB
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
As far as the Audiophile USB device is concerned, this value let the user
specify:
* the sample depth
* the sample rate
* whether the Di port is used or not
When initialized with ``device_setup=0x00``, the snd-usb-audio module has
the same behaviour as when the parameter is omitted (see paragraph "Default
Alsa driver mode" above)
Others modes are described in the following subsections.
16-bit modes
~~~~~~~~~~~~
The two supported modes are:
* ``device_setup=0x01``
- 16bits 48kHz mode with Di disabled
- Ai,Ao,Do can be used at the same time
- hw:1,0 is not available in capture mode
- hw:1,2 is not available
* ``device_setup=0x11``
- 16bits 48kHz mode with Di enabled
- Ai,Ao,Di,Do can be used at the same time
- hw:1,0 is available in capture mode
- hw:1,2 is not available
In this modes the device operates only at 16bits-modes. Before kernel 2.6.23,
the devices where reported to be Big-Endian when in fact they were Little-Endian
so that playing a file was a matter of using:
::
% aplay -D hw:1,1 -c2 -t raw -r48000 -fS16_BE test_S16_LE.raw
where "test_S16_LE.raw" was in fact a little-endian sample file.
Thanks to Hakan Lennestal (who discovered the Little-Endiannes of the device in
these modes) a fix has been committed (expected in kernel 2.6.23) and
Alsa now reports Little-Endian interfaces. Thus playing a file now is as simple as
using:
::
% aplay -D hw:1,1 -c2 -t raw -r48000 -fS16_LE test_S16_LE.raw
24비트 모드와 AC-3/DTS 패스스루
227-27424비트에는 세 가지 구성이 있다. `device_setup=0x09`는 Di를 끈 24비트/48kHz 모드로 Ai, Ao, Do를 동시에 사용할 수 있지만 `hw:1,0` 캡처와 `hw:1,2`는 사용할 수 없다.
`device_setup=0x19`는 Di를 켠 24비트/48kHz 모드다. Ai, Ao, Di, Do 중 세 포트를 동시에 쓸 수 있으며 `hw:1,0` 캡처가 가능하다. 이때 Di에는 활성 디지털 소스를 연결해야 하고 `hw:1,2`는 사용할 수 없다.
`device_setup=0x0D` 또는 `0x10`은 24비트/96kHz 모드다. Di는 기본으로 활성화되지만 활성 소스를 연결할 필요는 없다. Ai, Ao, Di, Do 중 한 포트만 동시에 쓸 수 있고 `hw:1,0`은 캡처 모드에서 사용할 수 있으며 `hw:1,2`는 사용할 수 없다. 이 24비트 모드들은 빅 엔디언만 지원한다.
Hakan Lennestal의 보고에 따르면 AC-3와 DTS 패스스루 모드는 동작한다. `device_setup=0x03`은 Do만 켜는 16비트/48kHz 모드이며, 이 구성에서는 Do가 `hw:1,0`에 매핑된다는 점에 주의해야 한다. AC-3/DTS로 인코딩된 WAV 파일 재생 명령은 다음과 같다.
% aplay -D hw:1,0 --channels=6 ac3_S16_LE_encoded_file.raw
각 `device_setup` 값이 선택하는 표본 형식과 인터페이스 제약이다.
24-bit modes
~~~~~~~~~~~~
The three supported modes are:
* ``device_setup=0x09``
- 24bits 48kHz mode with Di disabled
- Ai,Ao,Do can be used at the same time
- hw:1,0 is not available in capture mode
- hw:1,2 is not available
* ``device_setup=0x19``
- 24bits 48kHz mode with Di enabled
- 3 ports from {Ai,Ao,Di,Do} can be used at the same time
- hw:1,0 is available in capture mode and an active digital source must be
connected to Di
- hw:1,2 is not available
* ``device_setup=0x0D`` or ``0x10``
- 24bits 96kHz mode
- Di is enabled by default for this mode but does not need to be connected
to an active source
- Only 1 port from {Ai,Ao,Di,Do} can be used at the same time
- hw:1,0 is available in captured mode
- hw:1,2 is not available
In these modes the device is only Big-Endian compliant (see "Default Alsa driver
mode" above for an aplay command example)
AC3 w/ DTS passthru mode
~~~~~~~~~~~~~~~~~~~~~~~~
Thanks to Hakan Lennestal, I now have a report saying that this mode works.
* ``device_setup=0x03``
- 16bits 48kHz mode with only the Do port enabled
- AC3 with DTS passthru
- Caution with this setup the Do port is mapped to the pcm device hw:1,0
The command line used to playback the AC3/DTS encoded .wav-files in this mode:
::
% aplay -D hw:1,0 --channels=6 ac3_S16_LE_encoded_file.raw
`device_setup` 적용과 안전한 초기화
275-314`device_setup`은 루트 권한으로 모듈을 직접 다시 적재할 때 지정하거나, 보통 `/etc/modprobe.d/` 아래의 `.conf` 모듈 설정 파일에 기록할 수 있다.
# modprobe -r snd-usb-audio
# modprobe snd-usb-audio index=1 device_setup=0x09
alias snd-card-1 snd-usb-audio
options snd-usb-audio index=1 device_setup=0x09
장치를 올바르게 초기화하려면 장치 전원을 켜기 전에 모듈에 `device_setup`을 전달해야 한다. 직접 모듈을 적재한다면 초기화 명령을 실행한 뒤 장치 전원을 켠다. 이 순서를 지키지 않아 잘못 구성됐으면 장치를 끄고 `snd-usb-audio`를 제거한 다음 올바른 매개변수로 다시 적재하고, 그 뒤에만 장치를 켠다.
이미 유효한 모드로 초기화한 장치를 다른 표본 깊이를 포함한 다른 모드로 바꾸려면 먼저 장치를 끄고, `modprobe -r`로 `snd-usb-audio`를 등록 해제하고, `/etc/modprobe.d/*.conf`의 `device_setup` 옵션을 바꾼 뒤 장치를 다시 켠다. 커널 2.6.23에는 이 문제를 완화하는 우회책이 적용됐지만 안정적인 초기화를 완전히 보장하지 못할 수 있다.
전원보다 모듈 옵션 설정이 먼저 적용되어야 한다.
How to use the ``device_setup`` parameter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The parameter can be given:
* By manually probing the device (as root):::
# modprobe -r snd-usb-audio
# modprobe snd-usb-audio index=1 device_setup=0x09
* Or while configuring the modules options in your modules configuration file
(typically a .conf file in /etc/modprobe.d/ directory:::
alias snd-card-1 snd-usb-audio
options snd-usb-audio index=1 device_setup=0x09
CAUTION when initializing the device
-------------------------------------
* Correct initialization on the device requires that device_setup is given to
the module BEFORE the device is turned on. So, if you use the "manual probing"
method described above, take care to power-on the device AFTER this initialization.
* Failing to respect this will lead to a misconfiguration of the device. In this case
turn off the device, unprobe the snd-usb-audio module, then probe it again with
correct device_setup parameter and then (and only then) turn on the device again.
* If you've correctly initialized the device in a valid mode and then want to switch
to another mode (possibly with another sample-depth), please use also the following
procedure:
- first turn off the device
- de-register the snd-usb-audio module (modprobe -r)
- change the device_setup parameter by changing the device_setup
option in ``/etc/modprobe.d/*.conf``
- turn on the device
* A workaround for this last issue has been applied to kernel 2.6.23, but it may not
be enough to ensure the 'stability' of the device initialization.
`device_setup` 비트 구조
315-384이 절은 장치 내부와 ALSA 지원 방식을 이해하려는 개발자를 위한 내용이다. `device_setup`의 매직 넘버를 이해하려면 기초적인 이진 연산 지식이 필요하지만, 매개변수를 사용하는 데 필수는 아니다.
`device_setup`은 한 바이트다. 상위 비트부터 `b7 b6 b5 b4 b3 b2 b1 b0`이며 의미는 각각 `0 0 0 Di 24B 96K DTS SET`이다. 원문의 ASCII 비트 그림을 아래 표로 같은 좌표와 의미가 드러나도록 다시 구성했다.
b7에서 b0까지의 위치와 기능을 보존한 구조화 도식이다.
`b0`의 `SET` 비트는 `device_setup`을 초기화할 때 반드시 설정한다. `b1`의 `DTS` 비트는 DTS/AC-3 디지털 출력에만 설정하며, 원문 작성 시점에는 이 설정이 시험되지 않았다고 적혀 있다.
표본률 선택 플래그 `b2`가 1이면 범위는 48.1~96kHz이고, 0이면 8~48kHz다. 비트 깊이 플래그 `b3`가 1이면 24비트, 0이면 16비트다. 96kHz 모드는 24비트에서만 지원되므로 `b2`는 `b3`도 암시한다.
디지털 입력 플래그 `b4`가 1이면 장치는 활성 디지털 소스가 연결됐다고 가정한다. 포트에 소스가 없을 때 Di를 켜면 동기화 문제가 생기므로 피해야 한다. `b2`가 켜진 96kHz 모드에서는 한 번에 한 포트만 활성화되므로 동기화 오류가 생기지 않아 `b4`가 암시된다. `b5`~`b7`은 미래 용도로 예약되어 반드시 0이어야 하며, 원문은 향후 각각의 일부가 Ao, Do, Ai가 될 가능성을 언급한다.
드라이버는 `device_setup` 값의 유효성을 검사하지 않는다. 예를 들어 16비트/96kHz를 뜻하도록 `0x05`를 선택하면 `b2`가 `b3`를 암시하므로 `0x09`로 폴백하지만 `/var/log/messages`에는 경고가 남지 않는다. USB 버스 대역폭의 하드웨어 제약도 검사하지 않으므로 `b2`를 고르면 모든 인터페이스가 24비트/96kHz로 준비되더라도 한 번에 하나만 사용할 수 있다.
설정 비트가 추가로 요구하거나 암시하는 제약이다.
Technical details for hackers
-----------------------------
This section is for hackers, wanting to understand details about the device
internals and how Alsa supports it.
Audiophile USB's ``device_setup`` structure
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you want to understand the device_setup magic numbers for the Audiophile
USB, you need some very basic understanding of binary computation. However,
this is not required to use the parameter and you may skip this section.
The device_setup is one byte long and its structure is the following:
::
+---+---+---+---+---+---+---+---+
| b7| b6| b5| b4| b3| b2| b1| b0|
+---+---+---+---+---+---+---+---+
| 0 | 0 | 0 | Di|24B|96K|DTS|SET|
+---+---+---+---+---+---+---+---+
Where:
* b0 is the ``SET`` bit
- it MUST be set if device_setup is initialized
* b1 is the ``DTS`` bit
- it is set only for Digital output with DTS/AC3
- this setup is not tested
* b2 is the Rate selection flag
- When set to ``1`` the rate range is 48.1-96kHz
- Otherwise the sample rate range is 8-48kHz
* b3 is the bit depth selection flag
- When set to ``1`` samples are 24bits long
- Otherwise they are 16bits long
- Note that b2 implies b3 as the 96kHz mode is only supported for 24 bits
samples
* b4 is the Digital input flag
- When set to ``1`` the device assumes that an active digital source is
connected
- You shouldn't enable Di if no source is seen on the port (this leads to
synchronization issues)
- b4 is implied by b2 (since only one port is enabled at a time no synch
error can occur)
* b5 to b7 are reserved for future uses, and must be set to ``0``
- might become Ao, Do, Ai, for b7, b6, b4 respectively
Caution:
* there is no check on the value you will give to device_setup
- for instance choosing 0x05 (16bits 96kHz) will fail back to 0x09 since
b2 implies b3. But _there_will_be_no_warning_ in /var/log/messages
* Hardware constraints due to the USB bus limitation aren't checked
- choosing b2 will prepare all interfaces for 24bits/96kHz but you'll
only be able to use one at the same time
USB 인터페이스와 AltSetting 선택
385-476이 절은 Windows와 Linux 드라이버를 USB 스누핑해 얻은 장치 내부 정보를 요약한다. 관심 없는 사용자는 건너뛰어도 된다. M-Audio Audiophile USB에는 USB 인터페이스가 일곱 개 있다. 인터페이스 0의 기능은 원문에 따로 적혀 있지 않으며, 인터페이스 1은 Audio Control, 2는 Analog Output, 3은 Digital Output, 4는 Analog Input, 5는 Digital Input, 6은 MIDIMAN quirk와 호환되는 MIDI 인터페이스다.
각 인터페이스에는 AltSet 1~5의 다섯 altsetting이 있다. 예외로 인터페이스 3(Digital Out)은 AltSet 6이 하나 더 있고, 인터페이스 5(Digital In)에는 AltSet 3과 5가 없다.
원문의 번호와 기능을 그대로 대응시킨다.
표본 깊이·표본률과 스트림 동기화 방식의 조합이다.
장치를 올바르게 초기화하려면 드라이버가 사용 방식을 미리 알아야 한다. DTS를 고르면 원문 표현상 인터페이스 2의 AltSet 6만 등록해야 한다. 96kHz에서는 각 인터페이스의 AltSet 1만 선택한다. 24비트/48kHz에서는 Di 연결 시 AltSet 2, 미연결 시 AltSet 3만 사용한다. 16비트/48kHz에서는 Di 연결 시 AltSet 4, 미연결 시 AltSet 5만 사용한다.
`snd-usb-audio`에 `device_setup`을 전달하면 `parse_audio_endpoints` 함수는 `audiophile_skip_setting_quirk`라는 quirk를 사용해 설정과 맞지 않는 AltSetting이 드라이버에 등록되지 않게 한다.
표본 형식과 Di 연결 여부로 등록할 AltSetting을 제한한다.
USB implementation details for this device
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You may safely skip this section if you're not interested in driver
hacking.
This section describes some internal aspects of the device and summarizes the
data I got by usb-snooping the windows and Linux drivers.
The M-Audio Audiophile USB has 7 USB Interfaces:
a "USB interface":
* USB Interface nb.0
* USB Interface nb.1
- Audio Control function
* USB Interface nb.2
- Analog Output
* USB Interface nb.3
- Digital Output
* USB Interface nb.4
- Analog Input
* USB Interface nb.5
- Digital Input
* USB Interface nb.6
- MIDI interface compliant with the MIDIMAN quirk
Each interface has 5 altsettings (AltSet 1,2,3,4,5) except:
* Interface 3 (Digital Out) has an extra Alset nb.6
* Interface 5 (Digital In) does not have Alset nb.3 and 5
Here is a short description of the AltSettings capabilities:
* AltSettings 1 corresponds to
- 24-bit depth, 48.1-96kHz sample mode
- Adaptive playback (Ao and Do), Synch capture (Ai), or Asynch capture (Di)
* AltSettings 2 corresponds to
- 24-bit depth, 8-48kHz sample mode
- Asynch capture and playback (Ao,Ai,Do,Di)
* AltSettings 3 corresponds to
- 24-bit depth, 8-48kHz sample mode
- Synch capture (Ai) and Adaptive playback (Ao,Do)
* AltSettings 4 corresponds to
- 16-bit depth, 8-48kHz sample mode
- Asynch capture and playback (Ao,Ai,Do,Di)
* AltSettings 5 corresponds to
- 16-bit depth, 8-48kHz sample mode
- Synch capture (Ai) and Adaptive playback (Ao,Do)
* AltSettings 6 corresponds to
- 16-bit depth, 8-48kHz sample mode
- Synch playback (Do), audio format type III IEC1937_AC-3
In order to ensure a correct initialization of the device, the driver
*must* *know* how the device will be used:
* if DTS is chosen, only Interface 2 with AltSet nb.6 must be
registered
* if 96KHz only AltSets nb.1 of each interface must be selected
* if samples are using 24bits/48KHz then AltSet 2 must me used if
Digital input is connected, and only AltSet nb.3 if Digital input
is not connected
* if samples are using 16bits/48KHz then AltSet 4 must me used if
Digital input is connected, and only AltSet nb.5 if Digital input
is not connected
When device_setup is given as a parameter to the snd-usb-audio module, the
parse_audio_endpoints function uses a quirk called
``audiophile_skip_setting_quirk`` in order to prevent AltSettings not
corresponding to device_setup from being registered in the driver.
JACK 직접 지원과 ALSA plug 사용
477-520Audiophile USB를 JACK에서 쓸 때 핵심 문제는 24비트 모드의 빅 엔디언 장치 지원과 입력 4채널/출력 4채널 지원이다.
JACK의 빅 엔디언 장치 지원은 비교적 최근 버전에 들어갔다. Andreas Steinmetz가 최초의 빅 엔디언 패치를 제공했다. 정확한 도입 버전은 문서에 없지만 `jackd` 0.103.0에서는 거의 정상이며 16비트 빅 엔디언 장치에 작은 버그가 있다. 다만 커널 2.6.23 이상에서는 이 장치의 16비트 인터페이스가 리틀 엔디언으로 올바르게 보고된다.
Ao로 재생하고 Ai에서 녹음하려면 JACK을 다음과 같이 실행할 수 있다.
% jackd -R -dalsa -Phw:1,0 -r48000 -p128 -n2 -D -Chw:1,1
최신 JACK이 없다면 ALSA `plug` 변환기를 사용할 수 있다. Ao 재생 2채널과 Ai 캡처 2채널을 여는 예는 다음과 같다.
% jackd -R -dalsa -dplughw:1 -r48000 -p256 -n2 -D -Cplughw:1,1
이 방법은 ALSA 소프트웨어 `plug` 계층을 사용하므로 효율이 떨어질 수 있고, JACK은 기본 ALSA 장치 대신 하드웨어 장치를 고려하라는 경고를 표시할 수 있다.
직접 하드웨어 접근과 `plughw` 변환 경로의 차이다.
Audiophile USB and Jack support
===============================
This section deals with support of the Audiophile USB device in Jack.
There are 2 main potential issues when using Jackd with the device:
* support for Big-Endian devices in 24-bit modes
* support for 4-in / 4-out channels
Direct support in Jackd
-----------------------
Jack supports big endian devices only in recent versions (thanks to
Andreas Steinmetz for his first big-endian patch). I can't remember
exactly when this support was released into jackd, let's just say that
with jackd version 0.103.0 it's almost ok (just a small bug is affecting
16bits Big-Endian devices, but since you've read carefully the above
paragraphs, you're now using kernel >= 2.6.23 and your 16bits devices
are now Little Endians ;-) ).
You can run jackd with the following command for playback with Ao and
record with Ai:
::
% jackd -R -dalsa -Phw:1,0 -r48000 -p128 -n2 -D -Chw:1,1
Using Alsa plughw
-----------------
If you don't have a recent Jackd installed, you can downgrade to using
the Alsa ``plug`` converter.
For instance here is one way to run Jack with 2 playback channels on Ao and 2
capture channels from Ai:
::
% jackd -R -dalsa -dplughw:1 -r48000 -p256 -n2 -D -Cplughw:1,1
However you may see the following warning message:
You appear to be using the ALSA software "plug" layer, probably a result of
using the "default" ALSA device. This is less efficient than it could be.
Consider using a hardware device instead rather than using the plug layer.
JACK에서 여러 입출력 인터페이스 결합
521-550앞의 방식으로 JACK 서버를 시작하면 스테레오 입력 하나(Di 또는 Ai)와 스테레오 출력 하나(Ao 또는 Do)만 활성화된다. JACK은 한 번에 캡처 장치 하나와 재생 장치 하나만 열 수 있고, Audiophile USB는 `hw:1,0`, `hw:1,1`, 선택적으로 `hw:1,2`라는 둘 또는 세 개의 ALSA 장치로 보이기 때문이다.
JACK에서 Ai+Di 또는 Ao+Do를 지원하려면 여러 ALSA 장치를 하나의 논리적 복합 장치로 합쳐야 한다. 원문은 다른 장치인 ice1712용 `http://www.sound-man.co.uk/linuxaudio/ice1712multi.html`의 정보를 Audiophile USB에 맞게 적용해 보라고 권한다.
여러 인터페이스를 활성화하려면 JACK에 `MMAP_COMPLEX` 패치가 있는지 확인하고, 필요하다면 `alsa-lib/src/pcm/pcm_multi.c`를 패치해야 한다. 또한 `.asoundrc`에서 `hw:1,0`과 `hw:1,1`을 조합한 multi 장치를 정의하고 그 장치로 `jackd`를 시작해야 한다. 작성자는 이 구성을 성공적으로 시험하지 못했으며, 성공 사례를 이메일로 알려 달라고 요청한다.
분리된 ALSA PCM 장치를 한 논리 장치로 결합하는 절차다.
Getting 2 input and/or output interfaces in Jack
------------------------------------------------
As you can see, starting the Jack server this way will only enable 1 stereo
input (Di or Ai) and 1 stereo output (Ao or Do).
This is due to the following restrictions:
* Jack can only open one capture device and one playback device at a time
* The Audiophile USB is seen as 2 (or three) Alsa devices: hw:1,0, hw:1,1
(and optionally hw:1,2)
If you want to get Ai+Di and/or Ao+Do support with Jack, you would need to
combine the Alsa devices into one logical "complex" device.
If you want to give it a try, I recommend reading the information from
this page: http://www.sound-man.co.uk/linuxaudio/ice1712multi.html
It is related to another device (ice1712) but can be adapted to suit
the Audiophile USB.
Enabling multiple Audiophile USB interfaces for Jackd will certainly require:
* Making sure your Jackd version has the MMAP_COMPLEX patch (see the ice1712 page)
* (maybe) patching the alsa-lib/src/pcm/pcm_multi.c file (see the ice1712 page)
* define a multi device (combination of hw:1,0 and hw:1,1) in your .asoundrc
file
* start jackd with this device
I had no success in testing this for now, if you have any success with this kind
of setup, please drop me an email.
요약·해설
audiophile-usb.rst:1-550M-Audio Audiophile USB의 ALSA·JACK 사용법을 장치 포트, USB 1.1 대역폭별 동시 채널, `snd-usb-audio`의 `device_setup` 모드와 비트 구조, 엔디언 처리, USB AltSetting, JACK 다중 장치 구성까지 원문 줄 좌표에 맞춰 설명합니다.