Bug 197801

Summary: No sound from right speaker
Product: Drivers Reporter: jcs (jcs)
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: NEW ---    
Severity: normal CC: daniel, hajek1, jerin04, post, ram.mehta, samsau, tiwai, tomas.fufa
Priority: P1    
Hardware: Intel   
OS: Linux   
Kernel Version: 4.14.0-rc7 Subsystem:
Regression: No Bisected commit-id:
Attachments: dmesg
alsa-info.sh output
The patch that will be merged for 5.4 kernel

Description jcs 2017-11-07 16:58:32 UTC
Created attachment 260537 [details]
dmesg

No audio comes out of the right speaker on the laptop. When playing a test video such as https://www.youtube.com/watch?v=hTvJoYnpeRQ the right-channel audio is never heard (i.e., it does not get converted into mono and played through the left speaker).

When plugging in headphones, audio is heard from both channels.

In Windows, both speakers work, so it is not a physical problem with the speakers.

This is being moved upstream from the Ubuntu bug at https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1721987

alsa-info.sh output at http://www.alsa-project.org/db/?f=dbe13f8a856c2178d5794cb787b153b6ce311a80
Comment 1 jcs 2017-11-07 17:02:25 UTC
Created attachment 260539 [details]
alsa-info.sh output
Comment 2 USER100 2018-02-25 22:37:19 UTC
Hello, is this bug assigned to anyone? Never used bug tracker before. 

Just want put more voice to this bug as I have a Matebook X as well. Only one of the speakers work. I am sure there are others buying this machine and wants to run linux variants. 

Some more info in case it helps: https://github.com/lidel/linux-on-huawei-matebook-x-2017
Comment 3 samsau 2018-03-12 05:31:32 UTC
Bump. 
I am one of the aforementioned 'others'. The problem is rather annoying and hasn't been solved as of 4.15.
Comment 4 Michal 2018-06-05 06:26:52 UTC
Mee too. I can confirm the problem on 4.16.13-1-ARCH kernel.
Comment 5 Takashi Iwai 2018-06-10 07:06:15 UTC
From the given alsa-info.sh output, there is nothing wrong there.
So it must be some vendor-specific initialization, and only Huawei knows.
Try to contact your vendor.
Comment 6 jcs 2018-11-02 22:41:15 UTC
Obviously contacting my vendor went nowhere.

While doing more testing, I get the same result of audio only through one speaker in Windows 10 with the default audio drivers that Windows ships with.  The Realtek/Dolby audio drivers from the vendor (Huawei) need to be installed in order to get sound out of both speakers in Windows, too.

I've been playing with VFIO to be able to boot Linux and hand off the PCI audio device to Windows 10 inside of qemu with the proper Realtek Windows drivers installed.  This allows me to log all of the PCI IO activity from qemu.

While doing this, I noticed that if I boot Windows 10 in qemu, then boot Linux in qemu, audio works in Linux through both speakers with no other changes.  This only works through qemu/VFIO, as rebooting the full system resets the PCI device.

So something must be getting initialized or toggled on the device in Windows that affects the device through to initialization in Linux.  One of the pins that the device presents is configured slightly different in Linux after booting Windows first (nid 0x19 0x411111f0 -> 0x811111f0), and I've tried explicitly setting that pin configuration in Linux without booting Windows first but it has no effect.

I have qemu logging all of the VFIO PCI reads and writes under Windows, and I instrumented some custom code to store the RIRBLBASE and CORBLBASE values and then print out the contents of those DMA addresses (+ current queue offset) whenever CORBWP/RIRBWP are written to, in order to be able to see the commands submitted to the CORB and the response from the RIRB when running Windows.

Is there anything else similar to the CORB/RIRB that I should be logging to try to see what else the Windows driver could be doing?

VFIO limits the emulated Windows instance to see only the PCI audio device, so there is no ACPI configuration or other IO that it could be doing other than PCI config read/write, PCI region read/write, and DMA with the audio device.  But still, there must be something the
Comment 7 jcs 2018-11-12 20:52:05 UTC
Here is the magic sequence of CORB commands needed to enable both speakers.  This is actually part of a much larger sequence that the Windows driver does, but through trial and error, this is the minimum required to make both speakers work.

