Bug 198495 - Realtek ALC295 lfe speakers always have max volume
Summary: Realtek ALC295 lfe speakers always have max volume
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: Intel Linux
: P1 normal
Assignee: Jaroslav Kysela
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-18 00:19 UTC by Dmytro Kolomoiets
Modified: 2021-11-07 21:06 UTC (History)
1 user (show)

See Also:
Kernel Version: 4.14
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Codec graph and alsa output for default and fixed alc295 (27.49 KB, application/gzip)
2018-01-18 00:19 UTC, Dmytro Kolomoiets
Details

Description Dmytro Kolomoiets 2018-01-18 00:19:31 UTC
Created attachment 273657 [details]
Codec graph and alsa output for default and fixed alc295

Laptop ASUS UX550VD, audiosystem with tweaks from "Harman Kardon" or some other marketing anything. There are four speakers in total -- two high-pitch at the bottom of the front panel (Windows treat them as "Front") and two normal-low-pitch (LFE) speakers by sides of keyboard on top (treated as "Subwoofer", which volume is separately regulated). Linux, of course, not that simple -- volume regulation in alsamixer of "Master" and "Bass Speakers" only affects "Front" speakers, which both play "Rear Center" on:

  $ speaker-test -D 'front:CARD=PCH,DEV=0' -c4 -t wav

***

Default graph is on default-codec#0.svg -- you see 0x02 with EAPD connected to 0x14 (Front) -- it allows "Master" and "Bass Speakers" sliders to regulate their output. By the way, "Bass Speakers" slider is wrong -- as it must be "Speakers". Next 0x03 with EAPD regulates 0x21 by "Headphones" slider and the last one 0x06 is directly connected to 0x17 LFE -- without any slider at all. Relevant default-alsa-info.txt is inside attach.

I have a rather inelegant workaround for this problem -- by associating both 0x02 and 0x03 as group and redirecting output from 0x03 to LFE instead of headphones. It automagically replaced my incorrect "Bass Speaker" slider with "Speaker" in alsamixer. After fixing pulseaudio config, now I can regulate LFE by "Headphones".
You can see fixed-codec#0.svg graph and fixed-alsa-info.txt in attach.
Actual fix:

    [pincfg]
    0x14 0x90170110
    0x17 0x90170111
    [verb]
    # Re-associate Inner Speakers and redirect input from Headphones to LFE
    # 0x14 0x71c 0x50
    # 0x17 0x71c 0x51
    # 0x17 0x701 0x1
    # FIXED: audio has cracking in left channel
    0x20 0x500 0x67
    0x20 0x400 0x3000

***
Questions:

1) Why using verb in 0x701 inside /lib/firmware/alc295.fw actually had no effect -- despite being shown inside "/sys/.../init_verbs". I applied it by hda-verb with systemd service, which worked. I only empirically understood with hdajackretask, that [pincfg] verbs must always be applied first, otherwise switching input on 0x17 has no desired effect -- is this observation relevant to actual alsa code?

2) I still suspect that between 0x06 and 0x17 lfe there must be EAPD somewhere to produce actual "Bass Speaker" slider slaved to "Master". But diagrams show no modules in-between. Moreover, as you can see from fixed-alsa-info.txt, enabling all 3 gpio haven't forced it to be enabled nor it magically appeared. Is there possibility that EAPD between 0x06 and 0x17 actually exists or I misinterpreted output from tools?

3) If enabling of EAPD is related to verb sequences into vendor widgets or coefficients to them -- is there a way on Windows to sniff hda bus? Is there a way to find in that verb stream that concreate sequence? (actually I already compared coefficients from /proc/asound and only 0x67 fixed my headphones, others only created noise in speakers).
Comment 1 Rustam Abdullaev 2021-11-07 21:06:45 UTC
The DAC at node 0x06 simply doesn't have volume control and should not be used.

A patch has been merged today, see here:
https://bugzilla.kernel.org/show_bug.cgi?id=212641
https://lore.kernel.org/all/20211107083339.18013-1-tiwai@suse.de/
(note: UX550VD and UX550VE are identical in this regard)

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