Setting different per-device sampling rates in pulseaudio

audiopulseaudio

My Audio Devices

  • Input: Logitech C310 webcam mic (16kHz)
  • Output: Sony MBH20 Bluetooth headset (44.1kHz) in High Fidelity Playback (A2DP Sink) mode

My Problem

With the default PulseAudio settings, the bluetooth headset sounds excellent,
but recordings over the webcam mic are high-pitched and sped up, like an Alvin
and the Chipmunks recording.

If I configure PulseAudio to set the sampling rate to 16kHz,

# /etc/pulse/daemon.conf

default-sample-rate = 16000

then the webcam works perfectly, but the sound quality through the headset is
severely degraded.

My questions

  • Is there any way to configure the sampling rate for only a single source?
  • pacmd list-sources erroneously reports the sampling rate of the webcam mic
    as 48kHz (sample spec: s16le 1ch 48000Hz). Could that be the problem? If
    so, is there any way to manually change the sample spec? If not, does this
    qualify as a bug that should be reported to the pulseaudio maintainers?
  • or is there another fix to this problem that I’m not seeing?

Best Answer

You could try setting

   default-sample-rate = 44100
   alternate-sample-rate = 16000

and/or

   avoid-resampling = yes

if you have pulseaudio version >= 11.

In Pulseaudio 13 there may be even more options, see here

I think it is good to make a bug report about this issue and link it in a comment.

Related Question