Acer Aspire 5 issue when headphone plug in before login

Bug #1944575 reported by Bijay Shah
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Hello,

Acer Aspire A515-56-57XR with ALC255 when headphone is plugged in before login causes few issues. I will list them below:
- When headphones are plugged in and if I restart/shutdown-turn on the laptop and log in it does not detect headphones microphone at all and internal microphone is selected by default.
- For output device headphones are plugged in but left/right channel is merged into both channels
- To fix this need to re-plug the headphones/earphones and the issue goes away or after a restart/shutdown plug in only after logging in.
- This issue does not occur when log off and log in only after a restart or cold boot from a shutdown while headphones/earphones are left plugged in.

In another similar thread to this lots of other issues were fixed and they have been already merged into official kernel now. I will put a link to it below for reference. Looking to fix this issue now.
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1930188
---
ProblemType: Bug
ApportVersion: 2.20.11-0ubuntu27.20
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: bijay 2343 F.... pulseaudio
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
DistroRelease: Ubuntu 20.04
InstallationDate: Installed on 2021-04-19 (156 days ago)
InstallationMedia: Ubuntu 20.04.1 LTS "Focal Fossa" - Release amd64 (20200731)
Lsusb:
 Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
 Bus 001 Device 002: ID 0408:a061 Quanta Computer, Inc. HD User Facing
 Bus 001 Device 003: ID 8087:0026 Intel Corp.
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
MachineType: Acer Aspire A515-56
Package: linux (not installed)
ProcFB: 0 i915drmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.11.0-34-generic root=UUID=9c557228-52d9-4013-9bdb-4e16712575d1 ro quiet splash vt.handoff=7
ProcVersionSignature: Ubuntu 5.11.0-34.36~20.04.1-generic 5.11.22
RelatedPackageVersions:
 linux-restricted-modules-5.11.0-34-generic N/A
 linux-backports-modules-5.11.0-34-generic N/A
 linux-firmware 1.187.16
Tags: focal
Uname: Linux 5.11.0-34-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip docker lpadmin lxd plugdev sambashare sudo www-data
_MarkForUpload: True
dmi.bios.date: 05/26/2021
dmi.bios.release: 1.12
dmi.bios.vendor: Insyde Corp.
dmi.bios.version: V1.12
dmi.board.asset.tag: Type2 - Board Chassis Location
dmi.board.name: Iris_TL
dmi.board.vendor: TGL
dmi.board.version: V1.12
dmi.chassis.type: 10
dmi.chassis.vendor: Acer
dmi.chassis.version: V1.12
dmi.ec.firmware.release: 1.12
dmi.modalias: dmi:bvnInsydeCorp.:bvrV1.12:bd05/26/2021:br1.12:efr1.12:svnAcer:pnAspireA515-56:pvrV1.12:sku0000000000000000:rvnTGL:rnIris_TL:rvrV1.12:cvnAcer:ct10:cvrV1.12:
dmi.product.family: Aspire 5
dmi.product.name: Aspire A515-56
dmi.product.sku: 0000000000000000
dmi.product.version: V1.12
dmi.sys.vendor: Acer

Revision history for this message
Bijay Shah (bijay135) wrote :
Revision history for this message
Bijay Shah (bijay135) wrote :
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1944575

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Bijay Shah (bijay135) wrote : AlsaInfo.txt

apport information

tags: added: apport-collected focal
description: updated
Revision history for this message
Bijay Shah (bijay135) wrote : CRDA.txt

apport information

Revision history for this message
Bijay Shah (bijay135) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Bijay Shah (bijay135) wrote : IwConfig.txt

apport information

Revision history for this message
Bijay Shah (bijay135) wrote : Lspci.txt

apport information

Revision history for this message
Bijay Shah (bijay135) wrote : Lspci-vt.txt

apport information

Revision history for this message
Bijay Shah (bijay135) wrote : Lsusb-t.txt

apport information

Revision history for this message
Bijay Shah (bijay135) wrote : Lsusb-v.txt

apport information

Revision history for this message
Bijay Shah (bijay135) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Bijay Shah (bijay135) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Bijay Shah (bijay135) wrote : ProcEnviron.txt

apport information

Revision history for this message
Bijay Shah (bijay135) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Bijay Shah (bijay135) wrote : ProcModules.txt

apport information

Revision history for this message
Bijay Shah (bijay135) wrote : PulseList.txt

apport information

Revision history for this message
Bijay Shah (bijay135) wrote : RfKill.txt

apport information

Revision history for this message
Bijay Shah (bijay135) wrote : UdevDb.txt

apport information

Revision history for this message
Bijay Shah (bijay135) wrote : WifiSyslog.txt

