Advertisement
Guest User

brebs

a guest
May 8th, 2008
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.82 KB | None | 0 0
  1. # Debugging: http://hg.alsa-project.org/alsa/raw-file/tip/alsa-info.sh
  2.  
  3. # http://www.sabi.co.uk/Notes/linuxSoundALSA.html
  4. # echo 128 > /proc/asound/card0/pcm0p/sub0/prealloc
  5. # to allocate 128kbyte for playback, substream #0, stream #0 on the card #0
  6.  
  7. # http://gentoo-wiki.com/HOWTO_Set_up_a_system-wide_equaliser_with_ALSA_and_LADSPA
  8.  
  9. # Wiki article: http://gentoo-wiki.com/HOWTO_Compile_Kernel_with_ALSA
  10.  
  11. # Soundcard recommendation: http://forums.gentoo.org/viewtopic-p-4192284.html#4192284
  12.  
  13. # OSS info:
  14. # http://wiki.archlinux.org/index.php/OSS
  15.  
  16. # Dunno whether this makes any difference.
  17. # http://www.alsa-project.org/alsa-doc/doc-php/template.php?company=Creative+Labs&card=Sound+Blaster+Live+5.1.&chip=emu10k1&module=emu10k1
  18.  
  19. # http://www.alsa-project.org/alsa-doc/doc-php/template.php?company=VIA&card=.&chip=VIA82C686%2C+VIA8233%2C+VIA8233A%2C+VIA8235&module=via82xx
  20. # http://alsa.opensrc.org/index.php/Dmix
  21.  
  22. # http://www.halfgaar.net/surround-sound-in-linux
  23. # speaker-test -D surround51 -c 6 -t wav
  24. # speaker-test -D doom -c 6 -t sine -r 44100
  25. # speaker-test -D plug:dmix6 -c 6 -t wav
  26.  
  27. # http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html
  28. # http://www.volkerschatz.com/noise/alsa.html
  29.  
  30.  
  31. # This makes native ALSA apps default to using dmix.
  32. #pcm.!default {
  33. # type plug
  34. # slave.pcm "duplex"
  35. #}
  36.  
  37. # Pulse Audio will eventually take over, to replace dmix.
  38. # http://www.pulseaudio.org/wiki/PerfectSetup
  39. # http://wiki.archlinux.org/index.php/PulseAudio
  40. pcm.pulse {
  41. type pulse
  42. }
  43.  
  44. ctl.pulse {
  45. type pulse
  46. }
  47.  
  48. # Works with aplay, but not speaker-test
  49. #pcm.!default {
  50. # type pulse
  51. #}
  52. #ctl.!default {
  53. # type pulse
  54. #}
  55.  
  56.  
  57.  
  58. # From http://forums.gentoo.org/viewtopic-t-501671.html
  59. # Rubbish, don't use
  60. #pcm.!default {
  61. # type softvol
  62. # slave.pcm plughw
  63. # control.name PCM
  64. #}
  65.  
  66. #pcm.emu10k1 {
  67. # type hw
  68. # card 0
  69. # slave.pcm surround51
  70. # slave.channels 6
  71. #}
  72.  
  73. pcm.emu10k1 {
  74. type hw
  75. card 0
  76. }
  77.  
  78. ctl.emu10k1 {
  79. type hw
  80. card 0
  81. }
  82.  
  83.  
  84.  
  85.  
  86.  
  87. # Software mixing using dmix, 6 channels.
  88. # Doom3 needs rate 44100 rather than 48000
  89. # format S32_LE
  90.  
  91.  
  92. # hda-intel might benefit from: defaults.pcm.dmix_max_periods -1
  93. # https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3253
  94.  
  95. #Set default sound card
  96. # Useful so that all settings can be changed to a different card here.
  97. #pcm.snd_card {
  98. # type hw
  99. # card 0
  100. # device 0
  101. #}
  102.  
  103. pcm.jack {
  104. type jack
  105. playback_ports {
  106. 0 alsa_pcm:playback_1
  107. 1 alsa_pcm:playback_2
  108. }
  109. capture_ports {
  110. 0 alsa_pcm:capture_1
  111. 1 alsa_pcm:capture_2
  112. }
  113. }
  114.  
  115. # Allow mixing of multiple output streams to this device
  116. # jackd -R -d alsa -r 44100
  117. #pcm.doom {
  118. # type plug
  119. # slave { pcm "jack" }
  120. #}
  121.  
  122.  
  123. # Bah, can only get 2 channels to work with speaker-test
  124. pcm.works {
  125. type dmix
  126. ipc_key 134 # Must be unique
  127. ipc_perm 0660 # Sound for everybody in your group!
  128. slave.pcm "snd_card"
  129. slave {
  130. # This stuff provides some fixes for latency issues.
  131. # buffer_size should be set for your audio chipset.
  132. period_time 0
  133. period_size 1024
  134. buffer_size 16384
  135. channels 6
  136. rate 44100
  137. }
  138.  
  139. bindings {
  140. 0 0
  141. 1 1
  142. 2 2
  143. 3 3
  144. 4 4
  145. 5 5
  146. }
  147. }
  148.  
  149.  
  150.  
  151. # This is what we want as our default device
  152. # a fully duplex (read/write) audio device.
  153. #pcm.duplex {
  154. # type asym
  155. # playback.pcm "output"
  156. #}
  157. # capture.pcm "input"
  158.  
  159. ###################
  160. # CONVERSION PLUG #
  161. ###################
  162. # Setting the default pcm device allows the conversion
  163. # rate to be selected on the fly.
  164. # duplex mode allows any alsa enabled app to read/write
  165. # to the dmix plug (Fixes a problem with wine).
  166. #pcm.!default {
  167. # type plug
  168. # slave.pcm "duplex"
  169. #}
  170.  
  171. # Apparently this is wrong (breaks mplayer for me opening the device)
  172. #ctl.!default {
  173. # type plug
  174. # slave.pcm "snd_card"
  175. #}
  176.  
  177. ########
  178. # AOSS #
  179. ########
  180. # OSS dsp0 device (OSS needs only output support, duplex will break some stuff)
  181. #pcm.dsp0 {
  182. # type plug
  183. # slave.pcm "output"
  184. #}
  185.  
  186. # OSS control for dsp0 (needed?...this might not be useful)
  187. #ctl.dsp0 {
  188. # type plug
  189. # slave.pcm "snd_card"
  190. #}
  191.  
  192. ####
  193. #### As of November 2005 with the following packages:
  194. #### >=mozilla-firefox-1.0.7-r2, netscape-flash-7.0.25,
  195. #### alsa-oss-1.0.8-r1 and alsa-oss-1.0.10_rc3
  196. ####
  197. #### I have been experiencing crashes related to firefox when rendering flash.
  198. #### I used "aoss firefox" to start the browser.
  199. #### Commenting out the below ctl.mixer0 and using the above ctl.dsp0 allows
  200. #### firefox to render flash without crashing (and yes the aoss mixing works)
  201. #### However aoss Skype does not work properly without mixer0 under some configurations.
  202. ####
  203. # OSS control for dsp0 (default old OSS is mixer0)
  204. #ctl.mixer0 {
  205. # type plug
  206. # slave.pcm "snd_card"
  207. #}
  208.  
  209. # For audacious: audio device: ch51dup
  210. # speaker-test -D ch51dup -c 2 -t wav
  211. # alsamixer settings for audigy:
  212. # surround: 0 (for proper surround sound in doom3)
  213. # side & pcm side: 0
  214. # Others: 70 or 100
  215. # Use 0.5 in ttable lines rather than 1, to stop crackling.
  216. # ttable.1.4 is centre speaker.
  217. pcm.ch51dup {
  218. slave.pcm surround51
  219. slave.channels 6
  220. type route
  221.  
  222. # Front and rear
  223. ttable.0.0 0.5
  224. ttable.1.1 0.5
  225. ttable.2.2 0.5
  226. ttable.3.3 0.5
  227.  
  228. # Center and LFE
  229. ttable.4.4 1
  230. ttable.5.5 1
  231.  
  232. # Front left/right to center
  233. # Imbalanced because is to the left of the monitor!
  234. ttable.0.4 0.8
  235. ttable.1.4 0.2
  236.  
  237. # Front left/right to rear
  238. ttable.0.2 0.5
  239. ttable.1.3 0.5
  240. }
  241.  
  242.  
  243. # Testing dmix to 48k, versus Audigy's internal remix to 48k.
  244. # Can't tell any difference. Not worth the CPU time.
  245. # http://forums.gentoo.org/viewtopic-t-576072.html
  246. # Audacious uses 14% of the CPU with "samplerate_best"!
  247. # Audacious uses 2-3% of the CPU with "samplerate"!
  248. # Seems to skip occasionally, though, with some songs.
  249. # See http://www.hydrogenaudio.org/forums/index.php?showtopic=47591&st=50
  250. # Had to recompile alsa-plugins in Arch, for it to use libsamplerate.
  251. # Choices: samplerate_best samplerate_medium samplerate_order samplerate_linear
  252. # From http://blog.flameeyes.eu/articles/2007/02/01/a-little-hint-for-alsa-hda-users
  253. #defaults.pcm.rate_converter "samplerate_best"
  254.  
  255. #defaults.pcm.rate_converter "samplerate"
  256. # Need to recompile alsa-lib to include samplerate support, I think:
  257. # http://www.hydrogenaudio.org/forums/index.php?showtopic=47591&st=50
  258.  
  259. # dmix by default only supports 2 channels at 48000
  260. # http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html
  261. pcm.dmix51dup {
  262. type plug
  263. slave {
  264. # To send to rear speakers also
  265. pcm ch51dup
  266. # Without rear speakers
  267. #pcm "hw:0,0"
  268. # For Audigy4 - crackles slightly with rate 96000
  269. #rate 96000
  270. rate 48000
  271. # For snd-hda-intel
  272. #rate 44100
  273.  
  274. # http://alsa.opensrc.org/index.php/Playing_stereo_on_surround_sound_setup_%28Howto%29
  275. #period_time 0
  276. #period_size 1024
  277. #buffer_time 0
  278. #buffer_size 4096
  279. }
  280. }
  281.  
  282.  
  283.  
  284.  
  285.  
  286. # Channels are wrong way round in doom! This fixes them.
  287. # http://www.linuxforen.de/forums/archive/index.php/t-206470.html
  288. # http://forums.seriouszone.com/showthread.php?t=49869&page=10
  289. # http://forums.gentoo.org/viewtopic-p-4173170.html#4173170
  290. # For Audigy 4
  291. # Weird, doom3 has crappy sound if I add an alsa rate converter.
  292. pcm.doom {
  293. slave.pcm surround51
  294. slave.channels 6
  295. type route
  296. ttable.0.0 1
  297. ttable.1.1 1
  298. ttable.2.4 1
  299. ttable.3.5 1
  300. ttable.4.2 1
  301. ttable.5.3 1
  302. }
  303.  
  304.  
  305.  
  306. # aplay -D playvyniltest chan-id.wav
  307. # aplay -D playvyniltest "/home/brebs/gnutella/downloads/Cool/Bars in Pattaya.wav"
  308. pcm.playvyniltest {
  309. type plug
  310. slave.pcm "vyniltest"
  311. }
  312.  
  313. # Posted at http://64.233.183.104/search?q=cache:_zQy9QbX2mkJ:forums.gentoo.org/viewtopic-t-578294.html+vinyl+paulbredbury&hl=en&ct=clnk&cd=1&gl=uk&lr=lang_en
  314. # listplugins | grep -A 1 -i vynil
  315. # analyseplugin vynil_1905
  316. # Use via playvyniltest
  317. pcm.vyniltest {
  318. type ladspa
  319. slave.pcm default
  320. plugins {
  321. 0 {
  322. # id 1905 # VyNil (Vinyl Effect) (1905/vynil)
  323. label vynil
  324. input {
  325. # "Year" input, control, 1900 to 1990, default 1990
  326. # "RPM" input, control, 33 to 78, default 33
  327. # "Surface warping" input, control, 0 to 1, default 0
  328. # "Crackle" input, control, 0 to 1, default 0
  329. # "Wear" input, control, 0 to 1, default 0
  330. controls [ 1900 33 0.5 0.5 0.5 ]
  331. }
  332. }
  333. }
  334. }
  335.  
  336.  
  337.  
  338.  
  339. # http://alsa.opensrc.org/SurroundSound
  340. # http://alsa.opensrc.org/index.php/Low-pass_filter_for_subwoofer_channel_(HOWTO)
  341. # Arch Linux: pacman -S ladspa blop swh-plugins libsamplerate tap-plugins cmt
  342. # speaker-test -D upmix_20to51 -c 2 -t wav
  343. # listplugins
  344. # analyseplugin cmt
  345. # http://plugin.org.uk/ladspa-swh/docs/ladspa-swh.html
  346. # http://forums.gentoo.org/viewtopic-p-4528619.html#4528619
  347. pcm.lowpass_21to21 {
  348. type ladspa
  349. slave.pcm upmix_21to51
  350. #path "/usr/lib/ladspa"
  351. channels 3
  352. plugins {
  353. 0 {
  354. id 1098 # Identity (Audio) (1098/identity_audio)
  355. policy duplicate
  356. input.bindings.0 "Input";
  357. output.bindings.0 "Output";
  358. }
  359.  
  360. 1 {
  361. id 1052 # High-pass filter
  362. policy none
  363. input.bindings.0 "Input";
  364. output.bindings.0 "Output";
  365. input {
  366. controls [ 100 ]
  367. }
  368. }
  369.  
  370. 2 {
  371. id 1052 # High-pass filter
  372. policy none
  373. input.bindings.1 "Input";
  374. output.bindings.1 "Output";
  375. input {
  376. controls [ 100 ]
  377. }
  378. }
  379.  
  380. 3 {
  381. id 1051 # Low-pass filter.
  382. policy none
  383. input.bindings.2 "Input";
  384. output.bindings.2 "Output";
  385. input {
  386. controls [ 100 ]
  387. }
  388. }
  389.  
  390. }
  391. }
  392.  
  393.  
  394. # speaker-test -D upmix_20to51 -c 2 -t wav
  395. # In audacious: upmix_20to51
  396. pcm.upmix_20to51 {
  397. type plug
  398. slave.pcm "lowpass_21to21"
  399. #slave.channels 3
  400. ttable {
  401. 0.0 1 # left channel
  402. 1.1 1 # right channel
  403. 0.2 0.5 # mix left and right ...
  404. 1.2 0.5 # ... channel for subwoofer
  405. }
  406.  
  407. # slave.rate 48000 makes CPU utilization 20% instead of 3%
  408. # Can't hear the difference with Audigy4 anyway.
  409. # slave.rate 44100 is 3%, so that proves audacious outputs 44100
  410. #slave.rate 48000
  411. #converter "samplerate"
  412. # What's the syntax? slave.rate_converter "samplerate_best"
  413. }
  414.  
  415.  
  416. # In audacious: upmix_20to51_resample
  417. # aplay -D upmix_20to51_resample ~/alsa/samplerate-test/udial.wav
  418. pcm.upmix_20to51_resample {
  419. type rate
  420. slave {
  421. pcm upmix_20to51
  422. #format S32_LE
  423. # Audigy4 upmixes to 48000 itself, and seems to use low-quality linear interpolation
  424. rate 48000
  425. }
  426. # Choices: samplerate_best samplerate_medium samplerate samplerate_order samplerate_linear
  427. # 8% CPU with samplerate_medium - good choice
  428. converter "samplerate_medium"
  429. #converter "samplerate_linear"
  430. }
  431.  
  432. pcm.upmix_21to51 {
  433. type plug
  434. # For ice1724:
  435. #slave.pcm surround51-ice
  436. # For Audigy:
  437. slave.pcm surround51
  438. #slave.pcm 48k_best
  439. # For P5K ADI:
  440. #slave.pcm surround51-adi
  441. # Trying to pipe through Pulse Audio, to stop the clicks between songs.
  442. # Can't get Pulse Audio to work like this.
  443. #slave.pcm pulse
  444. # Don't need to specify the number of channels.
  445. slave.channels 6
  446. ttable {
  447. 0.0 1 # front left
  448. 1.1 1 # front right
  449. 0.2 1 # rear left
  450. 1.3 1 # rear right
  451.  
  452. # Front left/right to center.
  453. # Imbalanced because is to the left of the monitor!
  454. # Would normally be 0.5 each.
  455. 0.4 0.3
  456. 1.4 0.7
  457.  
  458. # Subwoofer, more powerful to compensate for bass-removal from other speakers.
  459. 2.5 2
  460. }
  461. }
  462.  
  463.  
  464.  
  465.  
  466. pcm.2to6 {
  467. type route
  468. slave {
  469. pcm "dmix51dup"
  470. channels 6
  471. }
  472.  
  473. ttable.0.0 1.0
  474. ttable.0.2 1.0
  475. ttable.0.4 0.5
  476. ttable.0.5 0.5
  477. ttable.1.1 1.0
  478. ttable.1.3 1.0
  479. ttable.1.4 0.5
  480. ttable.1.5 0.5
  481. }
  482.  
  483.  
  484.  
  485.  
  486. #pcm.!default {
  487. # type dmix
  488. # slave.channels 2
  489. # ttable {
  490. # 0.0 1 # left channel
  491. # 1.1 1 # right channel
  492. # }
  493. #}
  494.  
  495. # For ice1724, see http://alsa.opensrc.org/Dmix
  496. # Tech docs for M-Audio Revolution 5.1: http://seehuhn.de/pages/revolution
  497.  
  498. # Not used on its own. See surround51-ice.
  499. pcm.dmix6 {
  500. type dmix
  501. ipc_key 245 # Must be unique
  502. ipc_key_add_uid false
  503. # ipc_perm is probably not needed:
  504. # http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html
  505. ipc_perm 0660
  506. slave {
  507. pcm "hw:0,0"
  508. #rate 48000
  509. # Is 44100, to stop "clicks and pops" when changing songs in Audacious.
  510. rate 44100
  511. #format "S32_LE"
  512. channels 6
  513. period_time 0
  514. period_size 1024
  515. buffer_time 0
  516. # buffer_size of e.g. 2048, 4096, 5120, 8192, 16384, 32768.
  517. # Some apps may prefer different sizes - create a separate pcm for those.
  518. buffer_size 8192
  519. }
  520. }
  521.  
  522.  
  523.  
  524. # http://gentoo-wiki.com/HOWTO_Surround_Sound
  525. # 6 channel dmix:
  526. # From http://ubuntuforums.org/showthread.php?t=400268
  527. # Sound command for Pidgin: /usr/bin/aplay -D plug:surround51-ice %s
  528. # Darkplaces command-line: -sndpcm "plug:surround51-ice" -sndspeed 44100
  529. # Can still have nspluginwrapper blocking the soundcard, because it uses OSS!
  530. # Posted at http://forums.gentoo.org/viewtopic-p-4534793.html#4534793
  531. pcm.surround51-ice {
  532. slave.channels 6
  533. type route
  534. ttable.0.0 1
  535. ttable.1.1 1
  536. ttable.2.4 1
  537. ttable.3.5 1
  538. ttable.4.2 1
  539. ttable.5.3 1
  540. slave.pcm {
  541. type dmix
  542. ipc_key 25 # Must be unique
  543. ipc_key_add_uid false
  544. # ipc_perm is probably not needed:
  545. # http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html
  546. ipc_perm 0660
  547. slave {
  548. pcm "hw:0,0"
  549. #rate 48000
  550. # Is 44100, to stop "clicks and pops" when changing songs in Audacious.
  551. # Keeps the "Multi Track Internal Clock" in alsamixer at 44100 rather than 48000.
  552. rate 44100
  553. #format "S32_LE"
  554. channels 6
  555. period_time 0
  556. period_size 1024
  557. buffer_time 0
  558. # buffer_size of e.g. 2048, 4096, 5120, 8192, 16384, 32768.
  559. # Some apps may prefer different sizes - create a separate pcm for those.
  560. buffer_size 4096
  561. }
  562. }
  563. }
  564.  
  565.  
  566. # P5K onboard card
  567. # doom3 has buffer size problem with ad1988b - use oss in its autoexec.cfg
  568. pcm.surround51-adi {
  569. slave.channels 6
  570. type route
  571. ttable.0.0 1
  572. ttable.1.1 1
  573. ttable.2.2 1
  574. ttable.3.3 1
  575. ttable.4.4 1
  576. ttable.5.5 1
  577. slave.pcm {
  578. type dmix
  579. ipc_key 1078 # Must be unique
  580. ipc_key_add_uid false
  581. # ipc_perm is probably not needed:
  582. # http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html
  583. ipc_perm 0660
  584. slave {
  585. pcm "hw:0,0"
  586. #rate 48000
  587. # Is 44100, to stop "clicks and pops" when changing songs in Audacious.
  588. rate 44100
  589. #format "S32_LE"
  590. channels 6
  591. period_time 0
  592. period_size 1024
  593. buffer_time 0
  594. # buffer_size of e.g. 2048, 4096, 5120, 8192, 16384, 32768.
  595. # Some apps may prefer different sizes - create a separate pcm for those.
  596. buffer_size 4096
  597. }
  598. }
  599. }
  600.  
  601.  
  602.  
  603. # Playing with ice card
  604. pcm.surround51-doom3 {
  605. type route
  606. ttable.0.0 1
  607. ttable.1.1 1
  608. ttable.2.4 1
  609. ttable.3.5 1
  610. ttable.4.2 1
  611. ttable.5.3 1
  612. slave.pcm {
  613. type dmix
  614. ipc_key 1093 # Must be unique
  615. ipc_key_add_uid false
  616. ipc_perm 0660
  617. slave {
  618. pcm "hw:0,0"
  619. #rate 48000
  620. rate 44100
  621. #format "S32_LE"
  622. channels 6
  623. period_time 0
  624. period_size 1024
  625. buffer_time 0
  626. # Doom 3 wants buffer_size 8192
  627. # In ~/.doom3/base/autoexec.cfg
  628. # And ~/.quake4/q4base/autoexec.cfg
  629. # seta s_alsa_pcm "plug:surround51-doom3"
  630. buffer_size 8192
  631. }
  632. }
  633. }
  634.  
  635.  
  636.  
  637. # Examples:
  638. pcm.ice_spdif {
  639. type plug
  640. ttable.0.8 1 # S/PDIF left...Delta 9
  641. ttable.1.9 1 # S/PDIF right...Delta 10
  642. slave.pcm ice1712
  643. }
  644.  
  645. #pcm.!default {
  646. # type plug
  647. # slave.pcm ice_spdif
  648. #}
  649.  
  650.  
  651. # DOES NOT WORK, but might with some tweaks.
  652. # speaker-test -D surround70 -c 7 -t wav
  653. # http://forums.gentoo.org/viewtopic-p-4640690.html#4640690
  654. #pcm.surround70 {
  655. # type route
  656. # slave {
  657. # pcm "surround71"
  658. # channels 8
  659. # }
  660. # ttable.0.0 1.0
  661. # ttable.0.2 1.0
  662. # ttable.0.4 0.5
  663. # ttable.0.5 0.5
  664. # ttable.1.1 1.0
  665. # ttable.1.3 1.0
  666. # ttable.1.4 0.5
  667. # ttable.1.5 0.5
  668. #}
  669.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement