Can only use half the sound range without overdriving sound

Bug #1311525 reported by Alad Wenter on 2014-04-23
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pulseaudio (Ubuntu)
Undecided
Unassigned

Bug Description

On a Nvidia CK804 (Asus A8N SLI Premium), the audio can only be set to "base" (63 %) without overdriving the sound. This is because 0db (100 %) is reported wrong in pulseaudio; when seen in alsamixer it actually sets PCM to 12db, causing distortions.

According to PulseAudio this is a bug in the alsa driver

http://lists.freedesktop.org/archives/pulseaudio-discuss/2012-April/013249.html
http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/PulseAudioStoleMyVolumes/

"If you are experiencing distortions/clipping even though the inner volumes are set to 0dB, then this means that the dB information your ALSA driver exports is simply incorrect. In this case please file a bug against your audio driver and ask them to correct (i.e. shift up) the volume scale of that volume control."

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: alsa-base 1.0.25+dfsg-0ubuntu4
ProcVersionSignature: Ubuntu 3.13.0-24.46-generic 3.13.9
Uname: Linux 3.13.0-24-generic i686
ApportVersion: 2.14.1-0ubuntu3
Architecture: i386
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: alad 2110 F.... pulseaudio
 /dev/snd/pcmC0D0p: alad 2110 F...m pulseaudio
 /dev/snd/controlC1: alad 2110 F.... pulseaudio
CurrentDesktop: XFCE
Date: Wed Apr 23 10:18:29 2014
InstallationDate: Installed on 2014-04-20 (2 days ago)
InstallationMedia: Xubuntu 14.04 LTS "Trusty Tahr" - Release i386 (20140416.2)
PackageArchitecture: all
SourcePackage: alsa-driver
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 08/10/2006
dmi.bios.vendor: Phoenix Technologies, LTD
dmi.bios.version: ASUS A8N-SLI Premium ACPI BIOS Revision 1303
dmi.board.name: A8N-SLI Premium
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: 1.02
dmi.chassis.asset.tag: 123456789000
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnPhoenixTechnologies,LTD:bvrASUSA8N-SLIPremiumACPIBIOSRevision1303:bd08/10/2006:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKComputerINC.:rnA8N-SLIPremium:rvr1.02:cvnChassisManufacture:ct3:cvrChassisVersion:
dmi.product.name: System Product Name
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer
mtime.conffile..etc.modprobe.d.alsa.base.conf: 2014-04-23T01:09:11.857997

Alad Wenter (the-changing-side) wrote :
summary: - Can only use half the sound range without overdriven sound
+ Can only use half the sound range without overdriving sound
Raymond (superquad-vortex2) wrote :

take a look at alc850 datasheet or Intel AC97 2.x specificatiom

6.3.5 Analog Mixer Input Gain Registers (Index 0Ch - 18h)

all mixer inputs have +12dB gain (e.g. phone, Mic, line in, CD, Video, Auxiliary and PCM OUT)

Raymond (superquad-vortex2) wrote :

control.14 {
  iface MIXER
  name 'Phone Playback Volume'
  value 0
  comment {
   access 'read write'
   type INTEGER
   count 1
   range '0 - 31'
   dbmin -3450
   dbmax 1200
   dbvalue.0 -3450
  }
 }

 control.16 {
  iface MIXER
  name 'Mic Playback Volume'
  value 0
  comment {
   access 'read write'
   type INTEGER
   count 1
   range '0 - 31'
   dbmin -3450
   dbmax 1200
   dbvalue.0 -3450
  }
 }

control.19 {
  iface MIXER
  name 'Line Playback Volume'
  value.0 0
  value.1 0
  comment {
   access 'read write'
   type INTEGER
   count 2
   range '0 - 31'
   dbmin -3450
   dbmax 1200
   dbvalue.0 -3450
   dbvalue.1 -3450
  }
 }

 control.21 {
  iface MIXER
  name 'CD Playback Volume'
  value.0 0
  value.1 0
  comment {
   access 'read write'
   type INTEGER
   count 2
   range '0 - 31'
   dbmin -3450
   dbmax 1200
   dbvalue.0 -3450
   dbvalue.1 -3450
  }
 }

 control.23 {
  iface MIXER
  name 'Aux Playback Volume'
  value.0 0
  value.1 0
  comment {
   access 'read write'
   type INTEGER
   count 2
   range '0 - 31'
   dbmin -3450
   dbmax 1200
   dbvalue.0 -3450
   dbvalue.1 -3450
  }
 }

 control.25 {
  iface MIXER
  name 'PCM Playback Volume'
  value.0 23
  value.1 23
  comment {
   access 'read write'
   type INTEGER
   count 2
   range '0 - 31'
   dbmin -3450
   dbmax 1200
   dbvalue.0 0
   dbvalue.1 0
  }
 }

