SB-Live-mixer.txt 14 KB

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