usb 3.3 KB

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