Realtek ALC256M with DTS Audio Processing internal microphone doesn't work on Redmi Book 14 2019

Bug #1846148 reported by Lilian Tao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Undecided
Unassigned
Disco
Fix Released
Undecided
Unassigned

Bug Description

Sound works okay but the internal mic doesn't work.
When I plug in headset, the mic on headset also doens't work.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: alsa-base 1.0.25+dfsg-0ubuntu5
ProcVersionSignature: Ubuntu 5.0.0-29.31~18.04.1-generic 5.0.21
Uname: Linux 5.0.0-29-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.20.9-0ubuntu7.7
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: lilian 1689 F.... pulseaudio
CurrentDesktop: ubuntu:GNOME
Date: Tue Oct 1 12:27:10 2019
InstallationDate: Installed on 2019-09-21 (9 days ago)
InstallationMedia: Ubuntu 18.04.3 LTS "Bionic Beaver" - Release amd64 (20190805)
PackageArchitecture: all
SourcePackage: alsa-driver
Symptom: audio
Title: PCI/internal sound card not detected
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 08/19/2019
dmi.bios.vendor: TIMI
dmi.bios.version: RMRCM400P0100
dmi.board.name: TM1901
dmi.board.vendor: TIMI
dmi.chassis.type: 10
dmi.chassis.vendor: TIMI
dmi.modalias: dmi:bvnTIMI:bvrRMRCM400P0100:bd08/19/2019:svnTIMI:pnRedmiBook14:pvr:rvnTIMI:rnTM1901:rvr:cvnTIMI:ct10:cvr:
dmi.product.family: Mi Laptop
dmi.product.name: RedmiBook 14
dmi.product.sku: TM1901-24822
dmi.sys.vendor: TIMI

Revision history for this message
Lilian Tao (nintao) wrote :
You-Sheng Yang (vicamo)
Changed in alsa-driver (Ubuntu):
status: New → Confirmed
Revision history for this message
Hui Wang (hui.wang) wrote :

There is no any internal mic or external mic defined according to the init verb.

Does those mics work under windows? If yes, please collect the log under windows.

Revision history for this message
Lilian Tao (nintao) wrote :

sorry for getting back to you late.
Tried to collect the logs under windows with RtHDDump but error reported:
"The HD audio codec could not be found in your system"
But the mic is working.
Attached the error message.

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

please install this dkms " sudo dpkg -i oem-audio-xxx.deb" and reboot

please check if there is internal mic now (through gnome-control-center sound), and if we can record sound through internal mic.

if it doesn't work, please upload the alsa-info.txt after applying this deb.

Revision history for this message
Lilian Tao (nintao) wrote :

@hui.wang

installed the deb package but still didn't work.
One thing did change: the input used to be "dummy audio xxx" and now it's "analog input - built in audio".

Uploaded the alsa-info.txt and the scrennshot.

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

reply #5, did you reboot after installing the deb?

Revision history for this message
Lilian Tao (nintao) wrote :

reply #8, yes i rebooted.

Revision history for this message
Lilian Tao (nintao) wrote :

retry installation and got a couple of warnings:

Module has been obsoleted due to being included
in kernel 4.99. We will avoid installing
for future kernels above 4.99.
You may override by specifying --force.

logs attached.

Revision history for this message
Lilian Tao (nintao) wrote :

 uname -srm
Linux 5.0.0-29-generic x86_64

upload dmesg

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

Please test this kernel: https://people.canonical.com/~hwang4/lp1846148/

sudo dpkg -i linux-modules-xxxx.deb
sudo dpkg -i linux-modules-extra-xxx.deb
sudo dpkg -i linux-image-xxx.deb

reboot and boot with the new installed kernel.

upload dmesg and alsa-info.txt.

Revision history for this message
Lilian Tao (nintao) wrote :

The behavior is different with the test kernel. please find the screenshot and the alsa-info below.

Revision history for this message
Lilian Tao (nintao) wrote :
Revision history for this message
Lilian Tao (nintao) wrote :
Revision history for this message
Lilian Tao (nintao) wrote :

