On 2020/02/10 13:54 +0100, Jaroslav Kysela wrote:
Dne 10. 02. 20 v 13:14 Benjamin Poirier napsal(a):
[...]
Here's the relevant part of Node 0x17 from /proc/asound/card0/codec#0 with different quirks applied and the level of sound output through the speakers:
no quirk Connection: 3 0x02 0x03 0x06* -> loud volume ALC285_FIXUP_SPEAKER2_TO_DAC1 Connection: 3 0x02* 0x03 0x06 In-driver Connection: 1 0x02 -> weak volume ALC295_FIXUP_DISABLE_DAC3 Connection: 3 0x02 0x03* 0x06 In-driver Connection: 2 0x02 0x03 -> loud volume
Kailang, what's the difference between nodes 0x02 and 0x03 for this codec? Or the DACs are setup differently?
The problem with those Realtek codecs is that they have many "hidden" functions controlled by the undocumented registers.
I have not tested 0x03. Also, both pair of stereo speakers should be connected to one DAC for X1 otherwise we will lose the volume control.
Thanks for your reply, however, that statement is incorrect.
The bass speakers don't need to be connected to the same DAC as the front speakers. In fact, I found that it's better to connect them to different DACs: that gives louder max volume and that also gives individual control for front and bass speakers. But it has to be the right DACs: 0x02 and 0x03, not 0x02 and 0x06!
As I wrote in my first mail in this thread,
Applying the following diff brings the volume back to previous levels and brings functional volume control:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I'm not suggesting to simply revert commit d2cd795c4ece ("ALSA: hda - fixup for the bass speaker on Lenovo Carbon X1 7th gen"), I'm suggesting to use a different quirk.
I went back and collected detailed observations regarding the mixer controls with each quirk. pavucontrol controls are reported with the device configured with the "Analog Surround 4.0 Output" profile.
no quirk -> Loud max output volume DAC connection Connection: 3 0x02 0x03 0x06* Controls in alsamixer Master controls front speakers only. Speaker controls front speakers only. Bass Speaker is a toggle that mutes everything. PCM controls all speakers. There is no "Front" mixer. Controls in pavucontrol "Front Left"/"Front Right" sliders work as expected. "Rear Left"/"Rear Right" sliders seem to operate in a non-linear fashion such that most values above 0% result in max volume output. This is probably linked to the fact that "Bass Speaker" is just a toggle in alsamixer. -> Because the bass speakers (Rear) are more powerful, the net effect is that when the channels are linked into a single slider, it seems like it has just two modes: mute or max. ALC285_FIXUP_SPEAKER2_TO_DAC1 -> Weak (~60%) max output volume DAC connection Connection: 3 0x02* 0x03 0x06 In-driver Connection: 1 0x02 Controls in alsamixer Master controls all four speakers. Speaker controls all four speakers. Bass Speaker is a toggle that mutes everything. PCM controls all four speakers. There is no "Front" mixer. Controls in pavucontrol "Front Left"/"Front Right" sliders have no effect. "Rear Left"/"Rear Right" sliders control both front and bass speakers. -> Volume control is effective but it's not possible to control front and bass speakers individually. ALC295_FIXUP_DISABLE_DAC3 -> Loud max output volume DAC connection Connection: 3 0x02 0x03* 0x06 In-driver Connection: 2 0x02 0x03 Controls in alsamixer Master controls all speakers. Speaker is a toggle that mutes everything. Bass Speaker controls bass speakers only. PCM controls all speakers. Front controls front speakers only. Controls in pavucontrol "Front Left"/"Front Right" sliders control front speakers only. "Rear Left"/"Rear Right" sliders control bass speakers only. -> Volume control is effective and it's possible to control each of the four speakers individually.
In summary, ALC295_FIXUP_DISABLE_DAC3 offers the loudest max volume and the most detailed mixer controls. I'll send patches shortly.
Another interesting fact that I found while looking more into this is that the Audio device PCI SSID on the Carbon is 0x2292 but the codec SSID is 0x2293!
If you have access to an X1 7th gen of some sort (Carbon or Yoga), please post `dmidecode -t system`, `lspci -vnn` and the content of "/proc/asound/card0/codec#0" so that we can better compare in case of different behavior.