[pulseaudio-discuss] {PATCH][RFC] AC3 passthrough support

Michael Rans rans at email.com
Sat Jul 10 07:52:25 PDT 2010


Further to my previous message, I tried:
//    pa_sink_set_max_rewind(u->sink, u->hwbuf_size);
    pa_sink_set_max_rewind(u->sink, 0);

That seemed to fix it, although I fear it will break any other Alsa sinks. Is 
there a better way to implement this?

Interestingly, I then no longer need tiemout=0 here:
load-module module-suspend-on-idle

But I still need to go via the rate converter to the a52 encoder in asoundrc.


From: Michael Rans <mcarans at yahoo.co.uk>
To: General PulseAudio Discussion <pulseaudio-discuss at mail.0pointer.de>
Sent: Sat, 10 July, 2010 14:24:02
Subject: Re: [pulseaudio-discuss] {PATCH][RFC] AC3 passthrough support


Thanks for your reply both to my message and the bug I posted.

I tried Colin's patch, but it didn't work for me.

I tried the following evil hack in alsa-sink.c:
        out_frames = snd_pcm_rewind(u->pcm_handle, (snd_pcm_uframes_t) 
        if (out_frames < 0) {
            out_frames = -out_frames;
/*        if ((out_frames = snd_pcm_rewind(u->pcm_handle, (snd_pcm_uframes_t) 
in_frames)) < 0) {
            pa_log("snd_pcm_rewind() failed: %s", pa_alsa_strerror((int)  
            if (try_recover(u, "process_rewind", out_frames) < 0)
                return -1;
            out_frames = 0;

The sound played but very very fast in Oolite, so I would say it almost worked.

I can't find any definition of snd_pcm_rewind() in the alsa-plugins source code. 
Does this function call through to a function in the plugins?

I understand that there a function snd_pcm_hw_params_can_rewind which I would 
guess should return false for AC3 encoding - is this called by Pulseaudio?


From: Tanu Kaskinen <tanuk at iki.fi>
To: pulseaudio-discuss at mail.0pointer.de
Sent: Sat, 10 July, 2010 11:13:13
Subject: Re: [pulseaudio-discuss] {PATCH][RFC] AC3 passthrough support

On Sat, 2010-07-10 at 08:05 +0000, Michael Rans wrote:
> Even with these "hacks", I found that sometimes I see:
> I: module.c: Unloading "module-alsa-sink" (index: #4).
> D: module-always-sink.c: Autoloading null-sink as no other sinks
> detected.
> After I see that, the sink disappears and cannot be selected any more
> in sound properties.
> 1. Does the ac3-iec958 profile resolve any of these issues?

What's "the ac3-iec958  profile"? The iec958-ac3-surround-* mappings that
currently exist in pulseaudio use the a52 alsa plugin, which may or may
not work with Colin's patch[1]. (It didn't work for Colin.)

> 2. Jack has ac3jack. What would be the pros and cons of doing the AC3
> encoding in Pulseaudio instead of in Alsa?

I think it would make sense to do AC3 encoding in Pulseaudio, although
in theory I don't see what difference it would make. Maybe it's somehow
benefical to handle all the buffering inside Pulseaudio. If there are
timing related bugs in the a52 plugin, as Colin seems to think there
are, then it's also a matter of who volunteers first: a person who knows
how to fix the a52 plugin, or a person who knows how to hack AC3
encoding support into Pulseaudio.

[1] https://tango.0pointer.de/pipermail/pulseaudio-discuss/2010-June/007311.html

Tanu Kaskinen

pulseaudio-discuss mailing list
pulseaudio-discuss at mail.0pointer.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20100710/b331d81d/attachment.htm>

More information about the pulseaudio-discuss mailing list