When using the h2n as USB mic and playback device, it displays 44.1khz as sample rate.
When pulseaudio restarts, it is detected correctly (pacmd list-sinks): sample spec: s16le 2ch 44100Hz
Now I start playing a video on youtube and while it plays, turn the "Profile" of it in "pavucontrol" -> "Configuration" to "off" and back to "Analog Stereo Duplex". Now pulseaudio tells me: sample spec: s16le 2ch 48000Hz
On a fresh system start it's even enough to just open pavucontrol to cause the wrong sampling rate.
Which results in a pitched output with a lot of crackling.
Stuff I have tried:
1.
Make the following changes to ~/.config/pulse/daemon.conf:
default-sample-rate = 44100 avoid-resampling = yes as suggested in another question (Setting different per-device sampling rates in pulseaudio?) and in https://wiki.archlinux.org/index.php/PulseAudio/Troubleshooting
2.
put
pcm.device{ format S16_LE rate 41000 type hw card 0 device 0 } pcm.!default{ type plug slave.pcm "device" } into ~/.asoundrc and logging out and back in. (https://unix.stackexchange.com/a/141234/227331)
3.
put
pcm.!default { type rate slave { pcm "plughw:0,0" rate 44100 } } into ~/.asoundrc as suggested here: https://bbs.archlinux.org/viewtopic.php?pid=400718#p400718 and rebooting.
4.
pactl list sinks | grep -oP "(?<=device.string = \")(.*)(?=\")" | while read in; do pasuspender -- speaker-test --nloops=1 --channels=2 --test=wav --device=$in; done as suggested in https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/Users/Troubleshooting/ sounds good. Afterwards firefox will resume with crackling noises.