[pulseaudio-discuss] Making Stereo Stream play over 5.1 speaker system

Chuck Rudolphy chuck at ccrudolphy.net
Sat Dec 1 08:25:32 PST 2007


Before using any kind of a sound server, I successfully ran an .asoundrc
that copied the left-front and right-front channels to the right-rear,
left-rear, center, and lfe channels.  This way I could play stereo
sources to all of my 5.1 speaker system (I was always successful getting
a stereo stream to play right-front/left-front.)  Since installing
pulseaudio, I have not been able to figure out the syntax within
default.pa to create this same setup.  I have successfully gotten
mplayer to play 5.1 sound (commercial DVD) correctly, and currently
stereo source does play right-front/left-front.  I want to tackle this
stereo issue, then I will move on to flash.

Is it possible to do this?  If so could someone help me with the
appropriate syntax?

As a side note: gmplayer works fine using the below.  smplayer does not.
It appears that smplayer does not read mplayer.conf and specifically the
"ao=" directive (which I have set to "ao=pulse".  It assumes and starts
mplayer with the directive "ao=alsa".  Even if you pass the directive
through smplayer's preferences "mplayer -ao 'pulse' " it appears to
overwrite this later in it's startup command with "ao=alsa".  

Some details:

Ubuntu 7.1 Gutsy Gibbon amd64
Creative SB Audigy LS (7.1) (CA0106)

/etc/asound.conf

        # Part I directly from ALSA Dmix Wiki
        
        pcm.chuck { # paul is my name, you can use your name, just make
        sure you use it below too
            type dmix
            ipc_key 1024
            slave {
                pcm "hw:0,0"     
                period_time 0
                period_size 1024
                buffer_size 8192
               #format "S32_LE"
               #periods 128
                rate 44100
            }
        }
        
        pcm.dsp0 {
            type plug
            slave.pcm "chuck"
        }
        
        # This following device can fool some applications into using
        pulseaudio
        pcm.dsp1 {
            type plug
            slave.pcm "pulse"
        }
        
        ctl.mixer0 {
            type hw
            card 0
        }
        
        # Part II directly from Pulseaudio Wiki 
        pcm.pulse {
            type pulse
        }
        
        ctl.pulse {
            type pulse
        }
        
        pcm.!default {
            type pulse
        }
        
        ctl.!default {
            type pulse
        }
        
/etc/pulse/default.pa

        #!/usr/bin/pulseaudio -nF 
        
        #
        # This file is part of PulseAudio.
        #
        # PulseAudio is free software; you can redistribute it and/or
        modify it
        # under the terms of the GNU Lesser General Public License as
        published by
        # the Free Software Foundation; either version 2 of the License,
        or
        # (at your option) any later version.
        #
        # PulseAudio is distributed in the hope that it will be useful,
        but
        # WITHOUT ANY WARRANTY; without even the implied warranty of
        # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
        GNU
        # General Public License for more details.
        #
        # You should have received a copy of the GNU Lesser General
        Public License
        # along with PulseAudio; if not, write to the Free Software
        Foundation,
        # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
        
        
        ### Load audio drivers statically
        # load-module module-alsa-sink device=hw:0 
        load-module module-alsa-sink device=surround51:0 channels=6
        
        #load-module module-alsa-sink device=front:0 sink_name=front
        channels=2
        #load-module module-alsa-sink device=rear:0 sink_name=rear
        channels=2
        #load-module module-combine sink_name=upmix master=front
        slaves=rear channels=4
        # load-module module-alsa-source device=hw:0
        #load-module module-oss device="/dev/dsp" sink_name=output
        source_name=input
        #load-module module-oss-mmap device="/dev/dsp" sink_name=output
        source_name=input
        #load-module module-null-sink
        #load-module module-pipe-sink
        
        .ifexists /usr/lib/pulse-0.9/modules/module-hal-detect.so
        
        ### Automatically load driver modules depending on the hardware
        available
        load-module module-hal-detect
        
        .else
        
        ### Alternatively use the static hardware detection module (for
        systems that
        ### lack HAL support
        load-module module-detect
        
        .endif
        
        ### Load audio drivers automatically on access
        #add-autoload-sink output module-oss device="/dev/dsp"
        sink_name=output source_name=input
        #add-autoload-source input module-oss device="/dev/dsp"
        sink_name=output source_name=input
        #add-autoload-sink output module-oss-mmap device="/dev/dsp"
        sink_name=output source_name=input
        #add-autoload-source input module-oss-mmap device="/dev/dsp"
        sink_name=output source_name=input
        #add-autoload-sink output module-alsa-sink sink_name=output
        #add-autoload-source input module-alsa-source source_name=input
        
        .ifexists /usr/lib/pulse-0.9/modules/module-esound-protocol-unix.so
        
        ### Load esound protocol
        load-module module-esound-protocol-unix
        
        .endif
        
        ### Load native protocol
        load-module module-native-protocol-unix
        
        ### Network access (may be configured with paprefs, so leave
        this commented
        ### here if you plan to use paprefs)
        #load-module module-esound-protocol-tcp
        #load-module module-native-protocol-tcp
        #load-module module-zeroconf-publish
        
        ### Load the RTP reciever module (also configured via paprefs,
        see above)
        #load-module module-rtp-recv
        
        ### Load the RTP sender module (also configured via paprefs, see
        above)
        #load-module module-null-sink sink_name=rtp format=s16be
        channels=2 rate=44100 description="RTP Multicast Sink"
        #load-module module-rtp-send source=rtp.monitor
        
        ### Automatically restore the volume of playback streams
        load-module module-volume-restore
        
        ### Automatically move streams to the default sink if the sink
        they are
        ### connected to dies, similar for sources
        load-module module-rescue-streams
        
        ### Make some devices default
        #set-default-sink output
        #set-default-source input
        
        .nofail
        
        ### Load something to the sample cache
        load-sample x11-bell /usr/share/sounds/gtk-events/activate.wav
        #load-sample-dir-lazy /usr/share/sounds/*.wav
        
        ### Load X11 bell module
        load-module module-x11-bell sample=x11-bell
        
        ### Publish connection data in the X11 root window
        load-module module-x11-publish
        
        ### Load additional modules from GConf settings. This can be
        configured with the paprefs tool.
        ### Please keep in mind that the modules configured by paprefs
        might conflict with manually
        ### loaded modules.
        load-module module-gconf

Previously used .asoundrc

        pcm.!default {
        	slave.pcm "surround51"
        	slave.channels 6
        	type route
        	ttable.0.0 1
        	ttable.1.1 1
        	ttable.0.2 1
        	ttable.1.3 1
        	ttable.0.4 0.5
        	ttable.1.4 0.5
        	ttable.0.5 0.5
        	ttable.1.5 0.5
        }
        
        pcm.analog {
        	type plug
        	slave analog_slave
        }
        
        pcm_slave.analog_slave {
        	pcm surround51
        	formate S16_LE
        }
        




More information about the pulseaudio-discuss mailing list