also dmesg

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

The testing kernel in the #12 is for fixing the internal mic, so no need to test external mic plugging (#13).

For #14, it is internal mic, could you record sound with internal mic?

Revision history for this message
Lilian Tao (nintao) wrote :

Reploy #17, no, no sound could be record. all quiet.

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

So, It looks like we need to set some coeff to make the internal mic work, but only Realtek engineers know how to set the coeff registers.

And do one more test for external mic:

run sudo hdajacksensetest -a
plug the headset or external mic
run sudo hdajacksensetest -a again

upload the output-before.txt and output-after.txt.

Revision history for this message
Lilian Tao (nintao) wrote :

@hui.wang,

Thanks a lot for the reply.

1)
sudo hdajacksensetest -a
Pin 0x12 (Internal Mic): present = No
Pin 0x13 (Not connected): present = No
Pin 0x14 (Internal Speaker): present = No
Pin 0x18 (Not connected): present = No
Pin 0x19 (Not connected): present = Yes
Pin 0x1a (Not connected): present = No
Pin 0x1b (Not connected): present = No
Pin 0x1d (Not connected): present = No
Pin 0x1e (Not connected): present = No
Pin 0x21 (Black Headphone, Left side): present = No

2) plug in

3)

 sudo hdajacksensetest -a
Pin 0x12 (Internal Mic): present = No
Pin 0x13 (Not connected): present = No
Pin 0x14 (Internal Speaker): present = No
Pin 0x18 (Not connected): present = No
Pin 0x19 (Not connected): present = Yes
Pin 0x1a (Not connected): present = No
Pin 0x1b (Not connected): present = No
Pin 0x1d (Not connected): present = No
Pin 0x1e (Not connected): present = No
Pin 0x21 (Black Headphone, Left side): present = Yes

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

According to #20, there is no change for external mic plugging, so we could not fix it by ourselves.

The best way is to notify the XiaoMi and let them ask for help from realtek.

Revision history for this message
Lilian Tao (nintao) wrote :

okay, thanks a lot for your help.
I appreciate your time and advises.

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

I got a new version rthddump tools, if you have time, please use this to dump the log on windows10, then I will compare them with the one under linux.

Revision history for this message
Lilian Tao (nintao) wrote :

in reply to #23, @hui.wang please find the dump from window10 in attachment.

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

Please install and test this kernel, at least you could see the internal mic, and maybe the internal mic can work.

https://people.canonical.com/~hwang4/redmi/v1/

And please also test the external mic.

If they don't work as expected, please collect an alsa-info.txt with coeff enabled.

sudo su
echo 1 > /sys/module/snd_hda_codec/parameters/dump_coef
Then run alsa-info to collect alsa-info.txt.

thx.

Revision history for this message
Lilian Tao (nintao) wrote :

1. installed as the order below:
sudo dpkg -i linux-image-xxx.deb
sudo dpkg -i linux-modules-xxxx.deb
sudo dpkg -i linux-modules-extra-xxx.deb

2. restart and boot to the test kernel.

3. Open settings and find Input tag from Sound.
- The internal mic was not visible

3. insert the external mic
- It appears as "Microphone - BuiltinAudio"
- unplug it, still appears as "Microphone - BuiltinAudio"

4. Test recording for no external mic case:
- Only random electric noise.

5. Test recording for external mic case
- Only random electric noise.

Attached alsa-info.ext collected

Revision history for this message
Lilian Tao (nintao) wrote :

1) external mic not plugin

:~$ sudo hdajacksensetest -a
[sudo] password for lilian:
Pin 0x12 (Not connected): present = No
Pin 0x13 (Not connected): present = No
Pin 0x14 (Internal Speaker): present = No
Pin 0x18 (Not connected): present = No
Pin 0x19 (Black Mic, Left side): present = Yes
Pin 0x1a (Black Mic, Right side): present = No
Pin 0x1b (Not connected): present = No
Pin 0x1d (Not connected): present = No
Pin 0x1e (Not connected): present = No
Pin 0x21 (Black Headphone, Left side): present = No

