lolo258 wrote:
我從一年前開始用高清...(恕刪)
linux USB audio driver早就有了,超過10年啦!!
MMP是個半封閉系統,是需要再出廠時就要將USB audio driver放在Flash ROM,
才能支援對應地裝置.
詳細資料請參照聯結
http://enpc3240.eas.asu.edu/lxr/linux/http/source/drivers/usb/audio.c
1 /*****************************************************************************/
2
3 /*
4 * audio.c -- USB Audio Class driver
5 *
6 * Copyright (C) 1999, 2000
7 * Alan Cox (alan@lxorguk.ukuu.org.uk)
8 * Thomas Sailer (sailer@ife.ee.ethz.ch)
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 *
16 * 1999-09-07: Alan Cox
17 * Parsing Audio descriptor patch
18 * 1999-09-08: Thomas Sailer
19 * Added OSS compatible data io functions; both parts of the
20 * driver remain to be glued together
21 * 1999-09-10: Thomas Sailer
22 * Beautified the driver. Added sample format conversions.
23 * Still not properly glued with the parsing code.
24 * The parsing code seems to have its problems btw,
25 * Since it parses all available configs but doesn't
26 * store which iface/altsetting belongs to which config.
27 * 1999-09-20: Thomas Sailer
28 * Threw out Alan's parsing code and implemented my own one.
29 * You cannot reasonnably linearly parse audio descriptors,
30 * especially the AudioClass descriptors have to be considered
31 * pointer lists. Mixer parsing untested, due to lack of device.
32 * First stab at synch pipe implementation, the Dallas USB DAC
33 * wants to use an Asynch out pipe. usb_audio_state now basically
34 * only contains lists of mixer and wave devices. We can therefore
35 * now have multiple mixer/wave devices per USB device.
36 * 1999-10-28: Thomas Sailer
37 * Converted to URB API. Fixed a taskstate/wakeup semantics mistake
38 * that made the driver consume all available CPU cycles.
39 * Now runs stable on UHCI-Acher/Fliegl/Sailer.
40 * 1999-10-31: Thomas Sailer
41 * Audio can now be unloaded if it is not in use by any mixer
42 * or dsp client (formerly you had to disconnect the audio devices
43 * from the USB port)
44 * Finally, about three months after ordering, my "Maxxtro SPK222"
45 * speakers arrived, isn't disdata a great mail order company 8-)
46 * Parse class specific endpoint descriptor of the audiostreaming
47 * interfaces and take the endpoint attributes from there.
48 * Unbelievably, the Philips USB DAC has a sampling rate range
49 * of over a decade, yet does not support the sampling rate control!
50 * No wonder it sounds so bad, has very audible sampling rate
51 * conversion distortion. Don't try to listen to it using
52 * decent headphones!
53 * "Let's make things better" -> but please Philips start with your
54 * own stuff!!!!
55 * 1999-11-02: Thomas Sailer
56 * It takes the Philips boxes several seconds to acquire synchronisation
57 * that means they won't play short sounds. Should probably maintain
58 * the ISO datastream even if there's nothing to play.
59 * Fix counting the total_bytes counter, RealPlayer G2 depends on it.
60 * 1999-12-20: Thomas Sailer
61 * Fix bad bug in conversion to per interface probing.
62 * disconnect was called multiple times for the audio device,
63 * leading to a premature freeing of the audio structures
64 * 2000-05-13: Thomas Sailer
65 * I don't remember who changed the find_format routine,
66 * but the change was completely broken for the Dallas
67 * chip. Anyway taking sampling rate into account in find_format
68 * is bad and should not be done unless there are devices with
69 * completely broken audio descriptors. Unless someone shows
70 * me such a descriptor, I will not allow find_format to
71 * take the sampling rate into account.
72 * Also, the former find_format made:
73 * - mpg123 play mono instead of stereo
74 * - sox completely fail for wav's with sample rates < 44.1kHz
75 * for the Dallas chip.
76 * Also fix a rather long standing problem with applications that
77 * use "small" writes producing no sound at all.
78 * 2000-05-15: Thomas Sailer
79 * My fears came true, the Philips camera indeed has pretty stupid
80 * audio descriptors.
81 * 2000-05-17: Thomas Sailer
82 * Nemsoft spotted my stupid last minute change, thanks
83 * 2000-05-19: Thomas Sailer
84 * Fixed FEATURE_UNIT thinkos found thanks to the KC Technology
85 * Xtend device. Basically the driver treated FEATURE_UNIT's sourced
86 * by mono terminals as stereo.
87 * 2000-05-20: Thomas Sailer
88 * SELECTOR support (and thus selecting record channels from the mixer).
89 * Somewhat peculiar due to OSS interface limitations. Only works
90 * for channels where a "slider" is already in front of it (i.e.
91 * a MIXER unit or a FEATURE unit with volume capability).
92 * 2000-11-26: Thomas Sailer
93 * Workaround for Dallas DS4201. The DS4201 uses PCM8 as format tag for
94 * its 8 bit modes, but expects signed data (and should therefore have used PCM).
95 *
96 */




























































































