You are not logged in.

#1 2017-05-02 13:08:01

OlliC
Member
Registered: 2015-09-28
Posts: 18

[SOLVED] Audio distortion when opening pavucontrol

Hi,

i still have this one problem with my audio setup for years now and i finally try to figure out whats the problem.

So i have two soundcards. One integrated Realtek ALC892 which uses the snd_hda_intel driver and
one external USB soundcard (M-Audio MobilePre MK2 with some KRK Rokit 6 connected) which uses the snd_usb_audio driver.

Whenever i play something on the usb soundcard (source does not matter) and
open the pavucontrol tool the sound gets immediatly distorted. This does not stop until i restart pulseaudio (with pulseaudio -k).

This does NOT happen on the integrated realtek soundcard. So i believe this is a bug in the snd_usb_audio driver.

When i play something on the integrated card, open pavucontrol, then switch the output of sink input to the usb soundcard there is no distortion.
When i close and reopen pavucontrol then the sound gets distorted again.

Btw the same thing also applies when i open the Gnome audio settings instead of pavucontrol (I use Gnome 3 as my DE).

What i have tried so far:

- Disabling Timer-based scheduling with tsched=0 (makes no difference, same problem)
- Adding intel_iommu=igfx_off to kernel options (makes no difference, same problem) 

Edit: Just did some more tests and i found something out.
This seem to happen only on 48kHz. On sources with 44.1kHz there is no distortion. Resample method was copy in both cases. So native playback without resampling.
Didn't noticed this before because i mostly tested with video files in smplayer/mpv or youtube videos in firefox which have 48kHz.

Last edited by OlliC (2017-06-26 13:52:06)

Offline

#2 2017-06-22 15:54:41

wixtb0t
Member
Registered: 2015-04-04
Posts: 5

Re: [SOLVED] Audio distortion when opening pavucontrol

I can confirm that I have had a similar issue using USB soundcard Focusrite Scarlett 2i2 2nd gen. Though this may be fixed now.
The distortion happens randomly after some time of working audio. I have noticed this with telegram-desktop-bin from AUR and Dota2 from
steam at least, but pavucontrol works flawlessly.

Like for OlliC, restarting pulseaudio fixes the problem.
The problem may have disappeared recently, but due to random nature of the distortion appearing I'm not sure.
On my system it's definitely not as common as it was in May.

OlliC can you comment on this?

Offline

#3 2017-06-22 21:40:02

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] Audio distortion when opening pavucontrol

Have you checked which profile pulse/pavucontrol selects for the usb soundcard? I have an usb soundcard/dac which also uses the snd-usb-audio driver and I have no problems but I have set it specifically as a playback only device.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#4 2017-06-22 22:15:44

OlliC
Member
Registered: 2015-09-28
Posts: 18

Re: [SOLVED] Audio distortion when opening pavucontrol

Hey,

thanks for answering. Well the distortion don't happen randomly in my case. Only when opening pavucontrol. So this might be another bug in your case.

As for the profile its "Analog Stereo Duplex". I can't set it to Playback only because i have also a microphone connected. But i will test if that makes a difference.

Last edited by OlliC (2017-06-22 22:16:48)

Offline

#5 2017-06-25 19:39:49

OlliC
Member
Registered: 2015-09-28
Posts: 18

Re: [SOLVED] Audio distortion when opening pavucontrol

R00KIE wrote:

Have you checked which profile pulse/pavucontrol selects for the usb soundcard? I have an usb soundcard/dac which also uses the snd-usb-audio driver and I have no problems but I have set it specifically as a playback only device.

So i have checked that now and it seems thats the case here too. I set the Profile from the M-Audio MobilePre soundcard to Analog Stereo Output and the distortion is gone when opening pavucontrol. If i set it back to Analog Stereo Duplex the old behavior is back. Strange thing. Unfortunatly i use the inputs also for a microphone so cant set it to output only.

To sum it up the distortion happens when:

- Playing back at 48 kHz
- Profile set to Analog Stereo Duplex
- Opening Pavucontrol

Maybe someone has a clue what it could be?

Offline

#6 2017-06-25 19:52:47

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] Audio distortion when opening pavucontrol

Maybe just bad quality hardware. I suggested you test the recording idea because I've experienced something similar with a cheap usb soundcard, I would get noise on the output every time I would open pavucontrol and the profile was set for Analog Stereo Duplex.