Raymond (superquad-vortex2) wrote :

[Element PCM]
switch = on
-volume = merge
override-map.1 = all
override-map.2 = all-left,all-righ

Raymond (superquad-vortex2) wrote :

https://bugzilla.kernel.org/show_bug.cgi?id=73851

there are sound card which dB range does not contain 0dB

do you mean it is not a bug of pulseaudio should show 0dB in the slider ?

Alad Wenter (the-changing-side) wrote :

Thanks Raymond for looking into this.

If I understand correctly, the specification defines that 100% equals 12db, so ALSA is not at fault.

For the range, I can turn down the PCM switch all the way to -34.5db and still have sound. So the range is pretty wide, same for Master.

It's just how far PCM can go up without causing distortions (i.e beyond 0db).

My problem is that Pulse recognizes the PCM 0db as the "base" level, but with the volume keys it's easy go to 100% - or what Pulse claims is "0db", but is in fact 12db.

As a workaround I've disabled Pulse's control over PCM by adding

load-module module-udev-detect ignore_dB=1

to /etc/pulse/default.pa

Cheers,

Alad

Raymond (superquad-vortex2) wrote :

0:64 = 0808
0:66 = 0808

MX64 surround dac volume
MX66 center/lfe dac volume

alc850 seem have two vendor specific registers -34.5dB to +12dB GAIN , the driver seem only expose those standard registers

the standard registers have dB range -94.5dB to 0dB

MX36 CENTER/LFE Master volume
MX38 SURROUND Master volume

Raymond (superquad-vortex2) wrote :

do you mean pulseaudio did not save an restore the non distorted volume setting and always switch to 100% after reboot ?

I've removed the ignore_dB=1 to test, and Pulse saves the volume across reboots for me.

But I tend to use the volume buttons (both the indicator in the taskbar and on the keyboard) quite often (e.g. for music with different gains) so before disabling PCM, I've found it easy to accidentally return to the distorted volume

Raymond (superquad-vortex2) wrote :

> As a workaround I've disabled Pulse's control over PCM by adding

> load-module module-udev-detect ignore_dB=1

> to /etc/pulse/default.pa

volume: 0: 63% 1: 63%
         0: -12,00 dB 1: -12,00 dB
         balance 0,00
 base volume: 63%
              -12,00 dB

If pulseaudio ignore dB scale, do this mean it use full volume range ?

Do PCM Playback volume remain at 0dB all the time ?

do distortion occur when your application play to alsa device hw:0,0 directly when PCM playback volume is over 0dB ?

speaker-test -c2 -t wav -D hw:0,0

the capture volume also have +22.5dB gain and +12dB MIC Boost

control.17 {
  iface MIXER
  name 'Mic Boost (+20dB)
  value false
  comment {
   access 'read write'
   type BOOLEAN
   count 1
  }
 }

control.28 {
  iface MIXER
  name 'Capture Volume'
  value.0 15
  value.1 15
  comment {
   access 'read write'
   type INTEGER
   count 2
   range '0 - 15'
   dbmin 0
   dbmax 2250
   dbvalue.0 2250
   dbvalue.1 2250
  }
 }

volume: 0: 100% 1: 100%
         0: 0,00 dB 1: 0,00 dB
         balance 0,00
 base volume: 42%
              -22,50 dB

> If pulseaudio ignore dB scale, do this mean it use full volume range ?

> Do PCM Playback volume remain at 0dB all the time ?

Yes, it then uses the complete Master range, indicated as: -46.50 dB (0 %) to 0 dB (100%). PCM stays at 0 dB (56 %) while doing so.

> do distortion occur when your application play to alsa device hw:0,0 directly when PCM playback volume is over 0dB ?

Using alsa directly with PCM above 0db gave distortions as before.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pulseaudio (Ubuntu):
status: New → Confirmed
Mark Rose (markrose) wrote :

I've been encountering this on an Asus Z97 Extreme6 under Kubuntu 16.04.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.