Bug 462930

Summary: 0.9.12 audio breakup and distortion during mixing of multiple sources
Product: [Fedora] Fedora Reporter: Valdis Kletnieks <valdis.kletnieks>
Component: pulseaudioAssignee: Lennart Poettering <lpoetter>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: lkundrak, mclasen, pierre-bugzilla
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-10-06 13:36:30 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 457945    

Description Valdis Kletnieks 2008-09-19 15:39:57 EDT
Description of problem:
I usually have xmms running playing music, and also get various alerts from the Festival text-to-speech software.  Under 0.9.10, if both were active at the same time, they would get properly mixed under essentially all conditions (i.e. it would do a good job of mixing even if the music source was Metallica or similar).

Under 0.9.12, if the xmms input has sufficient signal level, I'm hearing some *major* clipping, breakup, and distortion when it tries to mix the two audio sources.  Note that it seems to be an input level issue, as the problem will show up even if the master output volume is sitting down at 25%.

This *may* be related to the following oddness - scrolling the output volume level from full-off to full-on and back shows this in pulseaudio -vv output:

D: module-alsa-sink.c: Read hardware volume: 0:  29% 1:  29%
D: module-alsa-sink.c: Read hardware volume: 0:  25% 1:  25%
D: module-alsa-sink.c: Read hardware volume: 0:  22% 1:  22%
D: module-alsa-sink.c: Read hardware volume: 0:  27% 1:  27%
D: module-alsa-sink.c: Read hardware volume: 0:  29% 1:  29%
...
D: module-alsa-sink.c: Read hardware volume: 0:  84% 1:  84%
D: module-alsa-sink.c: Read hardware volume: 0:  89% 1:  89%
D: module-alsa-sink.c: Read hardware volume: 0:  94% 1:  94%
D: module-alsa-sink.c: Read hardware volume: 0: 100% 1: 100%
D: module-alsa-sink.c: Read hardware volume: 0:  94% 1: 100%
D: module-alsa-sink.c: Read hardware volume: 0:  94% 1:  94%
...
D: module-alsa-sink.c: Read hardware volume: 0:  27% 1:  27%
D: module-alsa-sink.c: Read hardware volume: 0:  22% 1:  27%
D: module-alsa-sink.c: Read hardware volume: 0:  22% 1:  22%
D: module-alsa-sink.c: Read hardware volume: 0:  22% 1:  22%
D: module-alsa-sink.c: Read hardware volume: 0:  22% 1:  22%
D: module-alsa-sink.c: Read hardware volume: 0:  27% 1:  22%
D: module-alsa-sink.c: Read hardware volume: 0:  27% 1:  27%

It doesn't go 0 to 100 to zero, it goes 22 to 100 to 22.  What it thinks is 22% is full-off, no sound coming out at all, and is effectively truly zero.  When the GUI is reporting '50%', pulseaudio is printing 62% or so - so it's a fairly linear error.

Version-Release number of selected component (if applicable):
pulseaudio-0.9.12-6.fc10.x86_64

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Lennart Poettering 2008-09-23 19:59:37 EDT
pa 0.9.12 uses the decibel information exported by the sound card and extends the volume range if necessary in software. 

Could you please dump "amixer -c 0 scontents"?
Comment 2 Valdis Kletnieks 2008-09-24 11:48:28 EDT
% amixer -c 0 scontents
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 14 [45%] [-25.50dB] [on]
  Front Right: Playback 14 [45%] [-25.50dB] [on]
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'IEC958 Default PCM',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 15
  Front Left: Capture 0 [0%] [0.00dB] [off]
  Front Right: Capture 0 [0%] [0.00dB] [off]
Simple mixer control 'Input Source',0
  Capabilities: cenum
  Items: 'Mic' 'Front Mic'
  Item0: 'Mic'
Comment 3 Lennart Poettering 2008-10-01 20:45:23 EDT
The mixing issue should be fixed now in upstream git commit ea82dec. I will push this into rawhide soon.

The offset in the percentage values is because PA now always uses the dB info and ignores the integer scale of the sound card. We want to present a unified user interface to the user where the mapping between volume percentages and dB is always the same. Thus, we trust only the dB and do the percentage transformation ourselves.
Comment 4 Lennart Poettering 2008-10-06 13:36:30 EDT
Fixed in 0.9.13-1
Comment 5 Valdis Kletnieks 2008-10-06 15:28:16 EDT
Confirmed fixed in 0.9.13-1, thanks...