⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 audiophile-usb.txt

📁 linux 内核源代码
💻 TXT
📖 第 1 页 / 共 2 页
字号:
	Guide to using M-Audio Audiophile USB with ALSA and Jack	v1.5	========================================================	    Thibault Le Meur <Thibault.LeMeur@supelec.fr>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 <Hakan.Lennestal@brfsodrahamn.se> - Modifying document structure* v1.5 - Thibault Le Meur (2007-07-12) - Added AC3/DTS passthru info1 - 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 DoImportant 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)2 - Audiophile USB MIDI support in ALSA=======================================The Audiophile USB MIDI ports will be automatically supported once thefollowing modules have been loaded: * snd-usb-audio * snd-seq-midiNo additional setting is required.3 - 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".3.1 - 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 towork: under windows applications must be closed before using the m-audio controlpanel 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 modeIn 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.rawIf 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.3.2 - 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 highvolume gain).For people having this problem, the snd-usb-audio module has a new module parameter called "device_setup" (this parameter was introduced in kernelrelease 2.6.17)3.2.1 - Initializing the working mode of the Audiophile USBAs 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 hasthe same behaviour as when the parameter is omitted (see paragraph "Default Alsa driver mode" above)Others modes are described in the following subsections.3.2.1.1 - 16-bit modesThe 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 availableIn 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-Endianso that playing a file was a matter of using:   % aplay -D hw:1,1 -c2 -t raw -r48000 -fS16_BE test_S16_LE.rawwhere "test_S16_LE.raw" was in fact a little-endian sample file.Thanks to Hakan Lennestal (who discovered the Little-Endiannes of the device inthese modes) a fix has been committed (expected in kernel 2.6.23) andAlsa now reports Little-Endian interfaces. Thus playing a file now is as simple asusing:   % aplay -D hw:1,1 -c2 -t raw -r48000 -fS16_LE test_S16_LE.raw3.2.1.2 - 24-bit modesThe 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 availableIn these modes the device is only Big-Endian compliant (see "Default Alsa driver mode" above for an aplay command example)3.2.1.3 - AC3 w/ DTS passthru modeThanks 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,0The command line used to playback the AC3/DTS encoded .wav-files in this mode:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -