[pulseaudio-discuss] Monitoring and Pulseaudio accuracy

Tanu Kaskinen tanuk at iki.fi
Tue Dec 1 09:43:23 PST 2009


ma, 2009-11-30 kello 19:51 +0000, Neil Wilson kirjoitti:
> 2009/11/30 Tanu Kaskinen <tanuk at iki.fi>:
> 
> > Are you sure your files had the same sample format as what your sound
> > card uses? If pulseaudio doesn't need to do mixing or resampling or
> > sample format conversion, I'm surprised if the bytes are touched.
> 
> No they definitely aren't. That's part of the question I suppose. When
> does the format get changed?

If your source material matches exactly the sample spec of the target
sink, the format doesn't get changed. Otherwise the format changes when
the sink wants to read a chunk of audio from the stream, which happens
before resampling and mixing (well, resampling happens sort of
simultaneously with the read from the stream). Until that point the
stream stores the data in the original format.

> What's the best format to start off in if
> you're going out via SPDIF to digital speakers. Is it best to start
> off in the sample spec of your sink

Yes.

> , or do you have to take the mixer
> into account?

Mixing happens in the sink, so the working format for mixing is the
format of the sink (ie. the sound card's native format).

> And what is the source of the Monitor's output tap. Is it before it
> gets to the sink native driver, or does it actually go to the sound
> card hardware before coming back?

No, it doesn't get to the hardware. Immediately after a chunk of audio
has been rendered, ie. mixed (if there's just one stream, no mixing is
done), the rendered chunk is sent to the monitor source.

> Certainly it looks like the float32le was converted to s16le before
> being converted back in the Monitor output. However nothing in the
> pulseaudio log suggested what the conversion would be or when.

If the sink's sample spec is s16le, then the monitor's sample spec is
the same. If your record stream uses some other format, the conversion
from s16le is done when the data is pushed to the record stream.

-- 
Tanu Kaskinen




More information about the pulseaudio-discuss mailing list