I can attach the full PCI I/O and CORB logs if needed, but it's 4.6Mb.

I have no idea what these commands do, but nid 0x6 is a DAC and 0x20 is a vendor-specific nid.  It looks like the same sequence repeating over and over, but the params to 0x400 and 0x500 commands change slightly.

nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x22
nid:0x20 verb:0x400 param:0x31
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0xb
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x21 verb:0xf09 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0xc
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0xd
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0xe
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0xf
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x10
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x1a
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x40
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x1b
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x82
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x1c
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x1d
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x1e
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x1f
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x20
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0xc2
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x21
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0xc8
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x22
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x26
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x23
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x24
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x27
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0xff
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x28
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0xff
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x29
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0xff
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x2a
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x8f
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x2b
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x2
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x2c
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x48
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x2d
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x34
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x2e
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x2f
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x30
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x31
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x32
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x33
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x34
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x35
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x1
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x36
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x93
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x37
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0xc
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x38
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x39
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x3a
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0xf8
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
nid:0x6 verb:0x73e param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x6 verb:0x73e param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0xc00 param:0x0
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4f0 param:0x0
nid:0x20 verb:0x500 param:0x23
nid:0x20 verb:0x400 param:0x38
nid:0x20 verb:0x500 param:0x25
nid:0x20 verb:0x400 param:0x80
nid:0x20 verb:0x500 param:0x26
nid:0x20 verb:0x4b0 param:0x10
Comment 8 Takashi Iwai 2018-11-14 09:39:48 UTC
(In reply to jcs from comment #7)
> Here is the magic sequence of CORB commands needed to enable both speakers. 
> This is actually part of a much larger sequence that the Windows driver
> does, but through trial and error, this is the minimum required to make both
> speakers work.

That's great!

> I can attach the full PCI I/O and CORB logs if needed, but it's 4.6Mb.

If the minimal verbs work, it's fine without the full log.

> I have no idea what these commands do, but nid 0x6 is a DAC and 0x20 is a
> vendor-specific nid.  It looks like the same sequence repeating over and
> over, but the params to 0x400 and 0x500 commands change slightly.

Right, NID 0x20 is the typical widget Realtek codecs use for accessing the COEFs.
NID 0x06 is the DAC, but the verb issued there (0x73e) looks like some non-standard one.  Judging from the value used with the verb (0x00 and 0x80), it might be an extra AMP control or such.

The verb 0x500 and 0x400 are in a pair to set the COEF index and value, respectively.
The verb 0xc00 is the verb to read the COEF value of the current index.
So, it implies that Windows driver performs some reads & modify sequences.
But we cannot know which bits are actually tested, so we have to stick with the static values.

That is, likely you can remove the sequence 0x5xx:xx 0xCxx:xx.

BTW, the verb and the parameter compose 20bit values, so verb 0x4f0 param 0x00 is equivalent with the verb 0x400 param 0xf000.
Comment 9 Andreas 2019-01-04 11:06:30 UTC
Hi there,

I am also struggling with the right speaker on my Matebook X.
Is this still being worked on and can I assist in any way ?
Comment 10 tespe 2019-01-06 13:10:28 UTC
I blindly applied the verbs sequence to master's sound/pci/hda/patch_realtek.c, and stereo it's now working perfectly. Not an expert, just a very thankful user ;) 
https://github.com/tespeleta/linux/commit/761cca49e9153b7832fa3f887b875e5ad1517892
Comment 11 tespe 2019-01-16 09:06:02 UTC
I managed to re-create the recurring pattern and clean the code. I submitted a patch to alsa-dev. https://patchwork.kernel.org/patch/10764291/
Comment 12 Takashi Iwai 2019-08-09 14:56:00 UTC
This bug has been forgotten for a while, sorry for that.

Since the verbs are reverse-engineered and there is a significant risk of breakage, we shouldn't apply it as default *yet*.  So, instead, the workaround is applied when user explicitly specifies the model=huawei-mbx-stereo option to snd-hda-intel module.

The patch was submitted to upstream and I'm going to merge for 5.4 kernel.
Comment 13 Takashi Iwai 2019-08-09 14:56:45 UTC
Created attachment 284299 [details]
The patch that will be merged for 5.4 kernel

Should be applicable on 5.3 kernel cleanly.