usb 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. .TH USB 4
  2. .SH NAME
  3. usbmouse,
  4. usbaudio
  5. \- Universal Serial Bus user level device drivers
  6. .SH SYNOPSIS
  7. .B usb/usbmouse
  8. [
  9. .B -f
  10. ] [
  11. .I ctrlno
  12. .I n
  13. ]
  14. .PP
  15. .B usb/usbaudio
  16. [
  17. .B -d
  18. ] [
  19. .B -v
  20. .I volume
  21. ] [
  22. .B -m
  23. .I mountpoint
  24. ] [
  25. .B -s
  26. .I srvname
  27. ] [
  28. .I ctrlno
  29. .I n
  30. ]
  31. .PP
  32. .B usbstart
  33. .SH DESCRIPTION
  34. These programs implement support for specific USB device classes.
  35. They should be run after
  36. .IR usbd (4)
  37. has had a chance to locate the devices in question and provide
  38. them with device addresses and minimal configuration.
  39. Dynamic handling of device insertion and removal is currently not supported.
  40. .PP
  41. The script
  42. .B usbstart
  43. checks whether a USB driver is present, and if so, starts usbd
  44. followed by the support programs listed below.
  45. .SS Mice
  46. .B Usbmouse
  47. sends mouse events from a USB mouse to
  48. .B #m/mousein
  49. where the Plan 9 kernel processes them like other mice.
  50. .PP
  51. Without arguments, it scans the USB status files to find a mouse
  52. and uses the first one it finds. A pair of numeric arguments overrides this search
  53. with a specific USB controller and device.
  54. .PP
  55. The
  56. .B -f
  57. flag runs
  58. .B usbmouse
  59. in the foreground.
  60. .SS Audio devices
  61. .B Usbaudio
  62. configures and manages a usb audio device. It implements a file system,
  63. normally mounted in
  64. .BI /dev ,
  65. but this can be changed with the
  66. .B \-m
  67. flag, with files
  68. .IR /volume ,
  69. .IR /audioctl ,
  70. .IR /audio ,
  71. and
  72. .IR /audioin .
  73. The names
  74. .I /volume
  75. and
  76. .I /audio
  77. maintain backward compatibility with the soundblaster driver.
  78. .PP
  79. The
  80. .B \-s
  81. flag specifies a name for a file descriptor to be posted in
  82. .CW /srv .
  83. .PP
  84. Reading
  85. .I /volume
  86. or
  87. .I /audioctl
  88. yields the device's settings. The data format of
  89. .I /volume
  90. is compatible with the soundblaster and
  91. produces something like
  92. .PP
  93. .EX
  94. audio out 65
  95. treb out 0
  96. bass out 0
  97. speed out 44100
  98. .EE
  99. .PP
  100. This file can be written using the same syntax. The keyword
  101. .I out
  102. may be omitted. Settings are given as percentages of the range.
  103. .PP
  104. The file
  105. .I /audioctl
  106. provides more information, using up to 6 columns of 12 characters each.
  107. From left to right, the fields are:
  108. .IR "control name" ,
  109. .I in
  110. or
  111. .IR out ,
  112. .IR "current value" ,
  113. .IR "minimum value" ,
  114. .IR maximum ,
  115. and
  116. .IR resolution .
  117. There are 3, 5, or 6 columns present.
  118. Maxima and resolution are omitted when they are not available or not applicable.
  119. The resolution for
  120. .I speed
  121. is reported as 1 (one) if the sampling frequency is continuously variable. It is absent
  122. if it is settable at a fixed number of discrete values only.
  123. .PP
  124. When all values from
  125. .I /audioctl
  126. have been read, a zero-sized buffer is returned (the usual end-of-file indication).
  127. A new read will then block until one of the settings changes and then report its new value.
  128. .PP
  129. The file
  130. .I /audioctl
  131. can be written like
  132. .IR /volume .
  133. .PP
  134. Audio data is written to
  135. .I /audio
  136. and read from
  137. .IR /audioin .
  138. The data format is little endian, samples ordered primarily by time and
  139. secondarily by channel. Samples occupy the minimum integral number
  140. of bytes. Read and write operations of arbitrary size are allowed.
  141. .SH EXAMPLE
  142. .LP
  143. To use a USB mouse and audio device, put the following in your profile
  144. (replace x by your favorite initial volume setting):
  145. .PP
  146. .EX
  147. .ta 6n
  148. if (test -r '#U'/usb0) {
  149. usb/usbd
  150. usb/usbmouse -a 2
  151. usb/usbaudio -v x
  152. }
  153. .EE
  154. .PP
  155. Alternatively, just put
  156. .B usbstart
  157. in your profile.
  158. .SH SOURCE
  159. .B /sys/src/cmd/usb
  160. .SH "SEE ALSO"
  161. .IR usb (3),
  162. .IR usbd (4)