sb-live-mixer.rst 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. ===========================================
  2. Sound Blaster Live mixer / default DSP code
  3. ===========================================
  4. The EMU10K1 chips have a DSP part which can be programmed to support
  5. various ways of sample processing, which is described here.
  6. (This article does not deal with the overall functionality of the
  7. EMU10K1 chips. See the manuals section for further details.)
  8. The ALSA driver programs this portion of chip by default code
  9. (can be altered later) which offers the following functionality:
  10. IEC958 (S/PDIF) raw PCM
  11. =======================
  12. This PCM device (it's the 4th PCM device (index 3!) and first subdevice
  13. (index 0) for a given card) allows to forward 48kHz, stereo, 16-bit
  14. little endian streams without any modifications to the digital output
  15. (coaxial or optical). The universal interface allows the creation of up
  16. to 8 raw PCM devices operating at 48kHz, 16-bit little endian. It would
  17. be easy to add support for multichannel devices to the current code,
  18. but the conversion routines exist only for stereo (2-channel streams)
  19. at the time.
  20. Look to tram_poke routines in lowlevel/emu10k1/emufx.c for more details.
  21. Digital mixer controls
  22. ======================
  23. These controls are built using the DSP instructions. They offer extended
  24. functionality. Only the default build-in code in the ALSA driver is described
  25. here. Note that the controls work as attenuators: the maximum value is the
  26. neutral position leaving the signal unchanged. Note that if the same destination
  27. is mentioned in multiple controls, the signal is accumulated and can be wrapped
  28. (set to maximal or minimal value without checking of overflow).
  29. Explanation of used abbreviations:
  30. DAC
  31. digital to analog converter
  32. ADC
  33. analog to digital converter
  34. I2S
  35. one-way three wire serial bus for digital sound by Philips Semiconductors
  36. (this standard is used for connecting standalone DAC and ADC converters)
  37. LFE
  38. low frequency effects (subwoofer signal)
  39. AC97
  40. a chip containing an analog mixer, DAC and ADC converters
  41. IEC958
  42. S/PDIF
  43. FX-bus
  44. the EMU10K1 chip has an effect bus containing 16 accumulators.
  45. Each of the synthesizer voices can feed its output to these accumulators
  46. and the DSP microcontroller can operate with the resulting sum.
  47. ``name='Wave Playback Volume',index=0``
  48. ---------------------------------------
  49. This control is used to attenuate samples for left and right PCM FX-bus
  50. accumulators. ALSA uses accumulators 0 and 1 for left and right PCM samples.
  51. The result samples are forwarded to the front DAC PCM slots of the AC97 codec.
  52. ``name='Wave Surround Playback Volume',index=0``
  53. ------------------------------------------------
  54. This control is used to attenuate samples for left and right PCM FX-bus
  55. accumulators. ALSA uses accumulators 0 and 1 for left and right PCM samples.
  56. The result samples are forwarded to the rear I2S DACs. These DACs operates
  57. separately (they are not inside the AC97 codec).
  58. ``name='Wave Center Playback Volume',index=0``
  59. ----------------------------------------------
  60. This control is used to attenuate samples for left and right PCM FX-bus
  61. accumulators. ALSA uses accumulators 0 and 1 for left and right PCM samples.
  62. The result is mixed to mono signal (single channel) and forwarded to
  63. the ??rear?? right DAC PCM slot of the AC97 codec.
  64. ``name='Wave LFE Playback Volume',index=0``
  65. -------------------------------------------
  66. This control is used to attenuate samples for left and right PCM FX-bus
  67. accumulators. ALSA uses accumulators 0 and 1 for left and right PCM.
  68. The result is mixed to mono signal (single channel) and forwarded to
  69. the ??rear?? left DAC PCM slot of the AC97 codec.
  70. ``name='Wave Capture Volume',index=0``, ``name='Wave Capture Switch',index=0``
  71. ------------------------------------------------------------------------------
  72. These controls are used to attenuate samples for left and right PCM FX-bus
  73. accumulator. ALSA uses accumulators 0 and 1 for left and right PCM.
  74. The result is forwarded to the ADC capture FIFO (thus to the standard capture
  75. PCM device).
  76. ``name='Synth Playback Volume',index=0``
  77. ----------------------------------------
  78. This control is used to attenuate samples for left and right MIDI FX-bus
  79. accumulators. ALSA uses accumulators 4 and 5 for left and right MIDI samples.
  80. The result samples are forwarded to the front DAC PCM slots of the AC97 codec.
  81. ``name='Synth Capture Volume',index=0``, ``name='Synth Capture Switch',index=0``
  82. --------------------------------------------------------------------------------
  83. These controls are used to attenuate samples for left and right MIDI FX-bus
  84. accumulator. ALSA uses accumulators 4 and 5 for left and right PCM.
  85. The result is forwarded to the ADC capture FIFO (thus to the standard capture
  86. PCM device).
  87. ``name='Surround Playback Volume',index=0``
  88. -------------------------------------------
  89. This control is used to attenuate samples for left and right rear PCM FX-bus
  90. accumulators. ALSA uses accumulators 2 and 3 for left and right rear PCM samples.
  91. The result samples are forwarded to the rear I2S DACs. These DACs operate
  92. separately (they are not inside the AC97 codec).
  93. ``name='Surround Capture Volume',index=0``, ``name='Surround Capture Switch',index=0``
  94. --------------------------------------------------------------------------------------
  95. These controls are used to attenuate samples for left and right rear PCM FX-bus
  96. accumulators. ALSA uses accumulators 2 and 3 for left and right rear PCM samples.
  97. The result is forwarded to the ADC capture FIFO (thus to the standard capture
  98. PCM device).
  99. ``name='Center Playback Volume',index=0``
  100. -----------------------------------------
  101. This control is used to attenuate sample for center PCM FX-bus accumulator.
  102. ALSA uses accumulator 6 for center PCM sample. The result sample is forwarded
  103. to the ??rear?? right DAC PCM slot of the AC97 codec.
  104. ``name='LFE Playback Volume',index=0``
  105. --------------------------------------
  106. This control is used to attenuate sample for center PCM FX-bus accumulator.
  107. ALSA uses accumulator 6 for center PCM sample. The result sample is forwarded
  108. to the ??rear?? left DAC PCM slot of the AC97 codec.
  109. ``name='AC97 Playback Volume',index=0``
  110. ---------------------------------------
  111. This control is used to attenuate samples for left and right front ADC PCM slots
  112. of the AC97 codec. The result samples are forwarded to the front DAC PCM
  113. slots of the AC97 codec.
  114. .. note::
  115. This control should be zero for the standard operations, otherwise
  116. a digital loopback is activated.
  117. ``name='AC97 Capture Volume',index=0``
  118. --------------------------------------
  119. This control is used to attenuate samples for left and right front ADC PCM slots
  120. of the AC97 codec. The result is forwarded to the ADC capture FIFO (thus to
  121. the standard capture PCM device).
  122. .. note::
  123. This control should be 100 (maximal value), otherwise no analog
  124. inputs of the AC97 codec can be captured (recorded).
  125. ``name='IEC958 TTL Playback Volume',index=0``
  126. ---------------------------------------------
  127. This control is used to attenuate samples from left and right IEC958 TTL
  128. digital inputs (usually used by a CDROM drive). The result samples are
  129. forwarded to the front DAC PCM slots of the AC97 codec.
  130. ``name='IEC958 TTL Capture Volume',index=0``
  131. --------------------------------------------
  132. This control is used to attenuate samples from left and right IEC958 TTL
  133. digital inputs (usually used by a CDROM drive). The result samples are
  134. forwarded to the ADC capture FIFO (thus to the standard capture PCM device).
  135. ``name='Zoom Video Playback Volume',index=0``
  136. ---------------------------------------------
  137. This control is used to attenuate samples from left and right zoom video
  138. digital inputs (usually used by a CDROM drive). The result samples are
  139. forwarded to the front DAC PCM slots of the AC97 codec.
  140. ``name='Zoom Video Capture Volume',index=0``
  141. --------------------------------------------
  142. This control is used to attenuate samples from left and right zoom video
  143. digital inputs (usually used by a CDROM drive). The result samples are
  144. forwarded to the ADC capture FIFO (thus to the standard capture PCM device).
  145. ``name='IEC958 LiveDrive Playback Volume',index=0``
  146. ---------------------------------------------------
  147. This control is used to attenuate samples from left and right IEC958 optical
  148. digital input. The result samples are forwarded to the front DAC PCM slots
  149. of the AC97 codec.
  150. ``name='IEC958 LiveDrive Capture Volume',index=0``
  151. --------------------------------------------------
  152. This control is used to attenuate samples from left and right IEC958 optical
  153. digital inputs. The result samples are forwarded to the ADC capture FIFO
  154. (thus to the standard capture PCM device).
  155. ``name='IEC958 Coaxial Playback Volume',index=0``
  156. -------------------------------------------------
  157. This control is used to attenuate samples from left and right IEC958 coaxial
  158. digital inputs. The result samples are forwarded to the front DAC PCM slots
  159. of the AC97 codec.
  160. ``name='IEC958 Coaxial Capture Volume',index=0``
  161. ------------------------------------------------
  162. This control is used to attenuate samples from left and right IEC958 coaxial
  163. digital inputs. The result samples are forwarded to the ADC capture FIFO
  164. (thus to the standard capture PCM device).
  165. ``name='Line LiveDrive Playback Volume',index=0``, ``name='Line LiveDrive Playback Volume',index=1``
  166. ----------------------------------------------------------------------------------------------------
  167. This control is used to attenuate samples from left and right I2S ADC
  168. inputs (on the LiveDrive). The result samples are forwarded to the front
  169. DAC PCM slots of the AC97 codec.
  170. ``name='Line LiveDrive Capture Volume',index=1``, ``name='Line LiveDrive Capture Volume',index=1``
  171. --------------------------------------------------------------------------------------------------
  172. This control is used to attenuate samples from left and right I2S ADC
  173. inputs (on the LiveDrive). The result samples are forwarded to the ADC
  174. capture FIFO (thus to the standard capture PCM device).
  175. ``name='Tone Control - Switch',index=0``
  176. ----------------------------------------
  177. This control turns the tone control on or off. The samples for front, rear
  178. and center / LFE outputs are affected.
  179. ``name='Tone Control - Bass',index=0``
  180. --------------------------------------
  181. This control sets the bass intensity. There is no neutral value!!
  182. When the tone control code is activated, the samples are always modified.
  183. The closest value to pure signal is 20.
  184. ``name='Tone Control - Treble',index=0``
  185. ----------------------------------------
  186. This control sets the treble intensity. There is no neutral value!!
  187. When the tone control code is activated, the samples are always modified.
  188. The closest value to pure signal is 20.
  189. ``name='IEC958 Optical Raw Playback Switch',index=0``
  190. -----------------------------------------------------
  191. If this switch is on, then the samples for the IEC958 (S/PDIF) digital
  192. output are taken only from the raw FX8010 PCM, otherwise standard front
  193. PCM samples are taken.
  194. ``name='Headphone Playback Volume',index=1``
  195. --------------------------------------------
  196. This control attenuates the samples for the headphone output.
  197. ``name='Headphone Center Playback Switch',index=1``
  198. ---------------------------------------------------
  199. If this switch is on, then the sample for the center PCM is put to the
  200. left headphone output (useful for SB Live cards without separate center/LFE
  201. output).
  202. ``name='Headphone LFE Playback Switch',index=1``
  203. ------------------------------------------------
  204. If this switch is on, then the sample for the center PCM is put to the
  205. right headphone output (useful for SB Live cards without separate center/LFE
  206. output).
  207. PCM stream related controls
  208. ===========================
  209. ``name='EMU10K1 PCM Volume',index 0-31``
  210. ----------------------------------------
  211. Channel volume attenuation in range 0-0xffff. The maximum value (no
  212. attenuation) is default. The channel mapping for three values is
  213. as follows:
  214. * 0 - mono, default 0xffff (no attenuation)
  215. * 1 - left, default 0xffff (no attenuation)
  216. * 2 - right, default 0xffff (no attenuation)
  217. ``name='EMU10K1 PCM Send Routing',index 0-31``
  218. ----------------------------------------------
  219. This control specifies the destination - FX-bus accumulators. There are
  220. twelve values with this mapping:
  221. * 0 - mono, A destination (FX-bus 0-15), default 0
  222. * 1 - mono, B destination (FX-bus 0-15), default 1
  223. * 2 - mono, C destination (FX-bus 0-15), default 2
  224. * 3 - mono, D destination (FX-bus 0-15), default 3
  225. * 4 - left, A destination (FX-bus 0-15), default 0
  226. * 5 - left, B destination (FX-bus 0-15), default 1
  227. * 6 - left, C destination (FX-bus 0-15), default 2
  228. * 7 - left, D destination (FX-bus 0-15), default 3
  229. * 8 - right, A destination (FX-bus 0-15), default 0
  230. * 9 - right, B destination (FX-bus 0-15), default 1
  231. * 10 - right, C destination (FX-bus 0-15), default 2
  232. * 11 - right, D destination (FX-bus 0-15), default 3
  233. Don't forget that it's illegal to assign a channel to the same FX-bus accumulator
  234. more than once (it means 0=0 && 1=0 is an invalid combination).
  235. ``name='EMU10K1 PCM Send Volume',index 0-31``
  236. ---------------------------------------------
  237. It specifies the attenuation (amount) for given destination in range 0-255.
  238. The channel mapping is following:
  239. * 0 - mono, A destination attn, default 255 (no attenuation)
  240. * 1 - mono, B destination attn, default 255 (no attenuation)
  241. * 2 - mono, C destination attn, default 0 (mute)
  242. * 3 - mono, D destination attn, default 0 (mute)
  243. * 4 - left, A destination attn, default 255 (no attenuation)
  244. * 5 - left, B destination attn, default 0 (mute)
  245. * 6 - left, C destination attn, default 0 (mute)
  246. * 7 - left, D destination attn, default 0 (mute)
  247. * 8 - right, A destination attn, default 0 (mute)
  248. * 9 - right, B destination attn, default 255 (no attenuation)
  249. * 10 - right, C destination attn, default 0 (mute)
  250. * 11 - right, D destination attn, default 0 (mute)
  251. MANUALS/PATENTS
  252. ===============
  253. ftp://opensource.creative.com/pub/doc
  254. -------------------------------------
  255. LM4545.pdf
  256. AC97 Codec
  257. m2049.pdf
  258. The EMU10K1 Digital Audio Processor
  259. hog63.ps
  260. FX8010 - A DSP Chip Architecture for Audio Effects
  261. WIPO Patents
  262. ------------
  263. WO 9901813 (A1)
  264. Audio Effects Processor with multiple asynchronous streams
  265. (Jan. 14, 1999)
  266. WO 9901814 (A1)
  267. Processor with Instruction Set for Audio Effects (Jan. 14, 1999)
  268. WO 9901953 (A1)
  269. Audio Effects Processor having Decoupled Instruction
  270. Execution and Audio Data Sequencing (Jan. 14, 1999)
  271. US Patents (https://www.uspto.gov/)
  272. -----------------------------------
  273. US 5925841
  274. Digital Sampling Instrument employing cache memory (Jul. 20, 1999)
  275. US 5928342
  276. Audio Effects Processor integrated on a single chip
  277. with a multiport memory onto which multiple asynchronous
  278. digital sound samples can be concurrently loaded
  279. (Jul. 27, 1999)
  280. US 5930158
  281. Processor with Instruction Set for Audio Effects (Jul. 27, 1999)
  282. US 6032235
  283. Memory initialization circuit (Tram) (Feb. 29, 2000)
  284. US 6138207
  285. Interpolation looping of audio samples in cache connected to
  286. system bus with prioritization and modification of bus transfers
  287. in accordance with loop ends and minimum block sizes
  288. (Oct. 24, 2000)
  289. US 6151670
  290. Method for conserving memory storage using a
  291. pool of short term memory registers
  292. (Nov. 21, 2000)
  293. US 6195715
  294. Interrupt control for multiple programs communicating with
  295. a common interrupt by associating programs to GP registers,
  296. defining interrupt register, polling GP registers, and invoking
  297. callback routine associated with defined interrupt register
  298. (Feb. 27, 2001)