Guest User

brebs

a guest
Apr 20th, 2010
1,281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.53 KB | None | 0 0
  1. # dmix - plug:dmix supports 1-8 channels, and does use dmix!
  2. # Whereas surround51 doesn't use dmix
  3. # http://bbs.archlinux.org/viewtopic.php?pid=745946#p745946
  4.  
  5.  
  6. # cat /proc/asound/card0/pcm0p/sub0/hw_params
  7. # Output to hw:0,0 to keep at 44.1k rather than dmix's 48k
  8. # 44.1k stops dmix from working, though.
  9.  
  10.  
  11. # From https://bugs.launchpad.net/debian/+source/sdl-mixer1.2/+bug/66483
  12. # Not needed.
  13. #defaults.pcm.dmix_max_periods -1
  14.  
  15.  
  16. #defaults.pcm.rate_converter "samplerate_best"
  17.  
  18.  
  19. # Playing
  20. pcm.!default {
  21. type asym
  22. playback.pcm "ch51dup"
  23. #playback.pcm "upmix_20to51_resample"
  24. }
  25.  
  26.  
  27. # If get error "Slave PCM not usable", then need to use plug:
  28. # If get error "Cannot find rate converter", then install libsamplerate and alsa-plugins
  29.  
  30. # Lunar Linux: lin ladspa-bs2b
  31. # listplugins
  32. # analyseplugin bs2b
  33. pcm.bs2b {
  34. type ladspa
  35. path "/usr/lib/ladspa"
  36. plugins {
  37. 0 {
  38. id 4221 # Bauer stereophonic-to-binaural (4221/bs2b)
  39. input {
  40. controls [ 700 6 ]
  41. }
  42. }
  43. }
  44. # plug:dmix uses less CPU than default! Weird
  45. # http://bbs.archlinux.org/viewtopic.php?id=95582
  46. slave.pcm "plug:dmix"
  47. #slave.pcm "default"
  48. }
  49.  
  50.  
  51. # speaker-test -D headphones -c 2 -t wav
  52. # audacious uses less CPU when running bs2b as a listed plugin, probably because of samplerate_best
  53. # Posted at http://bbs.archlinux.org/viewtopic.php?pid=626573#p626573
  54. pcm.headphones {
  55. type rate
  56. slave {
  57. pcm "plug:bs2b"
  58. rate 48000
  59. }
  60. # Choices: samplerate_best samplerate_medium samplerate samplerate_order samplerate_linear
  61. converter "samplerate_best"
  62.  
  63. hint {
  64. show on
  65. description "Headphones"
  66. }
  67. }
  68.  
  69.  
  70.  
  71. pcm.ch51dup {
  72. #slave.pcm surround51
  73. slave.pcm "plug:dmix"
  74. slave.channels 6
  75. type route
  76.  
  77. # Front and rear
  78. ttable.0.0 0.5
  79. ttable.1.1 0.5
  80. ttable.2.2 0.5
  81. ttable.3.3 0.5
  82.  
  83. # Center and LFE
  84. ttable.4.4 1
  85. ttable.5.5 1
  86.  
  87. # Front left/right to center
  88. ttable.0.4 0.5
  89. ttable.1.4 0.5
  90.  
  91. # Front left/right to rear
  92. ttable.0.2 0.5
  93. ttable.1.3 0.5
  94. }
  95.  
  96.  
  97.  
  98. # http://alsa.opensrc.org/SurroundSound
  99. # http://alsa.opensrc.org/index.php/Low-pass_filter_for_subwoofer_channel_(HOWTO)
  100. # Lunar: lin ladspa tap-plugins swh-plugins cmt-plugins libsamplerate
  101. # Fedora: yum install ladspa ladspa-blop-plugins ladspa-caps-plugins ladspa-cmt-plugins ladspa-swh-plugins ladspa-tap-plugins libsamplerate
  102. # Arch Linux: pacman -S ladspa blop swh-plugins libsamplerate tap-plugins cmt
  103. # speaker-test -D upmix_20to51 -c 2 -t wav
  104. # Debugging: speaker-test -D plug:lowpass_21to21 -c 3 -t wav
  105. # listplugins
  106. # analyseplugin cmt
  107. # http://plugin.org.uk/ladspa-swh/docs/ladspa-swh.html
  108. # http://forums.gentoo.org/viewtopic-p-4528619.html#4528619
  109. pcm.lowpass_21to21 {
  110. type ladspa
  111. slave.pcm upmix_21to51
  112. # Set the path to ladspa, to fix this error:
  113. # Playback open error: -2,No such file or directory
  114. path "/usr/lib/ladspa"
  115. channels 3
  116. plugins {
  117. 0 {
  118. id 1098 # Identity (Audio) (1098/identity_audio)
  119. policy duplicate
  120. input.bindings.0 "Input";
  121. output.bindings.0 "Output";
  122. }
  123.  
  124. 1 {
  125. id 1052 # High-pass filter
  126. policy none
  127. input.bindings.0 "Input";
  128. output.bindings.0 "Output";
  129. input {
  130. controls [ 300 ]
  131. }
  132. }
  133.  
  134. 2 {
  135. id 1052 # High-pass filter
  136. policy none
  137. input.bindings.1 "Input";
  138. output.bindings.1 "Output";
  139. input {
  140. controls [ 300 ]
  141. }
  142. }
  143.  
  144. 3 {
  145. id 1051 # Low-pass filter.
  146. policy none
  147. input.bindings.2 "Input";
  148. output.bindings.2 "Output";
  149. input {
  150. controls [ 300 ]
  151. }
  152. }
  153.  
  154. # From http://alsa.opensrc.org/index.php/Low-pass_filter_for_subwoofer_channel_(HOWTO)
  155. # Can be used instead of 1-3 above.
  156. # 1 {
  157. # id 1672 # 4 Pole Low-Pass Filter with Resonance (FCRCIA) (1672/lp4pole_fcrcia_oa)
  158. # policy none
  159. # input.bindings.2 "Input";
  160. # output.bindings.2 "Output";
  161. # input {
  162. # controls [ 300 2 ]
  163. # }
  164. # }
  165. }
  166. }
  167.  
  168.  
  169. # speaker-test -D upmix_20to51 -c 2 -t wav
  170. # In audacious: upmix_20to51
  171. pcm.upmix_20to51 {
  172. type plug
  173. slave.pcm "lowpass_21to21"
  174. slave.channels 3
  175. ttable {
  176. 0.0 1 # left channel
  177. 1.1 1 # right channel
  178. 0.2 0.5 # mix left and right ...
  179. 1.2 0.5 # ... channel for subwoofer
  180. }
  181.  
  182. # slave.rate 48000 makes CPU utilization 20% instead of 3%
  183. # Can't hear the difference with Audigy4 anyway.
  184. # slave.rate 44100 is 3%, so that proves audacious outputs 44100
  185. #slave.rate 48000
  186. #converter "samplerate"
  187. #slave.rate_converter "samplerate_best"
  188. }
  189.  
  190.  
  191. # In audacious: upmix_20to51_resample
  192. # aplay -D upmix_20to51_resample ~/alsa/samplerate-test/udial.wav
  193. pcm.upmix_20to51_resample {
  194. type rate
  195. slave {
  196. pcm upmix_20to51
  197. #format S32_LE
  198. # Audigy4 upmixes to 48000 itself, and seems to use low-quality linear interpolation
  199. rate 48000
  200. }
  201. # Choices: samplerate_best samplerate_medium samplerate samplerate_order samplerate_linear
  202. # 8% CPU with samplerate_medium - good choice
  203. converter "samplerate_medium"
  204. #converter "samplerate_linear"
  205. }
  206.  
  207. # Debugging: speaker-test -D upmix_21to51 -c 3 -t wav
  208. pcm.upmix_21to51 {
  209. type plug
  210. # For ice1724:
  211. #slave.pcm surround51-ice
  212. # For Audigy:
  213. #slave.pcm surround51
  214. # http://bbs.archlinux.org/viewtopic.php?pid=745946#p745946
  215. slave.pcm "plug:dmix"
  216. # For P5K ADI:
  217. #slave.pcm surround51-adi
  218. # Trying to pipe through Pulse Audio, to stop the clicks between songs.
  219. # Can't get Pulse Audio to work like this.
  220. #slave.pcm pulse
  221. # Don't need to specify the number of channels.
  222. slave.channels 6
  223. ttable {
  224. 0.0 1 # front left
  225. 1.1 1 # front right
  226. 0.2 1 # rear left
  227. 1.3 1 # rear right
  228.  
  229. # Front left/right to center.
  230. # Imbalanced because is to the left of the monitor!
  231. # Would normally be 0.5 each.
  232. 0.4 0.5
  233. 1.4 0.5
  234.  
  235. # Subwoofer, more powerful to compensate for bass-removal from other speakers.
  236. 2.5 2
  237. }
  238. }
  239.  
  240.  
  241. # Channels are wrong way around in doom! This fixes them.
  242. # http://www.linuxforen.de/forums/archive/index.php/t-206470.html
  243. # http://forums.seriouszone.com/showthread.php?t=49869&page=10
  244. # http://forums.gentoo.org/viewtopic-p-4173170.html#4173170
  245. # For Audigy 4
  246. # Weird, doom3 has crappy sound if I add an alsa rate converter.
  247. # Posted at http://ubuntuforums.org/showthread.php?t=1304228
  248. pcm.doom-surround51 {
  249. slave.pcm surround51
  250. slave.channels 6
  251. type route
  252. ttable.0.0 1
  253. ttable.1.1 1
  254. ttable.2.4 1
  255. ttable.3.5 1
  256. ttable.4.2 1
  257. ttable.5.3 1
  258. }
  259.  
  260.  
  261. pcm.doom3-8930g {
  262. type plug
  263. slave.pcm {
  264. type dmix
  265. ipc_key 1093 # Must be unique
  266. ipc_key_add_uid false
  267. ipc_perm 0660
  268. slave {
  269. pcm "hw:0,0"
  270. rate 44100
  271. channels 2
  272. period_time 0
  273. period_size 1024
  274. buffer_time 0
  275. # Doom 3 wants buffer_size 8192
  276. # In ~/.doom3/base/autoexec.cfg
  277. # And ~/.quake4/q4base/autoexec.cfg
  278. # seta s_alsa_pcm "doom3-8930g"
  279. buffer_size 8192
  280. }
  281. }
  282. }
Advertisement
Add Comment
Please, Sign In to add comment