?? audiophile-usb.txt
字號:
% aplay -D hw:1,0 --channels=6 ac3_S16_LE_encoded_file.raw3.2.2 - 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 - For Fedora distributions, edit the /etc/modprobe.conf file: alias snd-card-1 snd-usb-audio options snd-usb-audio index=1 device_setup=0x09CAUTION when initializaing 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 in a misconfiguration of the device. In this case turn off the device, unproble 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.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.3.2.3 - Technical details for hackers-------------------------------------This section is for hackers, wanting to understand details about the deviceinternals and how Alsa supports it.3.2.3.1 - Audiophile USB's device_setup structureIf 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 respectivelyCaution: * 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 time3.2.3.2 - USB implementation details for this deviceYou 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-3In 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 connectedWhen 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.4 - 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 channels4.1 - Direct support in Jackd-----------------------------Jack supports big endian devices only in recent versions (thanks toAndreas Steinmetz for his first big-endian patch). I can't remember extacly 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 andrecord with Ai: % jackd -R -dalsa -Phw:1,0 -r48000 -p128 -n2 -D -Chw:1,14.2 - Using Alsa plughw-----------------------If you don't have a recent Jackd installed, you can downgrade to usingthe 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,1However 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."4.3 - Getting 2 input and/or output interfaces in Jack------------------------------------------------------As you can see, starting the Jack server this way will only enable 1 stereoinput (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 tocombine the Alsa devices into one logical "complex" device.If you want to give it a try, I recommend reading the information fromthis page: http://www.sound-man.co.uk/linuxaudio/ice1712multi.htmlIt is related to another device (ice1712) but can be adapted to suitthe 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 deviceI had no success in testing this for now, if you have any success with this kind of setup, please drop me an email.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -