Bug 206085

Summary: Ubuntu Kernel v5.5 for HP-OMEN 17t bc0xxx don't work sound and microphone
Product: Drivers Reporter: sealse (s)
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: NEW ---    
Severity: blocking CC: kai.vehmanen, opava82, tiwai
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: v5.5-rc4,5,6,7 v5.5, v5.5.1, v5.5.2, v5.6.0-rc1, v5.6.0-rc5, v5.7.0-rc1 Subsystem:
Regression: No Bisected commit-id:
Attachments: alsa-info.log
dmseg log
sudo alsa-info --stdout >alsa-info5.5.2.log
sudo dmesg >dmesg5.5.2.log
sudo alsa-info --stdout >alsa-info5.6.0-rc1.log
sudo dmesg >dmesg5.6.0-rc1.log
Test fix patch for 5.6
alsa-info.log
dmseg.log
alsa-info.log
dmseg.log

Description sealse 2020-01-05 16:08:36 UTC
see more from https://bugzilla.kernel.org/show_bug.cgi?id=205851
Comment 1 sealse 2020-01-27 17:58:29 UTC
On rc7 same
On rc1 sound is worked but system not logged
Comment 2 sealse 2020-01-31 09:22:01 UTC
last version 5.5 same problem
Comment 3 Takashi Iwai 2020-01-31 10:15:20 UTC
Too little information: what did you test and what not working?

Also please give alsa-info.sh output at least.  Run the script with --no-upload option and attach the output.
Last but not least, give dmesg output, too.
Comment 4 sealse 2020-02-01 17:51:55 UTC
I am install from this https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.5.1/, today v5.5.1 same problem

sudo alsa-info > alsa-info.log
log in attach but:
Your ALSA information is located at http://alsa-project.org/db/?f=e370494cdf0fc0dc6255b93db0cc2207d403e723

sudo dmesg >dmesg.log in attach
Comment 5 sealse 2020-02-01 17:52:36 UTC
Created attachment 287059 [details]
alsa-info.log
Comment 6 sealse 2020-02-01 17:52:57 UTC
Created attachment 287061 [details]
dmseg log
Comment 7 sealse 2020-02-06 16:58:39 UTC
attached

sudo alsa-info --stdout >alsa-info5.5.2.log
sudo dmesg >dmesg5.5.2.log

Dummy Outout Test not work too
Comment 8 sealse 2020-02-06 16:59:21 UTC
Created attachment 287181 [details]
sudo alsa-info --stdout >alsa-info5.5.2.log

sudo alsa-info --stdout >alsa-info5.5.2.log
Comment 9 sealse 2020-02-06 16:59:46 UTC
Created attachment 287183 [details]
sudo dmesg >dmesg5.5.2.log

sudo dmesg >dmesg5.5.2.log
Comment 10 sealse 2020-02-11 09:56:20 UTC
Created attachment 287301 [details]
sudo alsa-info --stdout >alsa-info5.6.0-rc1.log

sudo alsa-info --stdout >alsa-info5.6.0-rc1.log
Comment 11 sealse 2020-02-11 09:56:57 UTC
Created attachment 287303 [details]
sudo dmesg >dmesg5.6.0-rc1.log

sudo dmesg >dmesg5.6.0-rc1.log
Comment 12 Takashi Iwai 2020-02-14 14:58:39 UTC
Could you give the patch below?
Comment 13 Takashi Iwai 2020-02-14 14:58:56 UTC
I meant try the patch below :)
Comment 14 Takashi Iwai 2020-02-14 14:59:39 UTC
Created attachment 287383 [details]
Test fix patch for 5.6
Comment 15 Takashi Iwai 2020-02-14 15:01:06 UTC
Note that you'll still need more user-space stuff to make the whole SOF working, including the SOF firmware.  Possibly the latest PulseAudio git version, alsa-lib, and alsa-ucm-conf would be needed as well.
Comment 16 Kai Vehmanen 2020-02-17 09:48:47 UTC
Work to fix this case in SOF is under work in:
https://github.com/thesofproject/linux/issues/1658
https://github.com/thesofproject/linux/pull/1731
Comment 17 sealse 2020-02-18 15:34:27 UTC
I apologize
If I put the version from here https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.6-rc2/
how to apply the patch correctly, can you give link to instructions?
Or can I wait for patch 5.6.0-rc3?
Comment 18 Kai Vehmanen 2020-02-20 17:37:27 UTC
sealse wrote:
> how to apply the patch correctly, can you give link to instructions?
> Or can I wait for patch 5.6.0-rc3?

If you are not familiar with applying kernel patches yourself, maybe better wait until the patch is merged to some upstream tree. I've now sent the patches to alsa-devel for review:
https://mailman.alsa-project.org/pipermail/alsa-devel/2020-February/163603.html

Depending on how the reviews go, the patch might make it to the 5.6-rc series, but we'll see.
Comment 19 sealse 2020-02-28 10:23:43 UTC
Thanks  Kai!
Tell me please - Where can I see if this patch is in the new version of kernel
Comment 20 Kai Vehmanen 2020-02-28 12:14:30 UTC
@sealse: The patch was now merged to Mark Brown's ASoC tree and is making its way up. To try it, you can fetch latest "for-next" branch of Mark's tree:

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/?h=for-next
Comment 21 Kai Vehmanen 2020-03-05 13:19:20 UTC
FYI: A UCM fix is also needed to fully enable Pulseaudio on these systems. Solution submitted to ALSA UCM upstream:
https://github.com/alsa-project/alsa-ucm-conf/pull/15
Comment 22 sealse 2020-03-09 08:59:24 UTC
Hi, I installed the version 5.6.0-rc5 but the problem is still there, I don’t quite understand how to track if there are any changes in the build, but the problem is still present
Comment 23 Kai Vehmanen 2020-03-09 10:27:36 UTC
@sealse: This fix is not in 5.6.0-rc5 and as it's not a simple bugfix but enabling audio for a new category od devices, it is likely it is not going to be in 5.6.0 at at all -- i.e. 5.7.0 will be first official kernel with the fix. Distributions might backport the fix to older kernels, but this is not guaranteed.

You can partially enable audio with following module option (put this e.g. to /etc/modprobe.d/select-audio.conf):

#Force the DSP driver for Intel DSP (0=auto, 1=legacy, 2=SST, 3=SOF
options snd\_intel\_dspcfg dsp\_driver=1

... that should work with 5.6.0-rc5. Digital Mic will not work, but rest of audio should be ok. You need to remember to remove that when you upgrade to 5.7.0 (or backport the patch).
Comment 24 sealse 2020-04-16 11:04:50 UTC
5.7.0-rc1 same problem
Comment 25 Kai Vehmanen 2020-04-16 14:05:09 UTC
@sealse: 5.7.0-rc1 has the kernel patches now. So if it still fails, it's worth taking fresh set of logs. One known is issue is that latest alsa-ucm release (1.2.2) is still missing one patch that is needed on these machines, so Pulseaudio still gets confused. But the ALSA drivers should be good now.

Can you maybe post alsa-info output with 5.7.0-rc1?
Comment 26 sealse 2020-04-16 19:34:09 UTC
Created attachment 288529 [details]
alsa-info.log
Comment 27 sealse 2020-04-16 19:34:33 UTC
Created attachment 288531 [details]
dmseg.log
Comment 28 sealse 2020-04-17 20:52:38 UTC
Hi! I also complained that Nvidia did not malfunction and as a result they claim that Alsa drivers are to blame https://forums.developer.nvidia.com/t/ubuntu-kernel-v5-6-v5-7-for-hp-omen-17t-bc000-gforce-rtx2080-unstable-driver-nvidia-linux-x86-64-440-82-run/120027/8
Comment 29 sealse 2020-04-17 21:00:30 UTC
Sorry, the previous post wasn’t really, I read it wrong
Comment 30 Kai Vehmanen 2020-04-20 07:55:13 UTC
@sealse: Thanks for the logs! Now failure to init HDMI audio in i915 is properly ignored, as shown by this dmesg:
[    4.038182] sof-audio-pci 0000:00:1f.3: init of i915 and HDMI codec failed

But audio driver load fails due to missing firmware now:
[    4.057638] sof-audio-pci 0000:00:1f.3: Direct firmware load for intel/sof/sof-cfl.ri failed with error -2
[    4.057640] sof-audio-pci 0000:00:1f.3: error: request firmware intel/sof/sof-cfl.ri failed err: -2

Please install the 1.4.2 SOF firmware
https://github.com/thesofproject/sof/releases/tag/v1.4.2
Comment 31 sealse 2020-04-21 16:52:29 UTC
There are 4 processor options in the installation readme
Baytrail / Cherrytrail:
Haswell / Broadwell:
Apollolake:
Cannonlake:
But as I see it, I have Coffee Lake https://ark.intel.com/content/www/en/ru/ark/products/192987/intel-core-i9-9880h-processor-16m-cache-up-to- 4-80-ghz.html
What should I try to set?
Comment 32 sealse 2020-04-24 18:33:44 UTC
Hi! I installed release ubuntu 20.04 kernel 5.4.0-26-generic
Ahd i have same problem
I can't install firmware becouse I have next message

cmake -DTOOLCHAIN=xtensa-hsw-elf -DROOT_DIR=`pwd`/../../xtensa-root/xtensa-hsw-elf ..
-- Preparing Xtensa toolchain
-- The C compiler identification is unknown
-- The ASM compiler identification is GNU
-- Didn't find assembler
CMake Error at CMakeLists.txt:39 (project):
  The CMAKE_C_COMPILER:

    xtensa-hsw-elf-gcc

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:39 (project):
  No CMAKE_ASM_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "ASM" or the CMake cache entry CMAKE_ASM_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also "/home/sealse/Downloads/sof-1.4.3/build/CMakeFiles/CMakeOutput.log".
See also "/home/sealse/Downloads/sof-1.4.3/build/CMakeFiles/CMakeError.log".
Comment 33 Jaroslav Kysela 2020-04-24 18:37:50 UTC
Install the firmware binaries as Kai pointed in comment#30 .
Comment 34 sealse 2020-04-24 19:20:14 UTC
I didn’t find the binary file from the link https://github.com/thesofproject/sof/releases/tag/v1.4.2
Comment 35 Jaroslav Kysela 2020-04-24 19:26:13 UTC
Scroll down to assets or install binaries from the sof-bin repo: https://github.com/thesofproject/sof-bin/tree/stable-v1.4.2
Comment 36 sealse 2020-04-24 22:44:54 UTC
I installed sof-bin

>sudo ./go.sh 
>Installing Intel firmware and topology v1.4.2 to lib/firmware/intel
>Done installing Intel firmware and topology v1.4.2

I installed kernel 5.7.0-rc2 and again installed sod-bin
I rebooted but sound not working


Also I got next messade after command:
>sudo alsa-info --stdout >alsa-info5.7.0-rc2.log
>[sudo] password for sealse: 
>lspci: Unable to load libkmod resources: error -12
>lspci: Unable to load libkmod resources: error -12
>cat: '/sys/module/snd_soc_skl_hda_dsp/parameters/*': No such file or directory
Comment 37 sealse 2020-04-24 22:45:32 UTC
Created attachment 288713 [details]
alsa-info.log
Comment 38 sealse 2020-04-24 22:45:58 UTC
Created attachment 288715 [details]
dmseg.log
Comment 39 Kai Vehmanen 2020-04-27 11:19:23 UTC
@sealse Thanks! The alsa-info output now looks good and sound should work at kernel level if you try to play and record sounds with ALSA aplay and arecord tools.

Based on the logs, pulseaudio does not seem to work and you are most probably hitting the issue I mentioned in comment #21 of this bug https://bugzilla.kernel.org/show_bug.cgi?id=206085#c21

In short the UCM file is missing rules to handle the missing HDMI/DP nodes for Intel ALSA cards when the HDMI/DP is connected to the NVidia card. The patch is in git master, but not yet in the released alsa-ucm-conf-1.2.2

A bit longer explanation at:
https://github.com/thesofproject/linux/issues/1985#issuecomment-615226041
Comment 40 sealse 2020-04-27 15:03:30 UTC
I read the topic you proposed
But do not quite understand
Can I now compromise the kernel with the patch you have proposed? Or do I have to wait for the release of a new kernel version?
In which release is the patch planned to appear
Comment 41 Kai Vehmanen 2020-04-28 12:45:41 UTC
(In reply to sealse from comment #40)
> Can I now compromise the kernel with the patch you have proposed? Or do I
> have to wait for the release of a new kernel version?
> In which release is the patch planned to appear

Kernel is now fine. 

The missing piece is update to user-space ALSA packages -> 1.2.2 doesn't have the fix, so whatever the next release is (1.2.3?) will have it. Jaroslav manages the ALSA releases, so he is best to comment on this.
Comment 42 sealse 2020-04-28 22:17:00 UTC
@Jaroslav сan you help me install a beta version to fix this problem?
Comment 43 dzikages555 2020-05-03 12:57:44 UTC
@sealse Here I've described a solution that worked for me
https://github.com/thesofproject/linux/issues/2065
Comment 44 sealse 2020-05-04 10:55:41 UTC
@dzikages555  Thank's!!!
All I missed is:
wget https://raw.githubusercontent.com/alsa-project/alsa-ucm-conf/master/ucm2/sof-hda-dsp/Hdmi.conf
and
mv Hdmi.conf /usr/share/alsa/ucm2/sof-hda-dsp/Hdmi.conf
Comment 45 Kai Vehmanen 2020-05-04 14:41:55 UTC
Excellent @sealse and @dzikages555! 

So Jaroslav, I think we can close this bug now -- definitely the kernel is ok now.