[pulseaudio-discuss] [PATCH] AC3 passthrough support

Tanu Kaskinen tanuk at iki.fi
Fri Jul 16 09:55:06 PDT 2010

On Fri, 2010-07-16 at 11:31 -0500, pl bossart wrote:
> >> +    PA_SINK_PASSTHROUGH = 0x0100U
> >> +    /**< The latency can be adjusted dynamically depending on the
> >> +     * needs of the connected streams. \since 0.9.22 */
> >> +
> >
> > Copy-paste mistake in the documentation.
> No this was done on purpose. We are already at 0.9.21 so the next
> version is logically 0.9.22?

I mean the actual content. It's copied from PA_SINK_DYNAMIC_LATENCY.

> > Also, PA_IDXSET_FOREACH can be used here. Or actually you don't need to
> > iterate through the set at all, you could just check the first input -
> > if that's a passthrough input, then it's the only input anyway, and if
> > it's not a passthrough input, then none of the inputs is a passthrough
> > input.
> Yes. I wrote some code but somehow I dropped it. Will fix it.
> > I wonder if we should return a more descriptive error in case the sink
> > is used by other streams. Returning just "invalid argument" doesn't
> > allow apps to give informative error messages. What do you think?
> Maybe adding an error code for passthrough connections would do.
> INVALID is too vague I guess?

PA_ERR_BUSY seems to exist already. I think it could be used here.

> > somewhere in pa_sink_input_new, and checks in protocol-native.c to
> > prevent that assertion from firing. That is, refuse to create
> > passthrough streams that also have volume specified by the client.
> I think it's better to ignore volume settings rather than refuse the connection?

If an application creates a passthrough stream, it should know that
setting the volume doesn't make sense. Making the stream creation fail
makes it obvious to the application writer that his code is broken.
(It's probably quite unlikely that any application would do that in the
first place, but that's beside the point.)

Anyway, currently the patch doesn't ignore the initial stream volume, so
if it's set, then the audio probably becomes corrupted.

Tanu Kaskinen

More information about the pulseaudio-discuss mailing list