Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Debugging: http://hg.alsa-project.org/alsa/raw-file/tip/alsa-info.sh
- # http://www.sabi.co.uk/Notes/linuxSoundALSA.html
- # echo 128 > /proc/asound/card0/pcm0p/sub0/prealloc
- # to allocate 128kbyte for playback, substream #0, stream #0 on the card #0
- # http://gentoo-wiki.com/HOWTO_Set_up_a_system-wide_equaliser_with_ALSA_and_LADSPA
- # Wiki article: http://gentoo-wiki.com/HOWTO_Compile_Kernel_with_ALSA
- # Soundcard recommendation: http://forums.gentoo.org/viewtopic-p-4192284.html#4192284
- # OSS info:
- # http://wiki.archlinux.org/index.php/OSS
- # Dunno whether this makes any difference.
- # http://www.alsa-project.org/alsa-doc/doc-php/template.php?company=Creative+Labs&card=Sound+Blaster+Live+5.1.&chip=emu10k1&module=emu10k1
- # http://www.alsa-project.org/alsa-doc/doc-php/template.php?company=VIA&card=.&chip=VIA82C686%2C+VIA8233%2C+VIA8233A%2C+VIA8235&module=via82xx
- # http://alsa.opensrc.org/index.php/Dmix
- # http://www.halfgaar.net/surround-sound-in-linux
- # speaker-test -D surround51 -c 6 -t wav
- # speaker-test -D doom -c 6 -t sine -r 44100
- # speaker-test -D plug:dmix6 -c 6 -t wav
- # http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html
- # http://www.volkerschatz.com/noise/alsa.html
- # This makes native ALSA apps default to using dmix.
- #pcm.!default {
- # type plug
- # slave.pcm "duplex"
- #}
- # Pulse Audio will eventually take over, to replace dmix.
- # http://www.pulseaudio.org/wiki/PerfectSetup
- # http://wiki.archlinux.org/index.php/PulseAudio
- pcm.pulse {
- type pulse
- }
- ctl.pulse {
- type pulse
- }
- # Works with aplay, but not speaker-test
- #pcm.!default {
- # type pulse
- #}
- #ctl.!default {
- # type pulse
- #}
- # From http://forums.gentoo.org/viewtopic-t-501671.html
- # Rubbish, don't use
- #pcm.!default {
- # type softvol
- # slave.pcm plughw
- # control.name PCM
- #}
- #pcm.emu10k1 {
- # type hw
- # card 0
- # slave.pcm surround51
- # slave.channels 6
- #}
- pcm.emu10k1 {
- type hw
- card 0
- }
- ctl.emu10k1 {
- type hw
- card 0
- }
- # Software mixing using dmix, 6 channels.
- # Doom3 needs rate 44100 rather than 48000
- # format S32_LE
- # hda-intel might benefit from: defaults.pcm.dmix_max_periods -1
- # https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3253
- #Set default sound card
- # Useful so that all settings can be changed to a different card here.
- #pcm.snd_card {
- # type hw
- # card 0
- # device 0
- #}
- pcm.jack {
- type jack
- playback_ports {
- 0 alsa_pcm:playback_1
- 1 alsa_pcm:playback_2
- }
- capture_ports {
- 0 alsa_pcm:capture_1
- 1 alsa_pcm:capture_2
- }
- }
- # Allow mixing of multiple output streams to this device
- # jackd -R -d alsa -r 44100
- #pcm.doom {
- # type plug
- # slave { pcm "jack" }
- #}
- # Bah, can only get 2 channels to work with speaker-test
- pcm.works {
- type dmix
- ipc_key 134 # Must be unique
- ipc_perm 0660 # Sound for everybody in your group!
- slave.pcm "snd_card"
- slave {
- # This stuff provides some fixes for latency issues.
- # buffer_size should be set for your audio chipset.
- period_time 0
- period_size 1024
- buffer_size 16384
- channels 6
- rate 44100
- }
- bindings {
- 0 0
- 1 1
- 2 2
- 3 3
- 4 4
- 5 5
- }
- }
- # This is what we want as our default device
- # a fully duplex (read/write) audio device.
- #pcm.duplex {
- # type asym
- # playback.pcm "output"
- #}
- # capture.pcm "input"
- ###################
- # CONVERSION PLUG #
- ###################
- # Setting the default pcm device allows the conversion
- # rate to be selected on the fly.
- # duplex mode allows any alsa enabled app to read/write
- # to the dmix plug (Fixes a problem with wine).
- #pcm.!default {
- # type plug
- # slave.pcm "duplex"
- #}
- # Apparently this is wrong (breaks mplayer for me opening the device)
- #ctl.!default {
- # type plug
- # slave.pcm "snd_card"
- #}
- ########
- # AOSS #
- ########
- # OSS dsp0 device (OSS needs only output support, duplex will break some stuff)
- #pcm.dsp0 {
- # type plug
- # slave.pcm "output"
- #}
- # OSS control for dsp0 (needed?...this might not be useful)
- #ctl.dsp0 {
- # type plug
- # slave.pcm "snd_card"
- #}
- ####
- #### As of November 2005 with the following packages:
- #### >=mozilla-firefox-1.0.7-r2, netscape-flash-7.0.25,
- #### alsa-oss-1.0.8-r1 and alsa-oss-1.0.10_rc3
- ####
- #### I have been experiencing crashes related to firefox when rendering flash.
- #### I used "aoss firefox" to start the browser.
- #### Commenting out the below ctl.mixer0 and using the above ctl.dsp0 allows
- #### firefox to render flash without crashing (and yes the aoss mixing works)
- #### However aoss Skype does not work properly without mixer0 under some configurations.
- ####
- # OSS control for dsp0 (default old OSS is mixer0)
- #ctl.mixer0 {
- # type plug
- # slave.pcm "snd_card"
- #}
- # For audacious: audio device: ch51dup
- # speaker-test -D ch51dup -c 2 -t wav
- # alsamixer settings for audigy:
- # surround: 0 (for proper surround sound in doom3)
- # side & pcm side: 0
- # Others: 70 or 100
- # Use 0.5 in ttable lines rather than 1, to stop crackling.
- # ttable.1.4 is centre speaker.
- pcm.ch51dup {
- slave.pcm surround51
- slave.channels 6
- type route
- # Front and rear
- ttable.0.0 0.5
- ttable.1.1 0.5
- ttable.2.2 0.5
- ttable.3.3 0.5
- # Center and LFE
- ttable.4.4 1
- ttable.5.5 1
- # Front left/right to center
- # Imbalanced because is to the left of the monitor!
- ttable.0.4 0.8
- ttable.1.4 0.2
- # Front left/right to rear
- ttable.0.2 0.5
- ttable.1.3 0.5
- }
- # Testing dmix to 48k, versus Audigy's internal remix to 48k.
- # Can't tell any difference. Not worth the CPU time.
- # http://forums.gentoo.org/viewtopic-t-576072.html
- # Audacious uses 14% of the CPU with "samplerate_best"!
- # Audacious uses 2-3% of the CPU with "samplerate"!
- # Seems to skip occasionally, though, with some songs.
- # See http://www.hydrogenaudio.org/forums/index.php?showtopic=47591&st=50
- # Had to recompile alsa-plugins in Arch, for it to use libsamplerate.
- # Choices: samplerate_best samplerate_medium samplerate_order samplerate_linear
- # From http://blog.flameeyes.eu/articles/2007/02/01/a-little-hint-for-alsa-hda-users
- #defaults.pcm.rate_converter "samplerate_best"
- #defaults.pcm.rate_converter "samplerate"
- # Need to recompile alsa-lib to include samplerate support, I think:
- # http://www.hydrogenaudio.org/forums/index.php?showtopic=47591&st=50
- # dmix by default only supports 2 channels at 48000
- # http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html
- pcm.dmix51dup {
- type plug
- slave {
- # To send to rear speakers also
- pcm ch51dup
- # Without rear speakers
- #pcm "hw:0,0"
- # For Audigy4 - crackles slightly with rate 96000
- #rate 96000
- rate 48000
- # For snd-hda-intel
- #rate 44100
- # http://alsa.opensrc.org/index.php/Playing_stereo_on_surround_sound_setup_%28Howto%29
- #period_time 0
- #period_size 1024
- #buffer_time 0
- #buffer_size 4096
- }
- }
- # Channels are wrong way round in doom! This fixes them.
- # http://www.linuxforen.de/forums/archive/index.php/t-206470.html
- # http://forums.seriouszone.com/showthread.php?t=49869&page=10
- # http://forums.gentoo.org/viewtopic-p-4173170.html#4173170
- # For Audigy 4
- # Weird, doom3 has crappy sound if I add an alsa rate converter.
- pcm.doom {
- slave.pcm surround51
- slave.channels 6
- type route
- ttable.0.0 1
- ttable.1.1 1
- ttable.2.4 1
- ttable.3.5 1
- ttable.4.2 1
- ttable.5.3 1
- }
- # aplay -D playvyniltest chan-id.wav
- # aplay -D playvyniltest "/home/brebs/gnutella/downloads/Cool/Bars in Pattaya.wav"
- pcm.playvyniltest {
- type plug
- slave.pcm "vyniltest"
- }
- # 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
- # listplugins | grep -A 1 -i vynil
- # analyseplugin vynil_1905
- # Use via playvyniltest
- pcm.vyniltest {
- type ladspa
- slave.pcm default
- plugins {
- 0 {
- # id 1905 # VyNil (Vinyl Effect) (1905/vynil)
- label vynil
- input {
- # "Year" input, control, 1900 to 1990, default 1990
- # "RPM" input, control, 33 to 78, default 33
- # "Surface warping" input, control, 0 to 1, default 0
- # "Crackle" input, control, 0 to 1, default 0
- # "Wear" input, control, 0 to 1, default 0
- controls [ 1900 33 0.5 0.5 0.5 ]
- }
- }
- }
- }
- # http://alsa.opensrc.org/SurroundSound
- # http://alsa.opensrc.org/index.php/Low-pass_filter_for_subwoofer_channel_(HOWTO)
- # Arch Linux: pacman -S ladspa blop swh-plugins libsamplerate tap-plugins cmt
- # speaker-test -D upmix_20to51 -c 2 -t wav
- # listplugins
- # analyseplugin cmt
- # http://plugin.org.uk/ladspa-swh/docs/ladspa-swh.html
- # http://forums.gentoo.org/viewtopic-p-4528619.html#4528619
- pcm.lowpass_21to21 {
- type ladspa
- slave.pcm upmix_21to51
- #path "/usr/lib/ladspa"
- channels 3
- plugins {
- 0 {
- id 1098 # Identity (Audio) (1098/identity_audio)
- policy duplicate
- input.bindings.0 "Input";
- output.bindings.0 "Output";
- }
- 1 {
- id 1052 # High-pass filter
- policy none
- input.bindings.0 "Input";
- output.bindings.0 "Output";
- input {
- controls [ 100 ]
- }
- }
- 2 {
- id 1052 # High-pass filter
- policy none
- input.bindings.1 "Input";
- output.bindings.1 "Output";
- input {
- controls [ 100 ]
- }
- }
- 3 {
- id 1051 # Low-pass filter.
- policy none
- input.bindings.2 "Input";
- output.bindings.2 "Output";
- input {
- controls [ 100 ]
- }
- }
- }
- }
- # speaker-test -D upmix_20to51 -c 2 -t wav
- # In audacious: upmix_20to51
- pcm.upmix_20to51 {
- type plug
- slave.pcm "lowpass_21to21"
- #slave.channels 3
- ttable {
- 0.0 1 # left channel
- 1.1 1 # right channel
- 0.2 0.5 # mix left and right ...
- 1.2 0.5 # ... channel for subwoofer
- }
- # slave.rate 48000 makes CPU utilization 20% instead of 3%
- # Can't hear the difference with Audigy4 anyway.
- # slave.rate 44100 is 3%, so that proves audacious outputs 44100
- #slave.rate 48000
- #converter "samplerate"
- # What's the syntax? slave.rate_converter "samplerate_best"
- }
- # In audacious: upmix_20to51_resample
- # aplay -D upmix_20to51_resample ~/alsa/samplerate-test/udial.wav
- pcm.upmix_20to51_resample {
- type rate
- slave {
- pcm upmix_20to51
- #format S32_LE
- # Audigy4 upmixes to 48000 itself, and seems to use low-quality linear interpolation
- rate 48000
- }
- # Choices: samplerate_best samplerate_medium samplerate samplerate_order samplerate_linear
- # 8% CPU with samplerate_medium - good choice
- converter "samplerate_medium"
- #converter "samplerate_linear"
- }
- pcm.upmix_21to51 {
- type plug
- # For ice1724:
- #slave.pcm surround51-ice
- # For Audigy:
- slave.pcm surround51
- #slave.pcm 48k_best
- # For P5K ADI:
- #slave.pcm surround51-adi
- # Trying to pipe through Pulse Audio, to stop the clicks between songs.
- # Can't get Pulse Audio to work like this.
- #slave.pcm pulse
- # Don't need to specify the number of channels.
- slave.channels 6
- ttable {
- 0.0 1 # front left
- 1.1 1 # front right
- 0.2 1 # rear left
- 1.3 1 # rear right
- # Front left/right to center.
- # Imbalanced because is to the left of the monitor!
- # Would normally be 0.5 each.
- 0.4 0.3
- 1.4 0.7
- # Subwoofer, more powerful to compensate for bass-removal from other speakers.
- 2.5 2
- }
- }
- pcm.2to6 {
- type route
- slave {
- pcm "dmix51dup"
- channels 6
- }
- ttable.0.0 1.0
- ttable.0.2 1.0
- ttable.0.4 0.5
- ttable.0.5 0.5
- ttable.1.1 1.0
- ttable.1.3 1.0
- ttable.1.4 0.5
- ttable.1.5 0.5
- }
- #pcm.!default {
- # type dmix
- # slave.channels 2
- # ttable {
- # 0.0 1 # left channel
- # 1.1 1 # right channel
- # }
- #}
- # For ice1724, see http://alsa.opensrc.org/Dmix
- # Tech docs for M-Audio Revolution 5.1: http://seehuhn.de/pages/revolution
- # Not used on its own. See surround51-ice.
- pcm.dmix6 {
- type dmix
- ipc_key 245 # Must be unique
- ipc_key_add_uid false
- # ipc_perm is probably not needed:
- # http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html
- ipc_perm 0660
- slave {
- pcm "hw:0,0"
- #rate 48000
- # Is 44100, to stop "clicks and pops" when changing songs in Audacious.
- rate 44100
- #format "S32_LE"
- channels 6
- period_time 0
- period_size 1024
- buffer_time 0
- # buffer_size of e.g. 2048, 4096, 5120, 8192, 16384, 32768.
- # Some apps may prefer different sizes - create a separate pcm for those.
- buffer_size 8192
- }
- }
- # http://gentoo-wiki.com/HOWTO_Surround_Sound
- # 6 channel dmix:
- # From http://ubuntuforums.org/showthread.php?t=400268
- # Sound command for Pidgin: /usr/bin/aplay -D plug:surround51-ice %s
- # Darkplaces command-line: -sndpcm "plug:surround51-ice" -sndspeed 44100
- # Can still have nspluginwrapper blocking the soundcard, because it uses OSS!
- # Posted at http://forums.gentoo.org/viewtopic-p-4534793.html#4534793
- pcm.surround51-ice {
- slave.channels 6
- type route
- ttable.0.0 1
- ttable.1.1 1
- ttable.2.4 1
- ttable.3.5 1
- ttable.4.2 1
- ttable.5.3 1
- slave.pcm {
- type dmix
- ipc_key 25 # Must be unique
- ipc_key_add_uid false
- # ipc_perm is probably not needed:
- # http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html
- ipc_perm 0660
- slave {
- pcm "hw:0,0"
- #rate 48000
- # Is 44100, to stop "clicks and pops" when changing songs in Audacious.
- # Keeps the "Multi Track Internal Clock" in alsamixer at 44100 rather than 48000.
- rate 44100
- #format "S32_LE"
- channels 6
- period_time 0
- period_size 1024
- buffer_time 0
- # buffer_size of e.g. 2048, 4096, 5120, 8192, 16384, 32768.
- # Some apps may prefer different sizes - create a separate pcm for those.
- buffer_size 4096
- }
- }
- }
- # P5K onboard card
- # doom3 has buffer size problem with ad1988b - use oss in its autoexec.cfg
- pcm.surround51-adi {
- slave.channels 6
- type route
- ttable.0.0 1
- ttable.1.1 1
- ttable.2.2 1
- ttable.3.3 1
- ttable.4.4 1
- ttable.5.5 1
- slave.pcm {
- type dmix
- ipc_key 1078 # Must be unique
- ipc_key_add_uid false
- # ipc_perm is probably not needed:
- # http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html
- ipc_perm 0660
- slave {
- pcm "hw:0,0"
- #rate 48000
- # Is 44100, to stop "clicks and pops" when changing songs in Audacious.
- rate 44100
- #format "S32_LE"
- channels 6
- period_time 0
- period_size 1024
- buffer_time 0
- # buffer_size of e.g. 2048, 4096, 5120, 8192, 16384, 32768.
- # Some apps may prefer different sizes - create a separate pcm for those.
- buffer_size 4096
- }
- }
- }
- # Playing with ice card
- pcm.surround51-doom3 {
- type route
- ttable.0.0 1
- ttable.1.1 1
- ttable.2.4 1
- ttable.3.5 1
- ttable.4.2 1
- ttable.5.3 1
- slave.pcm {
- type dmix
- ipc_key 1093 # Must be unique
- ipc_key_add_uid false
- ipc_perm 0660
- slave {
- pcm "hw:0,0"
- #rate 48000
- rate 44100
- #format "S32_LE"
- channels 6
- period_time 0
- period_size 1024
- buffer_time 0
- # Doom 3 wants buffer_size 8192
- # In ~/.doom3/base/autoexec.cfg
- # And ~/.quake4/q4base/autoexec.cfg
- # seta s_alsa_pcm "plug:surround51-doom3"
- buffer_size 8192
- }
- }
- }
- # Examples:
- pcm.ice_spdif {
- type plug
- ttable.0.8 1 # S/PDIF left...Delta 9
- ttable.1.9 1 # S/PDIF right...Delta 10
- slave.pcm ice1712
- }
- #pcm.!default {
- # type plug
- # slave.pcm ice_spdif
- #}
- # DOES NOT WORK, but might with some tweaks.
- # speaker-test -D surround70 -c 7 -t wav
- # http://forums.gentoo.org/viewtopic-p-4640690.html#4640690
- #pcm.surround70 {
- # type route
- # slave {
- # pcm "surround71"
- # channels 8
- # }
- # ttable.0.0 1.0
- # ttable.0.2 1.0
- # ttable.0.4 0.5
- # ttable.0.5 0.5
- # ttable.1.1 1.0
- # ttable.1.3 1.0
- # ttable.1.4 0.5
- # ttable.1.5 0.5
- #}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement