Bug 50113 - Adjusting volume of paused stream causes audible crackling in another
Summary: Adjusting volume of paused stream causes audible crackling in another
Status: RESOLVED MOVED
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: pulseaudio-bugs
QA Contact: pulseaudio-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-19 04:20 UTC by James
Modified: 2018-07-30 10:00 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
alsa-info (Conexant codec) (28.31 KB, application/octet-stream)
2012-05-19 04:20 UTC, James
Details
Output of pulseaudio -vvvv (its big) with two streams, one paused, its volume being adjusted (610.01 KB, text/plain)
2012-05-19 04:28 UTC, James
Details
alsa-info (ALC codec) (39.29 KB, text/plain)
2014-06-15 09:05 UTC, James
Details
pulseaudio -vvvv logs from pulseaudio-4.0-13.gitf81e3.fc20.x86_64 (690.61 KB, text/plain)
2014-06-15 09:23 UTC, James
Details

Description James 2012-05-19 04:20:30 UTC
Created attachment 61836 [details]
alsa-info (Conexant codec)

[This has been around since before March 2010, and was originally reported in RHBZ https://bugzilla.redhat.com/show_bug.cgi?id=576358 .]

Description of problem:
Adjusting volume of paused stream causes audible crackling in another stream
that is currently playing. This seems particularly pronounced if the two
streams have different sample rates.

Seen on Intel HDA with Realtek ALC 883 and Conexant CX20585 codecs, and ATI IXP audio.

Version-Release number of selected component (if applicable):
pulseaudio-1.1-9.fc17.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. Start two streams, A and B.
2. Pause stream A in such a way that it remains open.
3. Adjust the volume of the stream A in Sound Preferences.

Actual results:
Crackling in stream B.

Expected results:
No crackling.
Comment 1 James 2012-05-19 04:28:55 UTC
Created attachment 61838 [details]
Output of pulseaudio -vvvv (its big) with two streams, one paused, its volume being adjusted

Have attached output of pulseaudio -vvvv while adjusting the volume of a paused stream.

The degree of the distortion seems to vary from just audible (usually with a fresh instance of PA) to very obvious (after PA has been running for a while). Either way, adjusting the volume sliders is not audibly clean.
Comment 2 Alexander E. Patrakov 2014-06-13 11:46:29 UTC
This bug exists because there is no rewindable open-source resampler implementation.

When the volume is changed, a rewind is applied to all sink inputs, so that the volume change can be heard immediately. However, if the sink input is resampled, then the rewind operation resets the resampler. It should have restored its internal state to the prior point in time instead, but none of the existing resampler libraries have an API for this.
Comment 3 Raymond 2014-06-13 22:39:59 UTC
the log did not contain any resample event 

why did pulseaudio add dB of headphone playback volume to speaker path ? 

did sum of dB of all control equal to -199 ?

i

pulseaudio] alsa-mixer.c: Path analog-output-speaker (Analog Speakers), direction=1, priority=100, probed=yes, supported=yes, has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=74, min_dB=-199, max_dB=0
D: [pulseaudio] alsa-mixer.c: Element Master, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x7ffffffffffff, n_channels=1, override_map=yes
D: [pulseaudio] alsa-mixer.c: Element Headphone, direction=1, switch=1, volume=3, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x6, n_channels=2, override_map=no
D: [pulseaudio] alsa-mixer.c: Element Speaker, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=4, required_any=0, required_absent=0, mask=0x3600000000f66, n_channels=2, override_map=yes
D: [pulseaudio] alsa-mixer.c: Element PCM, direction=1, switch=0, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x3600000000f66, n_channels=2, override_map=yes
Comment 4 James 2014-06-15 09:02:33 UTC
Now using pulseaudio-4.0-13.gitf81e3.fc20.x86_64. The problem is still there (easiest to reproduce with different sample rates); I'll try and get some logs from the newer version (on the ALC codec).
Comment 5 James 2014-06-15 09:05:14 UTC
Created attachment 101087 [details]
alsa-info (ALC codec)
Comment 6 James 2014-06-15 09:23:47 UTC
Created attachment 101088 [details]
pulseaudio -vvvv logs from pulseaudio-4.0-13.gitf81e3.fc20.x86_64

In the second PA log, the two streams are from Totem and Rhythmbox. The Totem stream is 44.1kHz, Rhythmbox at 48kHz.
1. Rhythmbox started, volume adjusted to something audible.
2. Totem playback started, then paused.
3. Volume adjustment back and forth of the Totem stream.
Comment 7 Raymond 2014-06-15 15:47:42 UTC
how did pulseaudio calculate dB of speaker path, analog output and headphone path, seem they have SAME number of steps (0 to 31 )but different dB MIN 



