Bug 68211 - Improper Pulseaudio line-in volumes due to a wrong dB step value on HDA Intel AD1988 (3.11 => 3.12 regression)
Summary: Improper Pulseaudio line-in volumes due to a wrong dB step value on HDA Intel...
Status: RESOLVED INVALID
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: x86-64 Linux
: P1 low
Assignee: Jaroslav Kysela
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-06 14:25 UTC by mrj
Modified: 2014-01-08 09:45 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.12.5
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
Output of alsa-info under Kernel 3.12.5 and snd_hda_intel "model" option "6stack" (46.49 KB, application/octet-stream)
2014-01-06 14:25 UTC, mrj
Details
Patch to add line_boost hint (2.00 KB, patch)
2014-01-06 17:52 UTC, Takashi Iwai
Details | Diff

Description mrj 2014-01-06 14:25:29 UTC
Created attachment 121091 [details]
Output of alsa-info under Kernel 3.12.5 and snd_hda_intel "model" option "6stack"

On a machine with HDA Intel Audio and an AD1988 codec (ASUS P5B board), running
Kernel 3.12.5 causes the line-in hardware volume to span its full 0-54 range over a Pulseaudio volume range of 0-20724, instead of being mapped to the full 0-65536 Pulseaudio volume range, as is the case when running Kernels 3.11.9 and earlier. This causes previously suitable line-in mixer volumes to clip severely.

The cause looks to be the 3.12.5 Kernel incorrectly reporting the hardware dB step, which manifests as an improper max_dB value calculated by alsa-lib and passed to Pulseaudio:

3.11.9:

[pulseaudio][modules/alsa/alsa-mixer.c:2789 pa_alsa_path_dump()] Path analog-input-linein (Line In), direction=2, priority=81, probed=yes, supported=yes, has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=54, min_dB=-58.5, max_dB=22.5


3.12.5:

[pulseaudio][modules/alsa/alsa-mixer.c:2789 pa_alsa_path_dump()] Path analog-input-linein (Line In), direction=2, priority=81, probed=yes, supported=yes, has_mute=yes, has_volume=yes, has_dB=yes, min_volume=0, max_volume=54, min_dB=-58.5, max_dB=52.5

(A max_dB of 52.5 is reported for both mic inputs under both Kernels.)

The following snd_hda_intel model options were tried without effect: <none/auto>, 6stack, and 6stack-dig.

An alsa-info dump is attached.

The associated Red Hat bug is https://bugzilla.redhat.com/show_bug.cgi?id=1047204
Comment 1 Takashi Iwai 2014-01-06 17:41:02 UTC
It's no bug from the driver perspective.  The HD-audio driver provides "Line Boost" control as well as "Mic Boost" and "Front Mic Boost".  This gives up to +30dB, but only if set.  PA seems manipulating this control automatically.

The control has been available for other codec drivers for long time, so it's nothing new.  It's seen on AD codecs now, though, just because AD codec driver adapts the generic parser recently.

That being said, all the exposed dB information is correct.  The rest is an issue of PulseAudio, if any.
Comment 2 Takashi Iwai 2014-01-06 17:51:10 UTC
Meanwhile, it'd be relatively easy to suppress the line boost controls like the patch below.  The line boost control was added by popular demands, so it should be still enabled as default.  But there can be some case like yours where it's not desired.  The extra hint like this patch would be helpful in such a case.  You can pass it via the firmware patch option, as mentioned in HD-Audio.txt.
Comment 3 Takashi Iwai 2014-01-06 17:52:47 UTC
Created attachment 121101 [details]
Patch to add line_boost hint
Comment 4 mrj 2014-01-06 22:57:11 UTC
Thank you for the explanation, and for providing the line_boost=0 driver option.

I've filed a bug with Pulseaudio:

https://bugs.freedesktop.org/show_bug.cgi?id=73336
Comment 5 Raymond 2014-01-07 00:13:48 UTC
most user don't expect boost at line in, i think the default should be false
Comment 6 Raymond 2014-01-07 01:46:32 UTC
which BIOS version are you using ?

Line In should be stereo 


Node 0x15 [Pin Complex] wcaps 0x40018d: Stereo Amp-Out
  Control: name="Line Jack", index=0, device=0
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals:  [0x80 0x80]
  Pincap 0x00003737: IN OUT Detect Trigger ImpSense
    Vref caps: HIZ 50 GRD 80 100
  Pin Default 0x01813021: [Jack] Line In at Ext Rear
    Conn = 1/8, Color = Blue
    DefAssociation = 0x2, Sequence = 0x1
  Pin-ctls: 0x20: IN VREF_HIZ
  Unsolicited: tag=03, enabled=1
  Connection: 1
     0x2c

Node 0x1a [Pin Complex] wcaps 0x400000: Mono
  Control: name="Line Phantom Jack", index=0, device=0
  Pincap 0x00000020: IN
  Pin Default 0x918711f0: [Fixed] Line In at Int Rear
    Conn = Analog, Color = Black
    DefAssociation = 0xf, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x20: IN
Comment 7 Raymond 2014-01-08 09:45:09 UTC
AD1988A/AD1988B

HD AUDIO WIDGETS
Table 10.

Node ID Name Type Description
15 PORT-C Pin complex Rear panel line-in jack
19 Mixer Power-Down Power widget Powers down the analog mixer and associated amps
1A Analog PCBEEP Pin complex External analog PCBEEP signal input

Note You need to log in before you can comment on or make changes to this bug.