usb 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. .TH USB 4
  2. .SH NAME
  3. usbmouse,
  4. usbaudio,
  5. usbprinter
  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/usbprinter
  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. .PP
  113. The file
  114. .B audioctl
  115. provides more information, using up to 6 columns of 12 characters each.
  116. From left to right, the fields are:
  117. .IR "control name" ,
  118. .I in
  119. or
  120. .IR out ,
  121. .IR "current value" ,
  122. .IR "minimum value" ,
  123. .IR maximum ,
  124. and
  125. .IR resolution .
  126. There are 3, 5, or 6 columns present.
  127. Maxima and resolution are omitted when they are not available or not applicable.
  128. The resolution for
  129. .I speed
  130. is reported as 1 (one) if the sampling frequency is continuously variable. It is absent
  131. if it is settable at a fixed number of discrete values only.
  132. .PP
  133. When all values from
  134. .B audioctl
  135. have been read, a zero-sized buffer is returned (the usual end-of-file indication).
  136. A new read will then block until one of the settings changes and then report its new value.
  137. .PP
  138. The file
  139. .B audioctl
  140. can be written like
  141. .BR volume .
  142. .PP
  143. Audio data is written to
  144. .B audio
  145. and read from
  146. .BR audioin .
  147. The data format is little endian, samples ordered primarily by time and
  148. secondarily by channel. Samples occupy the minimum integral number
  149. of bytes. Read and write operations of arbitrary size are allowed.
  150. .SS Printers
  151. .I Usbprinter
  152. is a script that mounts a usb printer on
  153. .BR /dev/lp .
  154. .SH EXAMPLE
  155. .LP
  156. To use a USB mouse and audio device, put the following in your profile
  157. (replace x by your favorite initial volume setting):
  158. .IP
  159. .EX
  160. .ta 6n
  161. if (test -r '#U'/usb0) {
  162. usb/usbd
  163. usb/usbmouse -a 2
  164. usb/usbaudio -v x
  165. usb/usbprint
  166. }
  167. .EE
  168. .PP
  169. Alternatively, just put
  170. .B usbstart
  171. in your profile.
  172. .SH SOURCE
  173. .B /sys/src/cmd/usb
  174. .SH "SEE ALSO"
  175. .IR usb (3),
  176. .IR usbd (4)
  177. .SH BUGS
  178. Usbaudio only works for certain audio devices. This is the list of devices known to work with usbaudio:
  179. .IP
  180. .RS
  181. .TP
  182. Xitel AN1
  183. Output only. Marginally enough to drive headphones. Has mute, volume, bass, treble controls.
  184. .TP
  185. Philips USB speakers, model DSS 370/17
  186. Usbaudio acts on the volume + and - buttons.
  187. .TP
  188. Edirol UA-3
  189. Playback and record. Playback only at 44.1 KHz, record at 32, 44.1 or 48 KHz.
  190. Playback volume control and mute control. The device only has analog (slider controlled)
  191. input volume control.
  192. .TP
  193. Edirol UA-1X
  194. Playback and record. Playback only at 32, 44.1 or 48 KHz, record at 8, 16, 22.05, 32, 44.1 or 48 KHz.
  195. Playback volume control and mute control.
  196. (haven't tested recording, but I believe it'll work)
  197. .TP
  198. Xitel Pro HiFi-Link
  199. Playback only. 48 KHz only. There is a volume control but it isn't connected
  200. to the output, so does nothing.
  201. .TP
  202. Onkyo WAVIO series MA-500U
  203. Includes three optical digital interfaces, two analog, and an
  204. amplifier (15W + 15W).
  205. .TP
  206. Turtle Beach Audio Advantage micro
  207. Headset and S/Pdif out, volume and mute controls.
  208. .RE