Wavefront 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. An OSS/Free Driver for WaveFront soundcards
  2. (Turtle Beach Maui, Tropez, Tropez Plus)
  3. Paul Barton-Davis, July 1998
  4. VERSION 0.2.5
  5. Driver Status
  6. -------------
  7. Requires: Kernel 2.1.106 or later (the driver is included with kernels
  8. 2.1.109 and above)
  9. As of 7/22/1998, this driver is currently in *BETA* state. This means
  10. that it compiles and runs, and that I use it on my system (Linux
  11. 2.1.106) with some reasonably demanding applications and uses. I
  12. believe the code is approaching an initial "finished" state that
  13. provides bug-free support for the Tropez Plus.
  14. Please note that to date, the driver has ONLY been tested on a Tropez
  15. Plus. I would very much like to hear (and help out) people with Tropez
  16. and Maui cards, since I think the driver can support those cards as
  17. well.
  18. Finally, the driver has not been tested (or even compiled) as a static
  19. (non-modular) part of the kernel. Alan Cox's good work in modularizing
  20. OSS/Free for Linux makes this rather unnecessary.
  21. Some Questions
  22. --------------
  23. **********************************************************************
  24. 0) What does this driver do that the maui driver did not ?
  25. **********************************************************************
  26. * can fully initialize a WaveFront card from cold boot - no DOS
  27. utilities needed
  28. * working patch/sample/program loading and unloading (the maui
  29. driver didn't document how to make this work, and assumed
  30. user-level preparation of the patch data for writing
  31. to the board. ick.)
  32. * full user-level access to all WaveFront commands
  33. * for the Tropez Plus, (primitive) control of the YSS225 FX processor
  34. * Virtual MIDI mode supported - 2 MIDI devices accessible via the
  35. WaveFront's MPU401/UART emulation. One
  36. accesses the WaveFront synth, the other accesses the
  37. external MIDI connector. Full MIDI read/write semantics
  38. for both devices.
  39. * OSS-compliant /dev/sequencer interface for the WaveFront synth,
  40. including native and GUS-format patch downloading.
  41. * semi-intelligent patch management (prototypical at this point)
  42. **********************************************************************
  43. 1) What to do about MIDI interfaces ?
  44. **********************************************************************
  45. The Tropez Plus (and perhaps other WF cards) can in theory support up
  46. to 2 physical MIDI interfaces. One of these is connected to the
  47. ICS2115 chip (the WaveFront synth itself) and is controlled by
  48. MPU/UART-401 emulation code running as part of the WaveFront OS. The
  49. other is controlled by the CS4232 chip present on the board. However,
  50. physical access to the CS4232 connector is difficult, and it is
  51. unlikely (though not impossible) that you will want to use it.
  52. An older version of this driver introduced an additional kernel config
  53. variable which controlled whether or not the CS4232 MIDI interface was
  54. configured. Because of Alan Cox's work on modularizing the sound
  55. drivers, and now backporting them to 2.0.34 kernels, there seems to be
  56. little reason to support "static" configuration variables, and so this
  57. has been abandoned in favor of *only* module parameters. Specifying
  58. "mpuio" and "mpuirq" for the cs4232 parameter will result in the
  59. CS4232 MIDI interface being configured; leaving them unspecified will
  60. leave it unconfigured (and thus unusable).
  61. BTW, I have heard from one Tropez+ user that the CS4232 interface is
  62. more reliable than the ICS2115 one. I have had no problems with the
  63. latter, and I don't have the right cable to test the former one
  64. out. Reports welcome.
  65. **********************************************************************
  66. 2) Why does line XXX of the code look like this .... ?
  67. **********************************************************************
  68. Either because it's not finished yet, or because you're a better coder
  69. than I am, or because you don't understand some aspect of how the card
  70. or the code works.
  71. I absolutely welcome comments, criticisms and suggestions about the
  72. design and implementation of the driver.
  73. **********************************************************************
  74. 3) What files are included ?
  75. **********************************************************************
  76. drivers/sound/README.wavefront -- this file
  77. drivers/sound/wavefront.patch -- patches for the 2.1.106 sound drivers
  78. needed to make the rest of this work
  79. DO NOT USE IF YOU'VE APPLIED THEM
  80. BEFORE, OR HAVE 2.1.109 OR ABOVE
  81. drivers/sound/wavfront.c -- the driver
  82. drivers/sound/ys225.h -- data declarations for FX config
  83. drivers/sound/ys225.c -- data definitions for FX config
  84. drivers/sound/wf_midi.c -- the "uart401" driver
  85. to support virtual MIDI mode.
  86. include/wavefront.h -- the header file
  87. Documentation/sound/oss/Tropez+ -- short docs on configuration
  88. **********************************************************************
  89. 4) How do I compile/install/use it ?
  90. **********************************************************************
  91. PART ONE: install the source code into your sound driver directory
  92. cd <top-of-your-2.1.106-code-base-e.g.-/usr/src/linux>
  93. tar -zxvf <where-you-put/wavefront.tar.gz>
  94. PART TWO: apply the patches
  95. DO THIS ONLY IF YOU HAVE A KERNEL VERSION BELOW 2.1.109
  96. AND HAVE NOT ALREADY INSTALLED THE PATCH(ES).
  97. cd drivers/sound
  98. patch < wavefront.patch
  99. PART THREE: configure your kernel
  100. cd <top of your kernel tree>
  101. make xconfig (or whichever config option you use)
  102. - choose YES for Sound Support
  103. - choose MODULE (M) for OSS Sound Modules
  104. - choose MODULE(M) to YM3812/OPL3 support
  105. - choose MODULE(M) for WaveFront support
  106. - choose MODULE(M) for CS4232 support
  107. - choose "N" for everything else (unless you have other
  108. soundcards you want support for)
  109. make boot
  110. .
  111. .
  112. .
  113. <whatever you normally do for a kernel install>
  114. make modules
  115. .
  116. .
  117. .
  118. make modules_install
  119. Here's my autoconf.h SOUND section:
  120. /*
  121. * Sound
  122. */
  123. #define CONFIG_SOUND 1
  124. #undef CONFIG_SOUND_OSS
  125. #define CONFIG_SOUND_OSS_MODULE 1
  126. #undef CONFIG_SOUND_PAS
  127. #undef CONFIG_SOUND_SB
  128. #undef CONFIG_SOUND_ADLIB
  129. #undef CONFIG_SOUND_GUS
  130. #undef CONFIG_SOUND_MPU401
  131. #undef CONFIG_SOUND_PSS
  132. #undef CONFIG_SOUND_MSS
  133. #undef CONFIG_SOUND_SSCAPE
  134. #undef CONFIG_SOUND_TRIX
  135. #undef CONFIG_SOUND_MAD16
  136. #undef CONFIG_SOUND_WAVEFRONT
  137. #define CONFIG_SOUND_WAVEFRONT_MODULE 1
  138. #undef CONFIG_SOUND_CS4232
  139. #define CONFIG_SOUND_CS4232_MODULE 1
  140. #undef CONFIG_SOUND_MAUI
  141. #undef CONFIG_SOUND_SGALAXY
  142. #undef CONFIG_SOUND_OPL3SA1
  143. #undef CONFIG_SOUND_SOFTOSS
  144. #undef CONFIG_SOUND_YM3812
  145. #define CONFIG_SOUND_YM3812_MODULE 1
  146. #undef CONFIG_SOUND_VMIDI
  147. #undef CONFIG_SOUND_UART6850
  148. /*
  149. * Additional low level sound drivers
  150. */
  151. #undef CONFIG_LOWLEVEL_SOUND
  152. ************************************************************
  153. 6) How do I configure my card ?
  154. ************************************************************
  155. You need to edit /etc/modprobe.conf. Here's mine (edited to show the
  156. relevant details):
  157. # Sound system
  158. alias char-major-14-* wavefront
  159. alias synth0 wavefront
  160. alias mixer0 cs4232
  161. alias audio0 cs4232
  162. install wavefront /sbin/modprobe cs4232 && /sbin/modprobe -i wavefront && /sbin/modprobe opl3
  163. options wavefront io=0x200 irq=9
  164. options cs4232 synthirq=9 synthio=0x200 io=0x530 irq=5 dma=1 dma2=0
  165. options opl3 io=0x388
  166. Things to note:
  167. the wavefront options "io" and "irq" ***MUST*** match the "synthio"
  168. and "synthirq" cs4232 options.
  169. you can do without the opl3 module if you don't
  170. want to use the OPL/[34] FM synth on the soundcard
  171. the opl3 io parameter is conventionally not adjustable.
  172. In theory, any not-in-use IO port address would work, but
  173. just use 0x388 and stick with the crowd.
  174. **********************************************************************
  175. 7) What about firmware ?
  176. **********************************************************************
  177. Turtle Beach have not given me permission to distribute their firmware
  178. for the ICS2115. However, if you have a WaveFront card, then you
  179. almost certainly have the firmware, and if not, its freely available
  180. on their website, at:
  181. http://www.tbeach.com/tbs/downloads/scardsdown.htm#tropezplus
  182. The file is called WFOS2001.MOT (for the Tropez+).
  183. This driver, however, doesn't use the pure firmware as distributed,
  184. but instead relies on a somewhat processed form of it. You can
  185. generate this very easily. Following an idea from Andrew Veliath's
  186. Pinnacle driver, the following flex program will generate the
  187. processed version:
  188. ---- cut here -------------------------
  189. %option main
  190. %%
  191. ^S[28].*\r$ printf ("%c%.*s", yyleng-1,yyleng-1,yytext);
  192. <<EOF>> { fputc ('\0', stdout); return; }
  193. \n {}
  194. . {}
  195. ---- cut here -------------------------
  196. To use it, put the above in file (say, ws.l) compile it like this:
  197. shell> flex -ows.c ws.l
  198. shell> cc -o ws ws.c
  199. and then use it like this:
  200. ws < my-copy-of-the-oswf.mot-file > /etc/sound/wavefront.os
  201. If you put it somewhere else, you'll always have to use the wf_ospath
  202. module parameter (see below) or alter the source code.
  203. **********************************************************************
  204. 7) How do I get it working ?
  205. **********************************************************************
  206. Optionally, you can reboot with the "new" kernel (even though the only
  207. changes have really been made to a module).
  208. Then, as root do:
  209. modprobe wavefront
  210. You should get something like this in /var/log/messages:
  211. WaveFront: firmware 1.20 already loaded.
  212. or
  213. WaveFront: no response to firmware probe, assume raw.
  214. then:
  215. WaveFront: waiting for memory configuration ...
  216. WaveFront: hardware version 1.64
  217. WaveFront: available DRAM 8191k
  218. WaveFront: 332 samples used (266 real, 13 aliases, 53 multi), 180 empty
  219. WaveFront: 128 programs slots in use
  220. WaveFront: 256 patch slots filled, 142 in use
  221. The whole process takes about 16 seconds, the longest waits being
  222. after reporting the hardware version (during the firmware download),
  223. and after reporting program status (during patch status inquiry). Its
  224. shorter (about 10 secs) if the firmware is already loaded (i.e. only
  225. warm reboots since the last firmware load).
  226. The "available DRAM" line will vary depending on how much added RAM
  227. your card has. Mine has 8MB.
  228. To check basically functionality, use play(1) or splay(1) to send a
  229. .WAV or other audio file through the audio portion. Then use playmidi
  230. to play a General MIDI file. Try the "-D 0" to hear the
  231. difference between sending MIDI to the WaveFront and using the OPL/3,
  232. which is the default (I think ...). If you have an external synth(s)
  233. hooked to the soundcard, you can use "-e" to route to the
  234. external synth(s) (in theory, -D 1 should work as well, but I think
  235. there is a bug in playmidi which prevents this from doing what it
  236. should).
  237. **********************************************************************
  238. 8) What are the module parameters ?
  239. **********************************************************************
  240. Its best to read wavefront.c for this, but here is a summary:
  241. integers:
  242. wf_raw - if set, ignore apparent presence of firmware
  243. loaded onto the ICS2115, reset the whole
  244. board, and initialize it from scratch. (default = 0)
  245. fx_raw - if set, always initialize the YSS225 processor
  246. on the Tropez plus. (default = 1)
  247. < The next 4 are basically for kernel hackers to allow
  248. tweaking the driver for testing purposes. >
  249. wait_usecs - loop timer used when waiting for
  250. status conditions on the board.
  251. The default is 150.
  252. debug_default - debugging flags. See sound/wavefront.h
  253. for WF_DEBUG_* values. Default is zero.
  254. Setting this allows you to debug the
  255. driver during module installation.
  256. strings:
  257. ospath - path to get to the pre-processed OS firmware.
  258. (default: /etc/sound/wavefront.os)
  259. **********************************************************************
  260. 9) Who should I contact if I have problems?
  261. **********************************************************************
  262. Just me: Paul Barton-Davis <pbd@op.net>