You could try to use something else to control the volumes such as alsamixer, you should be able to create shortcuts that open the playback and recording panes directly and it shouldn't interfere or get in the way.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#7 2017-06-25 21:47:34

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,657

Re: [SOLVED] Audio distortion when opening pavucontrol

Using alsamixer to try and control card volume that is controlled by pulseaudio at the same time  can lead to all sorts of unexpected behaviour.

The likely cause of this is that pavucontrol opens up a "listening source" (to show the peak bars) on the mics/monitor of your card, which likely produces a conflict with your card (playback happens with 48KHz -> pavucontrol opens up all these peak sources -> your mic starts recording at 44KHz -> your hardware is confused because it suddenly has to drive a 44KHz and a 48KHz stream)

A few things you might want to try:

  • Somewhat of a whack idea but might work :

    PULSE_LATENCY_MSEC=60 pavucontrol

    just up the latency of the polling pavucontrol sources, maybe that alleviates the issue.

  • Swap the default and alternate sampling rates in /etc/pulse/daemon.conf , maybe the issue doesn't happen on the reverse 44KHz playback / 48KHz mic case.

  • Not use pavucontrol: The obvious choice, however in order to keep being able to control the full extent of pulse it might be better to use an alternative pulse mixer, you might want to try pavucontrol-qt (likely to have the same issue but maybe their stream peak detection is implemented differently), or some console client like pactl/pamixer/ponymix or similar.

Offline

#8 2017-06-26 00:29:07

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] Audio distortion when opening pavucontrol

@V1del
So far I've seen no problems, I do use alsamixer to control the volume of a usb dac (because pavucontrol eats too much cpu time when open doing nothing) and any volume changes are reflected automatically in the other program(1), at least I haven't detected any conflicts but now you've made me curious of any weirdness you may have experienced.

(1) Change in alsamixer it gets reflected on pavucontrol, change in pavucontrol and it gets reflected on alsamixer.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#9 2017-06-26 12:47:03

OlliC
Member
Registered: 2015-09-28
Posts: 18

Re: [SOLVED] Audio distortion when opening pavucontrol

Thanks for the input. I tried your suggestions.

"PULSE_LATENCY_MSEC=60 pavucontrol" unfortunately does not changes anything.

Then i swapped default and alternate sampling rate. After that i did not have this issue on 48khz playback.
But now the distortion happens when playing something on 44.1kHz.

Havent tried other volume control apps for now. But the same also applies to Gnome build in audio control panel which is kind of a bummer. Otherwise i would just stop using pavucontrol. 

R00KIE wrote:

Maybe just bad quality hardware. I suggested you test the recording idea because I've experienced something similar with a cheap usb soundcard, I would get noise on the output every time I would open pavucontrol and the profile was set for Analog Stereo Duplex.

I would not think a M-Audio MobilePre MKII is bad quality hardware. Maybe its really a problem of more professional audio interfaces that cannot mix sample rates for output/input and can just operate on one samplerate at a time like V1del suggested. At least i found someone who has the same issue on other hardware.

Offline

#10 2017-06-26 12:56:07

OlliC
Member
Registered: 2015-09-28
Posts: 18

Re: [SOLVED] Audio distortion when opening pavucontrol

So i think i found a solution i can live with.

I set default-sample-rate and alternate-sample-rate both to 48kHz. In this case everything being played on 44.1Khz will be resampled to 48kHz and the audio interface never leaves the 48kHz operation mode.

And there is no distortion when opening pavucontrol and playing something on 44.1kHz or 48kHz.

Offline

#11 2017-06-26 13:11:52

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,657

Re: [SOLVED] Audio distortion when opening pavucontrol

@R00KIE There used to be a few threads where people used amixer and potentially had the just set volume reset when opening a new stream for example. This might also simply be in the case where they fiddled around with compatibility pulse plugin, now that I think about it, it likely works correctly doing the change directly on the card control, since the pulse sinks do map back to the HW control they manipulate by default. But yeah that's of course not an option if you want to adjust individual streams.

@OlliC
Yeah that's of course another one (don't know why I didn't mention it on the second bulletpoint of my list) if you don't mind the resampling happening from the 44.1kHz sources. Still I feel that's a bit of a work around, maybe we have a case for a bugreport in pavucontrol, to make the peak listeners more intelligent, or at least configurable/disableable

If that's SOLVED for you please edit the title of your initial post to indicate it as such

Last edited by V1del (2017-06-26 13:21:09)

Offline

Board footer

Powered by FluxBB