External mic plug in

sudo hdajacksensetest -a
Pin 0x12 (Not connected): present = No
Pin 0x13 (Not connected): present = No
Pin 0x14 (Internal Speaker): present = No
Pin 0x18 (Not connected): present = No
Pin 0x19 (Black Mic, Left side): present = Yes
Pin 0x1a (Black Mic, Right side): present = No
Pin 0x1b (Not connected): present = No
Pin 0x1d (Not connected): present = No
Pin 0x1e (Not connected): present = No
Pin 0x21 (Black Headphone, Left side): present = Yes

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

please test the v2 kernel, at least you could see a front mic as internal mic from UI.

https://people.canonical.com/~hwang4/redmi/v2/

make sure the kernel is redmiv2 by checking with uname -a

thx.

Revision history for this message
Lilian Tao (nintao) wrote :

uname -a
Linux lilian-dev 5.0.0-37-generic #41+redmiv2 SMP Mon Nov 18 05:09:35 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

1. installed as the order below:
  789 sudo dpkg -i linux-headers-5.0.0-37_5.0.0-37.41+redmiv2_all.deb
  790 sudo dpkg -i linux-headers-5.0.0-37-generic_5.0.0-37.41+redmiv2_amd64.deb
  792 sudo dpkg -i linux-modules-5.0.0-37-generic_5.0.0-37.41+redmiv2_amd64.deb
  793 sudo dpkg -i linux-modules-extra-5.0.0-37-generic_5.0.0-37.41+redmiv2_amd64.deb
  794 sudo dpkg -i linux-image-unsigned-5.0.0-37-generic_5.0.0-37.41+redmiv2_amd64.deb

2. restart and boot to the test kernel.

3. Open settings and find Input tag from Sound.
- The internal mic was not visible

3. insert the external mic
- It appears as "Microphone - BuiltinAudio"
- unplug it, still appears as "Microphone - BuiltinAudio"

4. Test recording for no external mic case:
- no sound at all.
- no change even change the input sound level to max in settings

5. Test recording for external mic case
- no sound at all.
- no change even change the input sound level to max in settings

Attached alsa-info.ext collected

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

Ah I know why your internal mic doens't work, it is a new HW design, the internal mic is connected to PCH instead of codec, so it needs sof driver and firmware/tplg/ucm to work. But so far, we don't have them for Xiaomi.

We only have some files which are specific to some dell machines and lenovo machines.

this is a similar bug to https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1852922

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

So let us try to fix the problem on external mic. when you have time, please install the v3 kernel, then plug headset to test the external mic.

thx.

https://people.canonical.com/~hwang4/redmi/v3

Revision history for this message
Lilian Tao (nintao) wrote :

@hui.wang

Reply to #30
ahh...bad news...

Reploy to #31
uname -a
Linux lilian-dev 5.0.0-37-generic #41+redmiv3 SMP Mon Nov 18 13:48:44 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

working with this V3 Kernel, with external mic. (thank you!)

