usb 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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 \-s
  11. ] [
  12. [
  13. .B \-f
  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. .B Usbmouse
  46. sends mouse events from a USB mouse to
  47. .B #m/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.
  53. .PP
  54. The
  55. .B \-s
  56. flag enables scroll-wheel or scroll-button, if present.
  57. .PP
  58. The
  59. .B \-f
  60. flag runs
  61. .B usbmouse
  62. in the foreground.
  63. .SS Audio devices
  64. .B Usbaudio
  65. configures and manages a usb audio device. It implements a file system,
  66. normally mounted in
  67. .BI /dev ,
  68. but this can be changed with the
  69. .B \-m
  70. flag, with files
  71. .IR /volume ,
  72. .IR /audioctl ,
  73. .IR /audio ,
  74. and
  75. .IR /audioin .
  76. The names
  77. .I /volume
  78. and
  79. .I /audio
  80. maintain backward compatibility with the soundblaster driver.
  81. .PP
  82. The
  83. .B \-V
  84. flag (verbose) causes usbaudio to print information about the device on startup.
  85. .PP
  86. The
  87. .B \-s
  88. flag specifies a name for a file descriptor to be posted in
  89. .CW /srv .
  90. .PP
  91. Reading
  92. .I /volume
  93. or
  94. .I /audioctl
  95. yields the device's settings. The data format of
  96. .I /volume
  97. is compatible with the soundblaster and
  98. produces something like
  99. .PP
  100. .EX
  101. audio out 65
  102. treb out 0
  103. bass out 0
  104. speed out 44100
  105. .EE
  106. .PP
  107. This file can be written using the same syntax. The keyword
  108. .I out
  109. may be omitted. Settings are given as percentages of the range.
  110. .PP
  111. The file
  112. .I /audioctl
  113. provides more information, using up to 6 columns of 12 characters each.
  114. From left to right, the fields are:
  115. .IR "control name" ,
  116. .I in
  117. or
  118. .IR out ,
  119. .IR "current value" ,
  120. .IR "minimum value" ,
  121. .IR maximum ,
  122. and
  123. .IR resolution .
  124. There are 3, 5, or 6 columns present.
  125. Maxima and resolution are omitted when they are not available or not applicable.
  126. The resolution for
  127. .I speed
  128. is reported as 1 (one) if the sampling frequency is continuously variable. It is absent
  129. if it is settable at a fixed number of discrete values only.
  130. .PP
  131. When all values from
  132. .I /audioctl
  133. have been read, a zero-sized buffer is returned (the usual end-of-file indication).
  134. A new read will then block until one of the settings changes and then report its new value.
  135. .PP
  136. The file
  137. .I /audioctl
  138. can be written like
  139. .IR /volume .
  140. .PP
  141. Audio data is written to
  142. .I /audio
  143. and read from
  144. .IR /audioin .
  145. The data format is little endian, samples ordered primarily by time and
  146. secondarily by channel. Samples occupy the minimum integral number
  147. of bytes. Read and write operations of arbitrary size are allowed.
  148. .SS Printers
  149. .B Usbprinter
  150. is a script that mounts a usb printer on
  151. .BR /n/lp .
  152. .SH EXAMPLE
  153. .LP
  154. To use a USB mouse and audio device, put the following in your profile
  155. (replace x by your favorite initial volume setting):
  156. .PP
  157. .EX
  158. .ta 6n
  159. if (test -r '#U'/usb0) {
  160. usb/usbd
  161. usb/usbmouse -a 2
  162. usb/usbaudio -v x
  163. }
  164. .EE
  165. .PP
  166. Alternatively, just put
  167. .B usbstart
  168. in your profile.
  169. .SH SOURCE
  170. .B /sys/src/cmd/usb
  171. .SH "SEE ALSO"
  172. .IR usb (3),
  173. .IR usbd (4)