1 enum { 2 master_chan = 0x00, 3 Speed_control = 0x00, 4 /* Items below are defined by USB standard: */ 5 Mute_control = 0x01, 6 Volume_control = 0x02, 7 Bass_control = 0x03, 8 Mid_control = 0x04, 9 Treble_control = 0x05, 10 Equalizer_control = 0x06, 11 Agc_control = 0x07, 12 Delay_control = 0x08, 13 Bassboost_control = 0x09, 14 Loudness_control = 0x0a, 15 /* Items below are defined by implementation: */ 16 Channel_control = 0x0b, 17 Resolution_control = 0x0c, 18 Ncontrol, 19 Selector_control = 0x0d, 20 21 sampling_freq_control = 0x01, 22 23 Audiocsp = 0x000101, /* audio.control.0 */ 24 25 AUDIO_INTERFACE = 0x24, 26 AUDIO_ENDPOINT = 0x25, 27 }; 28 29 30 #define AS_GENERAL 1 31 #define FORMAT_TYPE 2 32 #define FORMAT_SPECIFIC 3 33 34 #define PCM 1 35 #define PCM8 2 36 #define IEEE_FLOAT 3 37 #define ALAW 4 38 #define MULAW 5 39 40 #define SAMPLING_FREQ_CONTROL 0x01 41 42 typedef struct Audioalt Audioalt; 43 44 struct Audioalt { 45 int nchan; 46 int res; 47 int subframesize; 48 int minfreq, maxfreq; /* continuous freqs */ 49 int freqs[8]; /* discrete freqs */ 50 int caps; /* see below for meanings */ 51 }; 52 53 enum { 54 /* Audioalt->caps bits */ 55 has_setspeed = 0x1, /* has a speed_set command */ 56 has_pitchset = 0x2, /* has a pitch_set command */ 57 has_contfreq = 0x4, /* frequency continuously variable */ 58 has_discfreq = 0x8, /* discrete set of frequencies */ 59 onefreq = 0x10, /* only one frequency */ 60 maxpkt_only = 0x80, /* packets must be padded to max size */ 61 }; 62 63 typedef uchar byte; 64 65 extern int setrec; 66 extern int verbose; 67 extern int defaultspeed[2]; 68 extern Dev *ad; 69 extern Dev *buttondev; 70 extern Channel *controlchan; 71 extern Dev *epdev[2]; 72 73 void audio_interface(Dev *d, Desc *dd); 74 void setalt(Dev *d, int endpt, int value); 75 int getalt(Dev *d, int endpt); 76 int setspeed(int rec, int speed); 77 int setcontrol(int rec, char *name, long *value); 78 int getspecialcontrol(int rec, int ctl, int req, long *value); 79 int getcontrol(int rec, char *name, long *value); 80 int findalt(int rec, int nchan, int res, int speed); 81 void getcontrols(void); 82 void serve(void *); 83 int nbchanprint(Channel *c, char *fmt, ...); 84 int Aconv(Fmt *fp); 85