Hui Wang (hui.wang)
affects: alsa-driver (Ubuntu) → linux (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (8.6 KiB)

This bug was fixed in the package linux - 5.4.0-9.12

---------------
linux (5.4.0-9.12) focal; urgency=medium

  * alsa/hda/realtek: the line-out jack doens't work on a dell AIO
    (LP: #1855999)
    - SAUCE: ALSA: hda/realtek - Line-out jack doesn't work on a Dell AIO

  * scsi: hisi_sas: Check sas_port before using it (LP: #1855952)
    - scsi: hisi_sas: Check sas_port before using it

  * CVE-2019-19078
    - ath10k: fix memory leak

  * cifs: DFS Caching feature causing problems traversing multi-tier DFS setups
    (LP: #1854887)
    - cifs: Fix retrieval of DFS referrals in cifs_mount()

  * Support DPCD aux brightness control (LP: #1856134)
    - SAUCE: drm/i915: Fix eDP DPCD aux max backlight calculations
    - SAUCE: drm/i915: Assume 100% brightness when not in DPCD control mode
    - SAUCE: drm/i915: Fix DPCD register order in intel_dp_aux_enable_backlight()
    - SAUCE: drm/i915: Auto detect DPCD backlight support by default
    - SAUCE: drm/i915: Force DPCD backlight mode on X1 Extreme 2nd Gen 4K AMOLED
      panel
    - USUNTU: SAUCE: drm/i915: Force DPCD backlight mode on Dell Precision 4K sku

  * The system cannot resume from S3 if user unplugs the TB16 during suspend
    state (LP: #1849269)
    - PCI: pciehp: Do not disable interrupt twice on suspend
    - PCI: pciehp: Prevent deadlock on disconnect

  * change kconfig of the soundwire bus driver from y to m (LP: #1855685)
    - [Config]: SOUNDWIRE=m

  * alsa/sof: change to use hda hdmi codec driver to make hdmi audio on the
    docking station work (LP: #1855666)
    - ALSA: hda/hdmi - implement mst_no_extra_pcms flag
    - ASoC: hdac_hda: add support for HDMI/DP as a HDA codec
    - ASoC: Intel: skl-hda-dsp-generic: use snd-hda-codec-hdmi
    - ASoC: Intel: skl-hda-dsp-generic: fix include guard name
    - ASoC: SOF: Intel: add support for snd-hda-codec-hdmi
    - ASoC: Intel: bxt-da7219-max98357a: common hdmi codec support
    - ASoC: Intel: glk_rt5682_max98357a: common hdmi codec support
    - ASoC: intel: sof_rt5682: common hdmi codec support
    - ASoC: Intel: bxt_rt298: common hdmi codec support
    - ASoC: SOF: enable sync_write in hdac_bus
    - [config]: SND_SOC_SOF_HDA_COMMON_HDMI_CODEC=y

  * Fix unusable USB hub on Dell TB16 after S3 (LP: #1855312)
    - SAUCE: USB: core: Make port power cycle a seperate helper function
    - SAUCE: USB: core: Attempt power cycle port when it's in eSS.Disabled state

  * Focal update: v5.4.3 upstream stable release (LP: #1856583)
    - rsi: release skb if rsi_prepare_beacon fails
    - arm64: tegra: Fix 'active-low' warning for Jetson TX1 regulator
    - arm64: tegra: Fix 'active-low' warning for Jetson Xavier regulator
    - perf scripts python: exported-sql-viewer.py: Fix use of TRUE with SQLite
    - sparc64: implement ioremap_uc
    - lp: fix sparc64 LPSETTIMEOUT ioctl
    - time: Zero the upper 32-bits in __kernel_timespec on 32-bit
    - mailbox: tegra: Fix superfluous IRQ error message
    - staging/octeon: Use stubs for MIPS && !CAVIUM_OCTEON_SOC
    - usb: gadget: u_serial: add missing port entry locking
    - serial: 8250-mtk: Use platform_get_irq_optional() for optional irq
    - tty: serial: fsl_lpuart: use the sg ...

Read more...

Changed in linux (Ubuntu):
status: Confirmed → Fix Released
Changed in linux (Ubuntu Disco):
status: New → Fix Committed
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-disco' to 'verification-done-disco'. If the problem still exists, change the tag 'verification-needed-disco' to 'verification-failed-disco'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-disco
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (22.6 KiB)

This bug was fixed in the package linux - 5.0.0-40.44

---------------
linux (5.0.0-40.44) disco; urgency=medium

  * disco/linux: 5.0.0-40.44 -proposed tracker (LP: #1859724)

  * use-after-free in i915_ppgtt_close (LP: #1859522) // CVE-2020-7053
    - SAUCE: drm/i915: Fix use-after-free when destroying GEM context

  * CVE-2019-14615
    - drm/i915/gen9: Clear residual context state on context switch

  * System hang with kernel traces while entering reboot process on a Disco
    ARM64 moonshot node (LP: #1859582)
    - Revert "RDMA/cm: Fix memory leak in cm_add/remove_one"

linux (5.0.0-39.43) disco; urgency=medium

  * disco/linux: 5.0.0-39.43 -proposed tracker (LP: #1858547)

  * [Regression] usb usb2-port2: Cannot enable. Maybe the USB cable is bad?
    (LP: #1856608)
    - SAUCE: Revert "usb: handle warm-reset port requests on hub resume"

  * PAN is broken for execute-only user mappings on ARMv8 (LP: #1858815)
    - arm64: Revert support for execute-only user mappings

  * Fix unusable USB hub on Dell TB16 after S3 (LP: #1855312)
    - SAUCE: USB: core: Make port power cycle a seperate helper function
    - SAUCE: USB: core: Attempt power cycle port when it's in eSS.Disabled state

  * [sas-1126]scsi: hisi_sas: Fix out of bound at debug_I_T_nexus_reset()
    (LP: #1853992)
    - scsi: hisi_sas: Fix out of bound at debug_I_T_nexus_reset()

  * [sas-1126]scsi: hisi_sas: Assign NCQ tag for all NCQ commands (LP: #1853995)
    - scsi: hisi_sas: Assign NCQ tag for all NCQ commands

  * [sas-1126]scsi: hisi_sas: Fix the conflict between device gone and host
    reset (LP: #1853997)
    - scsi: hisi_sas: Fix the conflict between device gone and host reset

  * scsi: hisi_sas: Check sas_port before using it (LP: #1855952)
    - scsi: hisi_sas: Check sas_port before using it

  * CVE-2019-18885
    - btrfs: refactor btrfs_find_device() take fs_devices as argument
    - btrfs: merge btrfs_find_device and find_device

  * Integrate Intel SGX driver into linux-azure (LP: #1844245)
    - [Packaging] Add systemd service to load intel_sgx

  * [SRU][B/OEM-B/OEM-OSP1/D/E/F] Add LG I2C touchscreen multitouch support
    (LP: #1857541)
    - SAUCE: HID: multitouch: Add LG MELF0410 I2C touchscreen support

  * cifs: DFS Caching feature causing problems traversing multi-tier DFS setups
    (LP: #1854887)
    - cifs: Fix retrieval of DFS referrals in cifs_mount()

  * qede driver causes 100% CPU load (LP: #1855409)
    - qede: Handle infinite driver spinning for Tx timestamp.

  * [roce-1126]RDMA/hns: bugfix for slab-out-of-bounds when loading hip08 driver
    (LP: #1853989)
    - RDMA/hns: Bugfix for slab-out-of-bounds when unloading hip08 driver
    - RDMA/hns: bugfix for slab-out-of-bounds when loading hip08 driver

  * [roce-1126]RDMA/hns: Fixs hw access invalid dma memory error (LP: #1853990)
    - RDMA/hns: Fixs hw access invalid dma memory error

  * [hns-1126]net: hns3: revert to old channel when setting new channel num fail
    (LP: #1853983)
    - net: hns3: revert to old channel when setting new channel num fail

  * [hns-1126]net: hns3: fix port setting handle for fibre port
    (LP: #1853984)
    - net: hns3: fix port setting handle for fibre...

Changed in linux (Ubuntu Disco):
status: Fix Committed → Fix Released
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-eoan' to 'verification-done-eoan'. If the problem still exists, change the tag 'verification-needed-eoan' to 'verification-failed-eoan'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-eoan
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-bionic' to 'verification-done-bionic'. If the problem still exists, change the tag 'verification-needed-bionic' to 'verification-failed-bionic'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-bionic
Hui Wang (hui.wang)
tags: added: verification-done-bionic verification-done-eoan
removed: verification-needed-bionic verification-needed-eoan
tags: added: verification-done-disco
removed: verification-needed-disco
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.