apport information

Revision history for this message
Bijay Shah (bijay135) wrote : acpidump.txt

apport information

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Hui Wang (hui.wang) wrote :

Hi Bijay,

If you add "options snd-hda-intel dmic_detect=0" to the /etc/modprobe.d/alsa-base.conf, plug the headset and reboot, could you still reproduce this issue? (this testing will force to use legacy hda audio driver instead of sof audio driver).

Revision history for this message
Bijay Shah (bijay135) wrote (last edit ):

Hello, I was using exactly this for many months and even when the fix was already released for sometime, it worked fine mostly across reboot, shutdown and all, no issues with microphone detection or headphone channels merging into both with legacy driver.

Revision history for this message
Hui Wang (hui.wang) wrote :

I met a similar issue before, but the difference is both sof driver and legacy hda driver can't detect mic, please see that commit header below:
commit 3f74249057827c5f6676c41c18f6be12ce1469ce
Author: Hui Wang <email address hidden>
Date: Mon Sep 14 14:51:18 2020 +0800

    ALSA: hda/realtek - Couldn't detect Mic if booting with headset plugged

    We found a Mic detection issue on many Lenovo laptops, those laptops
    belong to differnt models and they have different audio design like
    internal mic connects to the codec or PCH, they all have this problem,
    the problem is if plugging a headset before powerup/reboot the
    machine, after booting up, the headphone could be detected but Mic
    couldn't. If we plug out and plug in the headset, both headphone and
    Mic could be detected then.

Maybe it could fix your machine too with a similar fix, add spec->codec_variant != ALC269_TYPE_ALC255 like below:
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3532,7 +3532,8 @@ static void alc256_shutup(struct hda_codec *codec)
         * when booting with headset plugged. So skip setting it for the codec alc257
         */
        if (spec->codec_variant != ALC269_TYPE_ALC257 &&
- spec->codec_variant != ALC269_TYPE_ALC256)
+ spec->codec_variant != ALC269_TYPE_ALC256 &&
+ spec->codec_variant != ALC269_TYPE_ALC255)
                alc_update_coef_idx(codec, 0x46, 0, 3 << 12);

If you couldn't build the testing kernel, let me know, I will build a kernel with that change.

Revision history for this message
Hui Wang (hui.wang) wrote :

Another changes worth trying are:
add boot parameter snd_sof_pci.sof_pci_debug=1 /* this will disable the controller runtime pm */
do some change as below: /* this will disable the codec runtime pm */
--- a/sound/soc/intel/boards/skl_hda_dsp_generic.c
+++ b/sound/soc/intel/boards/skl_hda_dsp_generic.c
@@ -116,7 +116,7 @@ static char hda_soc_components[30];
 #define IDISP_ROUTE_COUNT (IDISP_DAI_COUNT * 2)
 #define IDISP_CODEC_MASK 0x4

-#define HDA_CODEC_AUTOSUSPEND_DELAY_MS 1000
+#define HDA_CODEC_AUTOSUSPEND_DELAY_MS 0

 static int skl_hda_fill_card_info(struct snd_soc_acpi_mach_params *mach_params)
 {

Revision history for this message
Bijay Shah (bijay135) wrote :

The 1st fix seems like it would work. Could you build a custom kernel with the 1st fix. I am not familiar on how to build custom kernels with changes/fixes. Thanks.

2nd one seems more like a temporary quick fix than a real fix. So, maybe if 1st does not work can try it later.

Revision history for this message
Hui Wang (hui.wang) wrote :

The testing kernel with the fix of #24:

https://people.canonical.com/~hwang4/lp1944575/

Revision history for this message
Bijay Shah (bijay135) wrote (last edit ):

I tested this kernel found no change at all. Still left/right channel are merged into both for headphones and microphone is not detected after a shutdown/power up or reboot.

Revision history for this message
Hui Wang (hui.wang) wrote :
Revision history for this message
Bijay Shah (bijay135) wrote (last edit ):

I tested this as well for shutdown/power up and reboot still same issue no changes at all.

Revision history for this message
Hui Wang (hui.wang) wrote :

Please upload the dmesg of the kernel in the #29.

Revision history for this message
Bijay Shah (bijay135) wrote :

Here is the dmesg log. I reinstalled the kernel in #29 again and booted into it, did a reboot first then a shutdown/power on. This log is right after that.

Revision history for this message
Bijay Shah (bijay135) wrote :

Hi can this be continued? I know it's a small issue but becomes issue really fast when you have to restart/shutdown system multiple times a day and need to re plug earphones/headphones every time in order for everything to work. Thanks.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.