13

(Almost) whenever the volume of an audio stream is adjusted, I hear a clicking sound.

I was using a web application that emitted multiple streams and adjusted their volume frequently (and should be able to do this), which resulted in an unbearable amount of clicks. (This application has now changed its way of handling streams such that the phenomenon does not occur anymore; the problem can still be reproduced by manually adjusting streams and may be of interest for other applications.)

Is there a known way to prevent this?

Some further observations:

  • This also happens when I adjust the volume of streams manually (with pavucontrol). In particular, this also works for streams from other applications (like ogg123), so it does not seem to be a problem of the application.

  • This does not happen if change the volume of an entire output device, just with the streams on pavucontrol’s playback tab.

  • The intensity of the click depends on the volume of the sound currently playing in the respective audio stream. It can be best heard with monotonous sounds. The phenomenon is also more prominent if at least one other audio stream is played.

  • The phenomenon is also observable for slight volume changes.

  • This is not the same as the problem described in: How can I disable the "popping" sound when adjusting the volume? The sound is clearly distinct from /usr/share/sounds/freedesktop/stereo/audio-volume-change.oga.

  • I have the impression that some update in the last months improved the situation, but did not fully remove the problem. This may also be due to me being an unreliable detector.

  • I first encountered this issue in 14.04. It persists in 16.04.

  • This happens on multiple machines, so I assume that this is not a hardware problem. They are both Intel devices, however. Here is the output of sudo lshw -C multimedia:

    First machine:

    description: Audio device
    product: 7 Series/C210 Series Chipset Family High Definition Audio Controller
    vendor: Intel Corporation
    physical id: 1b
    bus info: pci@0000:00:1b.0
    version: 04
    width: 64 bits
    clock: 33MHz
    capabilities: pm msi pciexpress bus_master cap_list
    configuration: driver=snd_hda_intel latency=0
    resources: irq:28 memory:f2530000-f2533fff
    

    Second machine

    description: Audio device
    product: 82801JI (ICH10 Family) HD Audio Controller
    vendor: Intel Corporation
    physical id: 1b
    bus info: pci@0000:00:1b.0
    version: 00
    width: 64 bits
    clock: 33MHz
    capabilities: pm msi pciexpress bus_master cap_list
    configuration: driver=snd_hda_intel latency=0
    resources: irq:32 memory:f9ff8000-f9ffbfff
    
  • Clicks are not normal volume behavior for Ubuntu Volume adjustment. What to these clicks sound like? Could you have a problem with your external amplifier? I'm afraid you will have to be more specific. What program what streams where are you adjusting the volume? – Thompson Dawes Jan 13 '17 at 20:12
  • 1
    @ThompsonDawes: Could you have a problem with your external amplifier? – Unlikely. As I wrote, it happens on different machines. — What program what streams where are you adjusting the volume? – It happens with several streams. Adjusting the volume via pavucontrol suffices to experience the phenomenon. – Wrzlprmft Jan 14 '17 at 9:51
  • I have heard such a phenomenon with some sample rate converters. Try to set all playing streams, and the pulseaudio mixer, to use the same sample rate. – O8h7w Feb 8 '17 at 19:49
  • I do not have time to test and research right now, but how would I set the sampling rate used by the Pulseaudio mixer? – Wrzlprmft Feb 8 '17 at 23:23
  • Does the number of streams being played have any impact? Do you obtain the same results with a single stream being played that you get with multiple streams? I'm trying to determine why this should "(Almost)" always be true and what the conditions are when it's not. You state that this occurs on multiple machines. Is there anything that they all have in common? Same output device perhaps? Same driver? Is the output identical on all the systems to the command sudo lshw -C multimedia If so, what is that output? What applicaton are you using that results in this behaviour? – Elder Geek Feb 12 '17 at 16:15
2

You may be hitting latency limits of your hardware when pulse is "busy".

configuration: driver=snd_hda_intel latency=0

There is really no such thing as zero latency. I presume that means sub-millisecond.

Per this https://arunraghavan.net/2013/08/pulseaudio-4-0-and-skype/ Setting the env variable PULSE_LATENCY_MSEC=10 before starting an app. This gives the software 10ms of buffer time if it has more work to do mixing streams.

10ms is still low enough latency unless you are playing live music digital instruments or very fast games.

  • Thank you for your answer. Unfortunately, it does not seem to help, but even seems to make it slightly worse. However, I did not try setting this variable globally so far and cannot find how to elegantly do this. – Wrzlprmft May 12 '17 at 19:35

protected by Community Feb 9 '17 at 3:10

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.