[pulseaudio-discuss] Emulate Alsa A52 plugin in pulseaudio ?

Jim Duda jim at duda.tzo.com
Thu Feb 28 18:36:20 PST 2008


Unfortunately, using a52encode as a device doesn't seem to work.  I 
tried by a52encode and a52.

lroom# /usr/bin/pulseaudio --system
ALSA lib control.c:909:(snd_ctl_open_noupdate) Invalid CTL surround51:0
W: alsa-util.c: Unable to attach to mixer surround51:0: No such file or 
directory
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM a52encode
E: module-alsa-sink.c: Error opening PCM device a52encode: No such file 
or directory
E: module.c: Failed to load  module "module-alsa-sink" (argument: 
"sink_name=ac3_encode device=a52encode rate=48000 channels=6"): 
initialization failed.
E: main.c: Module load failed.
E: main.c: failed to initialize daemon.

lroom# /usr/bin/pulseaudio --system
ALSA lib control.c:909:(snd_ctl_open_noupdate) Invalid CTL surround51:0
W: alsa-util.c: Unable to attach to mixer surround51:0: No such file or 
directory
ALSA lib pcm.c:2144:(snd_pcm_open_noupdate) Unknown PCM a52
E: module-alsa-sink.c: Error opening PCM device a52: No such file or 
directory
E: module.c: Failed to load  module "module-alsa-sink" (argument: 
"sink_name=ac3_encode device=a52 rate=48000 channels=6"): initialization 
failed.
E: main.c: Module load failed.
E: main.c: failed to initialize daemon.

default.pa:

load-module module-alsa-sink sink_name=ac3_raw device=surround51:0 
rate=48000 channels=6
load-module module-alsa-sink sink_name=ac3_encode device=a52encode:0 
rate=48000 channels=6

.asoundrc

pcm.a52encode {
     type a52
}

pcm.front-spdif {
     type plug
     slave.pcm "iec958"
}

pcm.ac3_raw {
     type pulse
     device ac3_raw
}

pcm.ac3_encode {
     type pulse
     device ac3_encode
}




Jim Duda wrote:
> Tanu,
> 
> Okay, what you are describing makes sense.  We route the 6 channels back through alsa and the a52 encoding, then out the 
> actual device driver.
> 
> The front-spdif was leftover stuff in my asoundrc file.
> 
> I also need to send the raw AC3, DTS stream from some applications to the external digital decoder (mplayer and xine). 
> Currently, I do this by using alsa:device=spdif in the applications which require this mode, instead of the stereo 
> upmix.
> 
> So, to accomplish this, do I define two alsa-sinks?
> 
> module-load module-alsa-sink sink_name=ac3_out device=a52encode channels=6 rate=48000
> module-load module-alsa-size sink_name=ac3_raw device=surround51:0
> 
> Then my .asoundrc has this:
> 
> pcm.!default {
>    type pulse
>    device ac3_out
> }
> 
> pcm.passthrough {
>   type pulse
>   device ac3_raw
> }
> 
> pcm.a52encode {
>    type a52
> }
> 
> The default would do stereo upmix from 2 to 6 channels through a52 encoder.
> 
> The passthrough would send the raw ac3/dts stream out the hardware.
> 
> Does this make sense?  (I would test now, but I have to go off and build 0.9.8 first, since FC7 uses 0.9.6 currently).
> 
> Thanks,
> 
> Jim
> 
> 
> "Tanu Kaskinen" <tanuk at iki.fi> wrote in message news:20080228205506.GA11317 at a9a.mannikko1.tontut.fi...
>> On Thu, Feb 28, 2008 at 03:09:45PM -0500, Jim Duda wrote:
>>> I would like to use pulseaudio on a machine which I have the sound card attached to an digital decoder.  I'm using 
>>> the
>>> alsa A52 plugin to perform a stereoupmix from 2 channels to six channels such that I get the same stereo out of the
>>> front and rear speakers.
>>> Can I use the remap module to copy 2 channels to 4?  The front speaker and sub woofer would be nice too.
>> Yes you can, but there shouldn't be need for that. Since
>> 0.9.8 PulseAudio has supported automatic up- and downmixing,
>> which probably does what you want. If you have 0.9.8 and it
>> still doesn't work, check that you haven't disabled the
>> feature in daemon.conf by saying disable-remixing=yes.
>>
>> If I've understood your setup correctly, you would need to
>> encode the output of PulseAudio to AC-3. I don't have any
>> experience in that field, so the following is just my best
>> guess how it would work:
>>
>> Your new ~/.asoundrc:
>>
>> pcm.!default {
>>    type pulse
>> }
>>
>> pcm.a52encode {
>>    type a52
>> }
>>
>> # What's this for?
>> pcm.front-spdif {
>>    type plug
>>    slave.pcm "iec958"
>> }
>>
>>
>> Comment out module-hal-detect and module-detect in
>> /etc/pulse/default.pa. Add this line instead:
>> module-load module-alsa-sink sink_name=ac3_out device=a52encode channels=6 rate=48000
>>
>> -- 
>> Tanu Kaskinen 




More information about the pulseaudio-discuss mailing list