diff options
-rw-r--r-- | Documentation/sound/alsa/Audiophile-Usb.txt | 22 | ||||
-rw-r--r-- | sound/usb/usbaudio.c | 13 |
2 files changed, 28 insertions, 7 deletions
diff --git a/Documentation/sound/alsa/Audiophile-Usb.txt b/Documentation/sound/alsa/Audiophile-Usb.txt index 5b7a5487d505..2ad5e6306c44 100644 --- a/Documentation/sound/alsa/Audiophile-Usb.txt +++ b/Documentation/sound/alsa/Audiophile-Usb.txt | |||
@@ -1,4 +1,4 @@ | |||
1 | Guide to using M-Audio Audiophile USB with ALSA and Jack v1.4 | 1 | Guide to using M-Audio Audiophile USB with ALSA and Jack v1.5 |
2 | ======================================================== | 2 | ======================================================== |
3 | 3 | ||
4 | Thibault Le Meur <Thibault.LeMeur@supelec.fr> | 4 | Thibault Le Meur <Thibault.LeMeur@supelec.fr> |
@@ -12,6 +12,8 @@ History | |||
12 | - Added Low Endianness nature of 16bits-modes | 12 | - Added Low Endianness nature of 16bits-modes |
13 | found by Hakan Lennestal <Hakan.Lennestal@brfsodrahamn.se> | 13 | found by Hakan Lennestal <Hakan.Lennestal@brfsodrahamn.se> |
14 | - Modifying document structure | 14 | - Modifying document structure |
15 | * v1.5 - Thibault Le Meur (2007-07-12) | ||
16 | - Added AC3/DTS passthru info | ||
15 | 17 | ||
16 | 18 | ||
17 | 1 - Audiophile USB Specs and correct usage | 19 | 1 - Audiophile USB Specs and correct usage |
@@ -105,9 +107,12 @@ way (I suppose the device's index is 1): | |||
105 | 107 | ||
106 | In this mode, the device uses Big Endian byte-encoding so that | 108 | In this mode, the device uses Big Endian byte-encoding so that |
107 | supported audio format are S16_BE for 16-bit depth modes and S24_3BE for | 109 | supported audio format are S16_BE for 16-bit depth modes and S24_3BE for |
108 | 24-bits depth mode. One exception is the hw:1,2 port which is reported | 110 | 24-bits depth mode. |
109 | to be Little Endian compliant (supposedly supporting S16_LE) but processes | 111 | |
110 | in fact only S16_BE streams. | 112 | One exception is the hw:1,2 port which was reported to be Little Endian |
113 | compliant (supposedly supporting S16_LE) but processes in fact only S16_BE streams. | ||
114 | This has been fixed in kernel 2.6.23 and above and now the hw:1,2 interface | ||
115 | is reported to be big endian in this default driver mode. | ||
111 | 116 | ||
112 | Examples: | 117 | Examples: |
113 | * playing a S24_3BE encoded raw file to the Ao port | 118 | * playing a S24_3BE encoded raw file to the Ao port |
@@ -116,6 +121,8 @@ Examples: | |||
116 | % arecord -D hw:1,1 -c2 -t raw -r48000 -fS24_3BE test.raw | 121 | % arecord -D hw:1,1 -c2 -t raw -r48000 -fS24_3BE test.raw |
117 | * playing a S16_BE encoded raw file to the Do port | 122 | * playing a S16_BE encoded raw file to the Do port |
118 | % aplay -D hw:1,1 -c2 -t raw -r48000 -fS16_BE test.raw | 123 | % aplay -D hw:1,1 -c2 -t raw -r48000 -fS16_BE test.raw |
124 | * playing an ac3 sample file to the Do port | ||
125 | % aplay -D hw:1,2 --channels=6 ac3_S16_BE_encoded_file.raw | ||
119 | 126 | ||
120 | If you're happy with the default Alsa driver mode and don't experience any | 127 | If you're happy with the default Alsa driver mode and don't experience any |
121 | issue with this mode, then you can skip the following chapter. | 128 | issue with this mode, then you can skip the following chapter. |
@@ -205,13 +212,16 @@ mode" above for an aplay command example) | |||
205 | 212 | ||
206 | 3.2.1.3 - AC3 w/ DTS passthru mode | 213 | 3.2.1.3 - AC3 w/ DTS passthru mode |
207 | 214 | ||
208 | This mode is untested, I have no AC3 compliant device to test it. I uses: | 215 | Thanks to Hakan Lennestal, I now have a report saying that this mode works. |
209 | 216 | ||
210 | * device_setup=0x03 | 217 | * device_setup=0x03 |
211 | - 16bits 48kHz mode with only the Do port enabled | 218 | - 16bits 48kHz mode with only the Do port enabled |
212 | - AC3 with DTS passthru (not tested) | 219 | - AC3 with DTS passthru |
213 | - Caution with this setup the Do port is mapped to the pcm device hw:1,0 | 220 | - Caution with this setup the Do port is mapped to the pcm device hw:1,0 |
214 | 221 | ||
222 | The command line used to playback the AC3/DTS encoded .wav-files in this mode: | ||
223 | % aplay -D hw:1,0 --channels=6 ac3_S16_LE_encoded_file.raw | ||
224 | |||
215 | 3.2.2 - How to use the device_setup parameter | 225 | 3.2.2 - How to use the device_setup parameter |
216 | ---------------------------------------------- | 226 | ---------------------------------------------- |
217 | 227 | ||
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index 834b0aff5ec1..7bd5852fcc0d 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c | |||
@@ -2532,7 +2532,18 @@ static int parse_audio_format_i(struct snd_usb_audio *chip, struct audioformat * | |||
2532 | * but we give normal PCM format to get the existing | 2532 | * but we give normal PCM format to get the existing |
2533 | * apps working... | 2533 | * apps working... |
2534 | */ | 2534 | */ |
2535 | pcm_format = SNDRV_PCM_FORMAT_S16_LE; | 2535 | switch (chip->usb_id) { |
2536 | |||
2537 | case USB_ID(0x0763, 0x2003): /* M-Audio Audiophile USB */ | ||
2538 | if (device_setup[chip->index] == 0x00 && | ||
2539 | fp->altsetting == 6) | ||
2540 | pcm_format = SNDRV_PCM_FORMAT_S16_BE; | ||
2541 | else | ||
2542 | pcm_format = SNDRV_PCM_FORMAT_S16_LE; | ||
2543 | break; | ||
2544 | default: | ||
2545 | pcm_format = SNDRV_PCM_FORMAT_S16_LE; | ||
2546 | } | ||
2536 | } else { | 2547 | } else { |
2537 | pcm_format = parse_audio_format_i_type(chip, fp, format, fmt); | 2548 | pcm_format = parse_audio_format_i_type(chip, fp, format, fmt); |
2538 | if (pcm_format < 0) | 2549 | if (pcm_format < 0) |