usb 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. .TH USB 4
  2. .SH NAME
  3. usbmouse,
  4. kb,
  5. usbaudio,
  6. print
  7. \- Universal Serial Bus user-level device drivers
  8. .SH SYNOPSIS
  9. .B usb/usbmouse
  10. [
  11. .B -fsv
  12. ] [
  13. .B -a
  14. .I accel
  15. ] [
  16. .I ctrlno
  17. .I n
  18. ]
  19. .PP
  20. .B usb/kb
  21. [
  22. .B -dkmn
  23. ] [
  24. .B -a
  25. .I n
  26. ] [
  27. .I ctlrno
  28. .I n
  29. ]
  30. .PP
  31. .B usb/usbaudio
  32. [
  33. .B -pV
  34. ] [
  35. .B -m
  36. .I mountpoint
  37. ] [
  38. .B -s
  39. .I srvname
  40. ] [
  41. .B -v
  42. .I volume
  43. ] [
  44. .I ctrlno
  45. .I n
  46. ]
  47. .PP
  48. .B usb/print
  49. .SH DESCRIPTION
  50. These programs implement support for specific USB device classes.
  51. They should be run after
  52. .IR usbd (4)
  53. has had a chance to locate the devices in question and provide
  54. them with device addresses and minimal configuration.
  55. Dynamic handling of device insertion and removal is currently not supported.
  56. .SS Mice
  57. .I Usbmouse
  58. sends mouse events from a USB mouse to
  59. .B /dev/mousein
  60. where the Plan 9 kernel processes them like other mice, but see
  61. .I kb
  62. below.
  63. .PP
  64. Without arguments, it scans the USB status files to find a mouse
  65. and uses the first one it finds. A pair of numeric arguments overrides this search
  66. with a specific USB controller and device. The options are
  67. .TF "-a ac"
  68. .TP
  69. .BI -a " accel"
  70. Accelerate mouse movements.
  71. .TP
  72. .BI -f
  73. Run usbmouse in foreground.
  74. .TP
  75. .BI -s
  76. Use the scrollwheel.
  77. .TP
  78. .BI -v
  79. Verbose mode.
  80. .SS Keyboards and mice
  81. .I Kb
  82. supports USB keyboards and mice either as separate USB devices
  83. or as a single combined USB device. Scan codes from the keyboard
  84. are sent to
  85. .B /dev/kbin
  86. to let the kernel process them.
  87. Mouse events are sent to
  88. .B /dev/mousein
  89. in the same way.
  90. .PP
  91. Without arguments it handles the keyboard and mouse devices found
  92. on the bus.
  93. Otherwise it uses the one attached to controller
  94. .I ctrlno
  95. with device number
  96. .IR n .
  97. The following options are understood:
  98. .TF -k
  99. .TP
  100. .B \-a
  101. Accelerate the mouse to level
  102. .I n
  103. (similar to the kernel mouse driver acceleration).
  104. .TP
  105. .B \-d
  106. Activate debug diagnostics. Repeating the flag one or more times
  107. increases the verbosity.
  108. .TP
  109. .B \-k
  110. Serve just the keyboard (and not the mouse).
  111. .TP
  112. .B \-m
  113. Serve just the mouse (and not the keyboard).
  114. .TP
  115. .B \-n
  116. Dry run. Do not send any events to the kernel for processing.
  117. .SS Printers
  118. .I Print
  119. is a script that mounts a USB printer on
  120. .BR /dev/lp .
  121. .SS Audio devices
  122. .I Usbaudio
  123. configures and manages a USB audio device. It implements a file system,
  124. normally mounted on
  125. .BI /dev ,
  126. but this can be changed with the
  127. .B \-m
  128. option, with files
  129. .BR volume ,
  130. .BR audioctl ,
  131. .BR audio ,
  132. and
  133. .BR audioin .
  134. The names
  135. .B volume
  136. and
  137. .B audio
  138. maintain backward compatibility with the soundblaster driver.
  139. .PP
  140. The
  141. .B \-V
  142. option (verbose) causes usbaudio to print information about the device on startup.
  143. The
  144. .B \-s
  145. option specifies a name for a file descriptor to be posted in
  146. .BR /srv .
  147. The
  148. .B \-v
  149. options sets initial
  150. .IR volume .
  151. .PP
  152. Reading
  153. .B volume
  154. or
  155. .B audioctl
  156. yields the device's settings. The data format of
  157. .B volume
  158. is compatible with the soundblaster and
  159. produces something like
  160. .IP
  161. .EX
  162. audio out 65
  163. treb out 0
  164. bass out 0
  165. speed out 44100
  166. .EE
  167. .PP
  168. This file can be written using the same syntax. The keyword
  169. .I out
  170. may be omitted. Settings are given as percentages of the range,
  171. except for speed which is in Hz.
  172. .PP
  173. The file
  174. .B audioctl
  175. provides more information, using up to 6 columns of 12 characters each.
  176. From left to right, the fields are:
  177. .IR "control name" ,
  178. .I in
  179. or
  180. .IR out ,
  181. .IR "current value" ,
  182. .IR "minimum value" ,
  183. .IR maximum ,
  184. and
  185. .IR resolution .
  186. There are 3, 5, or 6 columns present.
  187. Maxima and resolution are omitted when they are not available or not applicable.
  188. The resolution for
  189. .I speed
  190. is reported as 1 (one) if the sampling frequency is continuously variable. It is absent
  191. if it is settable at a fixed number of discrete values only.
  192. .PP
  193. When all values from
  194. .B audioctl
  195. have been read, a zero-sized buffer is returned (the usual end-of-file indication).
  196. A new read will then block until one of the settings changes and then report its new value.
  197. .PP
  198. The file
  199. .B audioctl
  200. can be written like
  201. .BR volume .
  202. .PP
  203. Audio data is written to
  204. .B audio
  205. and read from
  206. .BR audioin .
  207. The data format is little endian, samples ordered primarily by time and
  208. secondarily by channel. Samples occupy the minimum integral number
  209. of bytes. Read and write operations of arbitrary size are allowed.
  210. .SH EXAMPLE
  211. To use a USB mouse and audio device, put the following in your profile
  212. (replace
  213. .I x
  214. with your favorite initial volume setting):
  215. .IP
  216. .EX
  217. .ta 6n
  218. if (test -r '#U'/usb0) {
  219. usb/usbd
  220. usb/usbmouse -a 2
  221. usb/usbaudio -v \fIx\fP
  222. usb/print
  223. }
  224. .EE
  225. .PP
  226. Alternatively, just put
  227. .B usbstart
  228. in your profile.
  229. .SH SOURCE
  230. .B /sys/src/cmd/usb
  231. .SH "SEE ALSO"
  232. .IR usb (3),
  233. .IR usbd (4),
  234. .IR usbdisk (4)
  235. .SH BUGS
  236. .I Usbaudio
  237. only works for certain audio devices.
  238. This is the list of devices known to work with
  239. .IR usbaudio :
  240. .IP "" 3
  241. .RS
  242. .TF "Edirol U"
  243. .TP
  244. Xitel AN1
  245. Output only.
  246. Marginally enough to drive headphones.
  247. Has mute, volume, bass, treble controls.
  248. .TP
  249. Philips USB speakers, model DSS 370/17
  250. .I Usbaudio
  251. acts on the volume
  252. .L +
  253. and
  254. .L -
  255. buttons.
  256. .TP
  257. Edirol UA-3
  258. Playback and record.
  259. Playback only at 44.1 KHz, record at 32, 44.1 or 48 KHz.
  260. Playback volume control and mute control.
  261. The device only has analog (slider controlled)
  262. input volume control.
  263. .TP
  264. Edirol UA-1X
  265. Playback and record.
  266. Playback only at 32, 44.1 or 48 KHz, record at 8, 16, 22.05, 32, 44.1 or 48 KHz.
  267. Playback volume control and mute control
  268. (haven't tested recording, but I believe it'll work).
  269. .TP
  270. Xitel Pro HiFi-Link
  271. Playback only.
  272. 48 KHz only.
  273. There is a volume control but it isn't connected to the output, so does nothing.
  274. .TP
  275. Onkyo WAVIO series MA-500U
  276. Includes three optical digital interfaces, two analog, and an
  277. amplifier (15W + 15W).
  278. .TP
  279. Turtle Beach Audio Advantage micro
  280. Headset and S/Pdif out, volume and mute controls.
  281. .RE