usb 4.6 KB

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