ulseaudio] alsa-mixer.c: Path analog-output (Analog Output), direction=1, priority=99, probed=yes, supported=yes, has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=31, min_dB=-97.5, max_dB=0
D: [pulseaudio] alsa-mixer.c: Element Master, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x7ffffffffffff, n_channels=1, override_map=yes
D: [pulseaudio] alsa-mixer.c: Element Headphone, direction=1, switch=1, volume=3, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x6, n_channels=2, override_map=no
D: [pulseaudio] alsa-mixer.c: Element Speaker, direction=1, switch=1, volume=2, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x6, n_channels=2, override_map=no
D: [pulseaudio] alsa-mixer.c: Element PCM, direction=1, switch=0, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x3600000000f66, n_channels=2, override_map=yes
D: [pulseaudio] alsa-mixer.c: Element IEC958, direction=1, switch=2, volume=0, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x0, n_channels=0, override_map=no
D: [pulseaudio] alsa-mixer.c: Jack Line Out, alsa_name='Line Out Jack', detection unavailable
D: [pulseaudio] alsa-mixer.c: Jack Line Out Phantom, alsa_name='Line Out Phantom Jack', detection unavailable
D: [pulseaudio] alsa-mixer.c: Path analog-output-speaker (Speakers), direction=1, priority=100, probed=yes, supported=yes, has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=31, min_dB=-144, max_dB=0
D: [pulseaudio] alsa-mixer.c: Element Master, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x7ffffffffffff, n_channels=1, override_map=yes
D: [pulseaudio] alsa-mixer.c: Element Headphone, direction=1, switch=2, volume=2, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x6, n_channels=2, override_map=no
D: [pulseaudio] alsa-mixer.c: Element Speaker, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=4, required_absent=0, mask=0x3600000000f66, n_channels=2, override_map=yes
D: [pulseaudio] alsa-mixer.c: Element PCM, direction=1, switch=0, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x3600000000f66, n_channels=2, override_map=yes
D: [pulseaudio] alsa-mixer.c: Element IEC958, direction=1, switch=2, volume=0, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x0, n_channels=0, override_map=no
D: [pulseaudio] alsa-mixer.c: Jack Headphone, alsa_name='Headphone Jack', detection possible
D: [pulseaudio] alsa-mixer.c: Jack Front Headphone, alsa_name='Front Headphone Jack', detection unavailable
D: [pulseaudio] alsa-mixer.c: Jack Speaker Phantom, alsa_name='Speaker Phantom Jack', detection possible
D: [pulseaudio] alsa-mixer.c: Path analog-output-headphones (Headphones), direction=1, priority=90, probed=yes, supported=yes, has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=31, min_dB=-144, max_dB=0
D: [pulseaudio] alsa-mixer.c: Element Master, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x7ffffffffffff, n_channels=1, override_map=yes
D: [pulseaudio] alsa-mixer.c: Element Headphone, direction=1, switch=1, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=4, required_absent=0, mask=0x3600000000f66, n_channels=2, override_map=yes
D: [pulseaudio] alsa-mixer.c: Element Speaker, direction=1, switch=2, volume=2, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x6, n_channels=2, override_map=no
D: [pulseaudio] alsa-mixer.c: Element PCM, direction=1, switch=0, volume=1, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x3600000000f66, n_channels=2, override_map=yes
D: [pulseaudio] alsa-mixer.c: Element IEC958, direction=1, switch=2, volume=0, volume_limit=-1, enumeration=0, required=0, required_any=0, required_absent=0, mask=0x0, n_channels=0, override_map=no
Comment 8 Raymond 2014-06-15 23:10:59 UTC
D: [alsa-sink-ALC883 Analog] alsa-sink.c: Written HW volume did not match with the request: front-left: 56023 /  85% / -4.09 dB,   front-right: 56023 /  85% / -4.09 dB (request) != front-left: 55142 /  84% / -4.50 dB,   front-right: 55142 /  84% / -4.50 dB
I: [alsa-sink-ALC883 Analog] alsa-sink.c: Starting playback.


state.Intel {
	control.1 {
		iface MIXER
		name 'Headphone Playback Volume'
		value.0 0
		value.1 0
		comment {
			access 'read write'
			type INTEGER
			count 2
			range '0 - 31'
			dbmin -4650
			dbmax 0
			dbvalue.0 -4650
			dbvalue.1 -4650
		}
	}
	
	control.3 {
		iface MIXER
		name 'Speaker Playback Volume'
		value.0 31
		value.1 31
		comment {
			access 'read write'
			type INTEGER
			count 2
			range '0 - 31'
			dbmin -4650
			dbmax 0
			dbvalue.0 0
			dbvalue.1 0
		}
	}

control.19 {
		iface MIXER
		name 'Master Playback Volume'
		value 30
		comment {
			access 'read write'
			type INTEGER
			count 1
			range '0 - 31'
			dbmin -4650
			dbmax 0
			dbvalue.0 -150
		}
	}


control.35 {
		iface MIXER
		name 'PCM Playback Volume'
		value.0 255
		value.1 255
		comment {
			access 'read write user'
			type INTEGER
			count 2
			range '0 - 255'
			tlv '0000000100000008ffffec1400000014'
			dbmin -5100
			dbmax 0
			dbvalue.0 0
			dbvalue.1 0
		}
	}
Comment 9 GitLab Migration User 2018-07-30 10:00:37 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/163.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.