Repository navigation
Speaker misconfigured on Spectre x360 (Tiger Lake) #2631
Description
Apologies in advance if this is the wrong tracker to open this ticket in, I wasn't sure which subsystem was ultimately responsible.
I'm running Fedora 33 on a Spectre x360 (full alsa-info system description here). From the log we see it configures by default to:
[ 17.339080] snd_hda_codec_realtek ehdaudio0D0: autoconfig for ALC285: line_outs=1 (0x17/0x0/0x0/0x0/0x0) type:speaker
[ 17.339082] snd_hda_codec_realtek ehdaudio0D0: speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[ 17.339083] snd_hda_codec_realtek ehdaudio0D0: hp_outs=1 (0x21/0x0/0x0/0x0/0x0)
[ 17.339084] snd_hda_codec_realtek ehdaudio0D0: mono: mono_out=0x0
[ 17.339084] snd_hda_codec_realtek ehdaudio0D0: inputs:
[ 17.339085] snd_hda_codec_realtek ehdaudio0D0: Mic=0x19
Speaker and microphone both show up as devices in pulse and microphone works fine, however no audio is heard on the built-in speakers. Suspecting a misconfigured pin, I reverted to legacy mode by passing snd-intel-dspcfg dsp_driver=1 and then used hdajackretask to guess and check. Setting pin 0x17 to unmapped and pin 0x14 to speaker successfully enables the speaker and sound is produced. Therefore, I believe the issue is the bios reporting the wrong pin for the system's connected speakers (should be 0x14 instead of 0x17). In this configuration with the speaker working, dmesg reports
[ 11.978717] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[ 12.044472] snd_hda_codec_realtek hdaudioC0D0: autoconfig for ALC285: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker
[ 12.044474] snd_hda_codec_realtek hdaudioC0D0: speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[ 12.044475] snd_hda_codec_realtek hdaudioC0D0: hp_outs=1 (0x21/0x0/0x0/0x0/0x0)
[ 12.044476] snd_hda_codec_realtek hdaudioC0D0: mono: mono_out=0x0
[ 12.044476] snd_hda_codec_realtek hdaudioC0D0: inputs:
[ 12.044477] snd_hda_codec_realtek hdaudioC0D0: Mic=0x19
This would be a viable workaround, except that the microphone is a dmic and therefore doesn't work when the dsp is disabled (i.e. when snd-intel-dspcfg dsp_driver=1 is set). If I remove the snd-intel-dspcfg dsp_driver=1 option, then the pin override from hdajackretask no longer works and the speaker doesn't work. Things I've tried:
- Passing
patch=...tosnd-hda-intel. This is whathdajackretaskdoes, which seems to not take effect when using sof (i.e. whensnd-intel-dspcfg dsp_driver=1is not set) - Override the pin configs in
/sys/class/sound/hwC0D0. After shutting down pulse and alsactl (the only two things listening), the process hangs on the write tohwC0D0/reconfigand no pins are reconfigured.
Is there a way to override the pin configuration when SOF is enabled similar to the patch= parameter to snd-hda-intel? Alternatively, is this the correct place to file a ticket to upstream a long-term fix for this model?
Activity
plbossart commentedon Dec 14, 2020
Thanks @kyonifer for the report. Our goals were to share the same HDAudio code between legacy and SOF drivers, if you see a case where the HDaudio legacy driver works and the SOF driver doesn't, it's a bug.
That said I personally know very little about retasking. The patch mechanism should work, I have no clue why the parameter has no effect. @kv2019i @tiwai FYI.
tiwai commentedon Dec 14, 2020
The bug with HD-audio reconfig is already known and very recently addressed. But I haven't tested it with SOF, so something might be broken.
Speaking of the patch option: I'm afraid that it's actually missing in sof-hda. sof-hda provides hda_model option, but not the one equivalent with patch option of snd-hda-intel.
kv2019i commentedon Dec 14, 2020
@tiwai @plbossart Indeed SOF is missing patch support. I've been tracking it in #990 that tracks remaining delta and cleanup items in SOF's HDA support and "patch" is one of the missing one. So far we've not needed this on any platform where DSP, but here seems to be a genuine case.
kyonifer commentedon Dec 14, 2020
Thanks for the help from all.
Not sure if there is another component that would need to be updated to incorporate the fix, but it still hangs for me on kernel 5.10.0.
Thanks for pointing me in this direction-- I managed to find another model that was compatible and enable both the microphone and speakers under SOF.
For posterity in case someone else with this model comes across this:
options snd-sof-intel-hda-common hda_model=aspire-v5seems to be compatible with this hardware. This will get the basic two speaker setup to work, but not the additional ones. Probably some amount of verb extracting from the windows drivers will be necessary for this model similar to what was necessary for the old x360, but that's a bug hunt for another day.It sounds like there's already another issue tracking patch support, so I'll go ahead and close this one out. Thanks again all.
tiwai commentedon Dec 15, 2020
Note that the fix for hd-audio reconfig was done in the last week, and it's not included in 5.10.
There are two patches: one in driver core and another in HD-audio side. Those should be included in 5.11-rc1 and backported later to stable trees.
kyonifer commentedon Dec 31, 2020
I played around with it a bit and managed to get all 4 speakers working. It turns out the config Fred Krauss found for the 13-ae0xx also works for this model, namely:
where the 0x1e pin enables the volume control for some reason.
However, for the bottom speakers connected to 0x17 to light up some additional commands are needed to turn on the amplifier:
So the autoconfig 0x17 pin was correct, but the amplifier wasn't on so it produced silence by default. However, I still need to manually override the 0x14 and 0x1e pins, namely:
Unfortunately I haven't been able to find an off-the-shelf
hda_modelthat has that configuration. So, to get the 4-speaker setup working undersof(and thereby have the dmic work) probably some additional support such aspatch=or/sys/class/*/reconfigwill be needed.I gave 5.11-rc1 a shot but the behavior looks unmodified. Running e.g.
as root causes the process to hang indefinitely.
dmesgreports no errors:Restarting pulse after an attempted
reconfigyields only a dummy output. Rebooting restores the original devices.kdknigga commentedon Jan 18, 2021
I have a Spectre x360 15t-df000 (late 2018, Coffee Lake CPU, Cannon Lake/ALC285/"Bang & Olufsen" sound).
hda_model=aspire-v5gets my sound output working marginally and my digital mic working as well, but thehda-verbcommands that are working for other HP Spectres aren't working for me. In fact, the above listed commands make my left channel sound strong and good, but the right channel disappears completely.I'm interested in figuring out how to map the correct GPIO settings to get sound output working well, but my semi-random poking with
hda-verbhas uncovered nothing. I have downloaded the Windows drivers and plan on trying to mine them for information, but if there are ideas on how/where to start, I'm interested in hearing them. I'll report back anything I learn.