Skip to content

Speaker misconfigured on Spectre x360 (Tiger Lake) #2631

Closed

Description

@kyonifer

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:

  1. Passing patch=... to snd-hda-intel. This is what hdajackretask does, which seems to not take effect when using sof (i.e. when snd-intel-dspcfg dsp_driver=1 is not set)
  2. 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 to hwC0D0/reconfig and 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

  1. plbossart commented on Dec 14, 2020

    @plbossart
    Member

    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.

  2. tiwai commented on Dec 14, 2020

    @tiwai

    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.

  3. kv2019i commented on Dec 14, 2020

    @kv2019i
    Collaborator

    @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.

  4. kyonifer commented on Dec 14, 2020

    @kyonifer
    Author

    Thanks for the help from all.

    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.

    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.

    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.

    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-v5 seems 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.

  5. tiwai commented on Dec 15, 2020

    @tiwai

    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.

  6. kyonifer commented on Dec 31, 2020

    @kyonifer
    Author

    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

    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:

    - Set pin 0x14 to "Internal speaker"
    - Set pin 0x17 to "Internal speaker (back)"
    - Set pin 0x1e to "Dock Line out"
    

    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:

    hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DIR 0x01
    hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_MASK 0x01
    hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DATA 0x01
    hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DATA 0x00
    

    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:

    0x14 0x90170150 (front)
    0x17 0x90170152 (bottom)
    0x19 0x03a11040 (microphone)
    0x1e 0x220140b0 (enable volume control on bottom)
    

    Unfortunately I haven't been able to find an off-the-shelf hda_model that has that configuration. So, to get the 4-speaker setup working under sof (and thereby have the dmic work) probably some additional support such as patch= or /sys/class/*/reconfig will be needed.

    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.

    I gave 5.11-rc1 a shot but the behavior looks unmodified. Running e.g.

    echo 0x14 0x90170150 > /sys/class/sound/hwC0D0/user_pin_configs
    echo 1 > /sys/class/sound/hwC0D0/reconfig
    

    as root causes the process to hang indefinitely. dmesg reports no errors:

    snd_hda_codec_realtek ehdaudio0D0: hda-codec: reconfiguring
    

    Restarting pulse after an attempted reconfig yields only a dummy output. Rebooting restores the original devices.

  7. kdknigga commented on Jan 18, 2021

    @kdknigga

    I have a Spectre x360 15t-df000 (late 2018, Coffee Lake CPU, Cannon Lake/ALC285/"Bang & Olufsen" sound). hda_model=aspire-v5 gets my sound output working marginally and my digital mic working as well, but the hda-verb commands 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-verb has 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions