PCM level is overdriven

Bug #551606 reported by Jane Silber
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Medium
Unassigned
Lucid
Fix Released
Undecided
Unassigned
Maverick
Fix Released
Medium
Unassigned

Bug Description

This bugfix is part of that upstream stable update for Lucid to 2.6.32.12 (see Bug #575853).

---

(Card0.Codecs.codec.0.txt) has revealed that my PCM level is overdriven; the offset to 0 dB (which should correspond to 100%) is
0x3d, but the number of steps is 0x3f, which means anything set at 100% will sound distorted.

How do I know this? Because Daniel Chen told me so in bug #548661. Thanks Daniel!

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: alsa-base 1.0.22.1+dfsg-0ubuntu3
ProcVersionSignature: Ubuntu 2.6.32-17.26-generic 2.6.32.10+drm33.1
Uname: Linux 2.6.32-17-generic i686
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.21.
Architecture: i386
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: Intel [HDA Intel], device 0: AD198x Analog [AD198x Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: jane 1425 F.... pulseaudio
Card0.Amixer.info:
 Card hw:0 'Intel'/'HDA Intel at 0xee240000 irq 17'
   Mixer name : 'Analog Devices AD1981'
   Components : 'HDA:11d41981,17aa2025,00100200'
   Controls : 20
   Simple ctrls : 11
Date: Tue Mar 30 12:23:32 2010
PackageArchitecture: all
ProcEnviron:
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: alsa-driver
UserAsoundrc:
 # ALSA library configuration file

 # Include settings that are under the control of asoundconf(1).
 # (To disable these settings, comment out this line.)
 </home/jane/.asoundrc.asoundconf>

Revision history for this message
Jane Silber (silbs) wrote :
Revision history for this message
Jeremy Foshee (jeremyfoshee) wrote :

Hi Jane,
    Thanks for reporting this separately. I've begun taking a look at your logging and I am going to work with the Kernel Team and The Audio Teams to see how we can bisect this issue appropriately.

Thanks!

~JFo

Changed in alsa-driver (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Daniel T Chen (crimsun) wrote :

From f3b52812102a1072a20346d6ea45929e60eab23b Mon Sep 17 00:00:00 2001
From: Daniel T Chen <email address hidden>
Date: Tue, 30 Mar 2010 13:29:28 -0400
Subject: [PATCH] ALSA: hda: Fix 0 dB offset for Lenovo Thinkpad models using AD1981

The OR's hardware distorts at PCM 100% because it does not correspond to
0 dB. Fix this in patch_ad1981() for all models using the Thinkpad
quirk.

Reported-by: Jane Silber
Cc: <email address hidden>
Signed-off-by: Daniel T Chen <email address hidden>
---
 sound/pci/hda/patch_analog.c | 8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 262f5b5..9cbd80c 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -1904,6 +1904,14 @@ static int patch_ad1981(struct hda_codec *codec)
  case AD1981_THINKPAD:
   spec->mixers[0] = ad1981_thinkpad_mixers;
   spec->input_mux = &ad1981_thinkpad_capture_source;
+ /* set the upper-limit for mixer amp to 0dB for avoiding the
+ * possible damage by overloading
+ */
+ snd_hda_override_amp_caps(codec, 0x11, HDA_INPUT,
+ (0x17 << AC_AMPCAP_OFFSET_SHIFT) |
+ (0x17 << AC_AMPCAP_NUM_STEPS_SHIFT) |
+ (0x05 << AC_AMPCAP_STEP_SIZE_SHIFT) |
+ (1 << AC_AMPCAP_MUTE_SHIFT));
   break;
  case AD1981_TOSHIBA:
   spec->mixers[0] = ad1981_hp_mixers;
--
1.7.0

Revision history for this message
Daniel T Chen (crimsun) wrote :

To clarify the above patch, the PCM node's number of offsets to 0 dB needs to be capped at the actual 0 dB offset. The manifestation as explained originally in bug 548661 is a consequence of this mismatch.

Revision history for this message
Daniel T Chen (crimsun) wrote :
Revision history for this message
Daniel T Chen (crimsun) wrote :
Changed in alsa-driver (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
madbiologist (me-again) wrote :

It's interesting that not only has this fix gone into the kernel, it is also mentioned in the changelog for the just-released ALSA 1.0.23.

    - ALSA: hda: Fix 0 dB offset for Lenovo Thinkpad models using AD1981
    BugLink: https://launchpad.net/bugs/551606
    The OR's hardware distorts at PCM 100% because it does not correspond to
    0 dB. Fix this in patch_ad1981() for all models using the Thinkpad
    quirk.
    Reported-by: Jane Silber

Revision history for this message
madbiologist (me-again) wrote :

The abovementioned fix has been included upstream in kernel 2.6.32.12. From the changelog:

commit 97d0f3f2a0bd5c346449a61a77dc1d140ca3782f
Author: Daniel T Chen
Date: Tue Mar 30 13:29:28 2010 -0400

    ALSA: hda: Fix 0 dB offset for Lenovo Thinkpad models using AD1981

    commit b8e80cf386419453678b01bef830f53445ebb15d upstream.

    BugLink: https://launchpad.net/bugs/551606

    The OR's hardware distorts at PCM 100% because it does not correspond to
    0 dB. Fix this in patch_ad1981() for all models using the Thinkpad
    quirk.

    Reported-by: Jane Silber
    Signed-off-by: Daniel T Chen
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

Stefan Bader (smb)
description: updated
Martin Pitt (pitti)
affects: alsa-driver (Ubuntu) → linux (Ubuntu)
Changed in linux (Ubuntu Maverick):
milestone: none → maverick-alpha-2
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted linux into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in linux (Ubuntu Lucid):
status: New → Fix Committed
tags: added: verification-needed
Andy Whitcroft (apw)
Changed in linux (Ubuntu Maverick):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (25.2 KiB)

This bug was fixed in the package linux - 2.6.32-23.37

---------------
linux (2.6.32-23.37) lucid-proposed; urgency=low

  [ Alex Deucher ]

  * SAUCE: drm/radeon/kms/atom: fix dual-link DVI on DCE3.2/4.0
    - LP: #564559

  [ Andy Whitcroft ]

  * [Config] ports -- build in dm-mod to enable LVM boot
    - LP: #560717
  * tools -- fix perf version extraction for multi-part flavours
    - LP: #555130
  * SAUCE: ACPI: EC: Allow multibyte access to EC (v3)
    - LP: #526354
  * [Config] enforce -- ensure dm_mod is built-in for LVM
    - LP: #560717
  * update to ubuntu-debian:7e708d33054c373faf41da23b73e8b48c342d958
    - LP: #570500, #576274

  [ Chase Douglas ]

  * Revert "(pre-stable): input: ALPS - Add signature for HP Pavilion dm3
    laptops"
    - LP: #550625
  * Enable ftrace function profiler
    - LP: #570389
  * enforce CONFIG_TMPFS_POSIX_ACL=y
    - LP: #575940

  [ Leann Ogasawara ]

  * Revert "staging/comdi -- disable"
    - LP: #563436
  * [Config] Enable multicast routing for sparc
    - LP: #416266
  * [Config] Add ahci.ko to virtual sub-flavour
    - LP: #570542

  [ Stefan Bader ]

  * Revert "SAUCE: drm/i915: Disable FBC on 915GM and 945GM"
    - LP: #588832

  [ Tim Gardner ]

  * ubuntu: rtl8192se -- update to version 0015.0127.2010
    - LP: #567016
  * [Config] Add atl1c to nic-modules udeb
    - LP: #557130

  [ Upstream Kernel Changes ]

  * Revert "(pre-stable) iwlwifi: fix nfreed--"
    - LP: #575853
  * Revert "backlight: mbp_nvidia_bl - add five more MacBook variants"
    - LP: #575853
  * Revert "(pre-stable) pata_via: Add VIA VX900 support"
    - LP: #575853
  * Revert "(pre-stable) x86-32, resume: do a global tlb flush in S4
    resume"
    - LP: #575853
  * Revert "x86: disable IOMMUs on kernel crash"
    - LP: #575853
  * Revert "sunrpc: fix peername failed on closed listener"
    - LP: #575853
  * Revert "sunrpc: move the close processing after do recvfrom method"
    - LP: #575853
  * Revert "(pre-stable) drm/edid: allow certain bogus edids to hit a fixup
    path rather than fail"
    - LP: #575853
  * Revert "drm/radeon/kms: don't print error on -ERESTARTSYS."
    - LP: #575853
  * Revert "ath9k: fix lockdep warning when unloading module" on stable
    kernels
    - LP: #588832
  * Staging: comedi: removed "depricated" from COMEDI_CB_BLOCK
    - LP: #483343
  * fat: fix buffer overflow in vfat_create_shortname()
    - LP: #575853
  * xfs: simplify inode teardown
    - LP: #575853
  * xfs: fix mmap_sem/iolock inversion in xfs_free_eofblocks
    - LP: #575853
  * xfs: I/O completion handlers must use NOFS allocations
    - LP: #575853
  * xfs: Wrapped journal record corruption on read at recovery
    - LP: #575853
  * xfs: Fix error return for fallocate() on XFS
    - LP: #575853
  * xfs: check for not fully initialized inodes in xfs_ireclaim
    - LP: #575853
  * xfs: fix timestamp handling in xfs_setattr
    - LP: #575853
  * xfs: Don't flush stale inodes
    - LP: #575853
  * xfs: Ensure we force all busy extents in range to disk
    - LP: #575853
  * xfs: reclaim inodes under a write lock
    - LP: #575853
  * xfs: Avoid inodes in reclaim when flushing from inode cache
    - LP: #575853
  * xfs: recla...

Changed in linux (Ubuntu Lucid):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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