[pulseaudio-discuss] Sink's Default Sample Rate is Changing?

Alexander E. Patrakov patrakov at gmail.com
Thu Apr 2 12:41:27 PDT 2015


03.04.2015 00:36, Andrew Kelley wrote:
> I discovered a curiosity:
>
> $ play ~/tmp/44100hz.wav
> $ ./list_devices
> playback device: 44100 Hz Built-in Audio Analog Stereo (default)
> $ play ~/tmp/48000hz.wav
> $ ./list_devices
> playback device: 48000 Hz Built-in Audio Analog Stereo (default)
> $ play ~/tmp/99999hz.wav
> playback device: 44100 Hz Built-in Audio Analog Stereo (default)
>
>
> In other words, PulseAudio changes the default sample rate of my
> playback device when I open it with a different sample rate. But if I
> open the playback device with a weird sample rate such as 99999Hz then
> PulseAudio changes the default sample rate to 44100Hz. When I say
> default sample rate, I mean when I query for the list of sinks with the
> API and look at the sample_spec.
>
> I'm trying to understand this phenomenon. Can anyone shed some light on
> this?

For non-passthrough streams, PulseAudio always opens the sink either 
with the default or with alternate sample rate. These rates can be 
configured when loading module-alsa-sink, and there are also global 
defaults in /etc/pulse/daemon.conf. The defaults are 44100 and 48000 Hz.

The code that chooses whether to use the default or alternate sample 
rate is in the pa_sink_update_rate() function, in src/pulsecore/sink.c.

-- 
Alexander E. Patrakov


More information about the pulseaudio-discuss mailing list