chrultrabook / docs

Centralized project documentation for chrultrabook
https://docs.chrultrabook.com/
Creative Commons Zero v1.0 Universal
66 stars 29 forks source link

Missing information about exact kernel patches for Stoneyridge devices. #88

Open GamePlayer-8 opened 11 months ago

GamePlayer-8 commented 11 months ago

Good evening,

I've got a problem with getting an exact information about what patches should be applied on the Linux kernel 6.1+ for Stoneyridge Chromebook devices.

The documentation of Known issues in the Stoneyridge devices section says:

Needs kernel compiled with AMDGPU=Y instead of =M and firmware built-in to get working audio

eMMC is only detected on a cold boot unless you have a patched kernel

although not linking any source to the patches for the Linux kernel as mentioned.

What patches should I use?


Additionally while reading dmesg for anything related to the problem of eMMC I've got:

[    0.000000] efi: EFI v2.7 by EDK II
[    0.000000] efi: SMBIOS=0xbf41a000 SMBIOS 3.0=0xbf418000 ACPI=0xbf533000 ACPI 2.0=0xbf533014 MEMATTR=0xbbf16c18 
[    0.000000] efi: Remove mem97: MMIO range=[0xffbc0000-0xffbfffff] (0MB) from e820 map
WeirdTreeThing commented 11 months ago

I can add detailed info about stoney. The emmc issue is due to an update in the driver, which we have a patch for.

GamePlayer-8 commented 11 months ago

Thank you. By the way, is there a gist / repo of the patch already? I'm configuring the PKGBUILD for the kernel right now.

WeirdTreeThing commented 11 months ago

We have a repo but it's outdated. The person that is working on updating it will push the changes and make a pr sometime soon.

GamePlayer-8 commented 11 months ago

link?

WeirdTreeThing commented 11 months ago

https://github.com/chrultrabook/linux-build-scripts

GamePlayer-8 commented 11 months ago

@WeirdTreeThing I've patched the kernel for my system (source code).

Although CONFIG_DRM_AMDGPU=y causes the kernel to freeze the screen, on the Stoneyridge device. The rest of the system components (NetworkManager, sddm) is being loaded like nothing happened.

GamePlayer-8 commented 11 months ago

diff of the original kernel configuration vs modified by the distro:

--- ../config   2023-10-18 08:09:34.572437859 +0000
+++ .config 2023-10-18 08:11:56.161685713 +0000
@@ -590,7 +590,7 @@
 CONFIG_ACPI_AC=y
 CONFIG_ACPI_BATTERY=y
 CONFIG_ACPI_BUTTON=y
-CONFIG_ACPI_VIDEO=m
+CONFIG_ACPI_VIDEO=y
 CONFIG_ACPI_FAN=y
 CONFIG_ACPI_TAD=m
 CONFIG_ACPI_DOCK=y
@@ -4673,7 +4673,7 @@

 CONFIG_I2C_HELPER_AUTO=y
 CONFIG_I2C_SMBUS=m
-CONFIG_I2C_ALGOBIT=m
+CONFIG_I2C_ALGOBIT=y
 CONFIG_I2C_ALGOPCA=m

 #
@@ -5840,7 +5840,7 @@
 CONFIG_RC_ATI_REMOTE=m
 CONFIG_RC_LOOPBACK=m
 CONFIG_RC_XBOX_DVD=m
-CONFIG_CEC_CORE=m
+CONFIG_CEC_CORE=y
 CONFIG_CEC_NOTIFIER=y
 CONFIG_CEC_PIN=y

@@ -6679,20 +6679,20 @@
 CONFIG_DRM_FBDEV_EMULATION=y
 CONFIG_DRM_FBDEV_OVERALLOC=100
 CONFIG_DRM_LOAD_EDID_FIRMWARE=y
-CONFIG_DRM_DISPLAY_HELPER=m
+CONFIG_DRM_DISPLAY_HELPER=y
 CONFIG_DRM_DISPLAY_DP_HELPER=y
 CONFIG_DRM_DISPLAY_HDCP_HELPER=y
 CONFIG_DRM_DISPLAY_HDMI_HELPER=y
 CONFIG_DRM_DP_AUX_CHARDEV=y
 CONFIG_DRM_DP_CEC=y
-CONFIG_DRM_TTM=m
-CONFIG_DRM_BUDDY=m
+CONFIG_DRM_TTM=y
+CONFIG_DRM_BUDDY=y
 CONFIG_DRM_VRAM_HELPER=m
-CONFIG_DRM_TTM_HELPER=m
+CONFIG_DRM_TTM_HELPER=y
 CONFIG_DRM_GEM_DMA_HELPER=m
 CONFIG_DRM_GEM_SHMEM_HELPER=y
-CONFIG_DRM_SUBALLOC_HELPER=m
-CONFIG_DRM_SCHED=m
+CONFIG_DRM_SUBALLOC_HELPER=y
+CONFIG_DRM_SCHED=y

 #
 # I2C encoder or helper chips
@@ -6710,7 +6710,7 @@

 CONFIG_DRM_RADEON=m
 CONFIG_DRM_RADEON_USERPTR=y
-CONFIG_DRM_AMDGPU=m
+CONFIG_DRM_AMDGPU=y
 CONFIG_DRM_AMDGPU_SI=y
 CONFIG_DRM_AMDGPU_CIK=y
 CONFIG_DRM_AMDGPU_USERPTR=y
@@ -8999,7 +8999,7 @@
 CONFIG_SURFACE_AGGREGATOR_BUS=y
 # CONFIG_SURFACE_AGGREGATOR_ERROR_INJECTION is not set
 CONFIG_X86_PLATFORM_DEVICES=y
-CONFIG_ACPI_WMI=m
+CONFIG_ACPI_WMI=y
 CONFIG_WMI_BMOF=m
 CONFIG_HUAWEI_WMI=m
 CONFIG_MXM_WMI=m

(I've modified only CONFIG_DRM_AMDGPU).

WeirdTreeThing commented 11 months ago

You also need to build the AMDGPU firmware into the kernel.

GamePlayer-8 commented 11 months ago

After a lot of troubleshooting, I have embeded the /lib/firmware/amdgpu/stoney* firmware into my kernel.

Although even if speakers / jack output is being recognized, there's no sound being played. A microphone is being shown, but there's a loud noise.

Camera isn't being recognized too. What might be the issue?

GamePlayer-8 commented 11 months ago

Additional dmesg logs containing errors:

[   22.350783] acp3x-alc5682-max98357 AMDI5682:00: DMIC gpio failed err=-2
[   22.350826] acp3x-alc5682-max98357: probe of AMDI5682:00 failed with error -2
[  100.740655] Failed to stop ACP DMA channel : 13
[  101.761572] Failed to stop ACP DMA channel : 9
[  142.557143] Failed to stop ACP DMA channel : 13
[  143.578814] Failed to stop ACP DMA channel : 9
[  144.610460] Failed to stop ACP DMA channel : 10
[  144.610460] acp_audio_dma acp_audio_dma.0.auto: ASoC: error at soc_component_trigger on acp_audio_dma.0.auto: -110
GamePlayer-8 commented 10 months ago

aplay error when trying to play sound to the soundcard provided by stoney* firmware:

aplay: pcm_write:2146: write error: Input/output error
WeirdTreeThing commented 10 months ago

6.5 is known to have issues, I just kinda reverted a few things until it worked.

GamePlayer-8 commented 10 months ago

Should I recompile under 6.1 kernel?

WeirdTreeThing commented 10 months ago

Try that, afaik it should work until we figure out what broke 6.5.

GamePlayer-8 commented 10 months ago

Your emmc.patch file works only under 6.4+ kernel versions. I'll try to compile under 6.4.16.

GamePlayer-8 commented 10 months ago

Under 6.4.16 audio output works. Still Camera is unrecognized by the kernel and built-in microphone isn't working.

WeirdTreeThing commented 10 months ago

The camera is just usb so it's likely to be a hardware issue.

GamePlayer-8 commented 10 months ago

What to do about microphone?

dmesg reports:

[ 4754.381512] acp3x-alc5682-max98357 AMDI5682:00: DMIC gpio failed err=-2
[ 4754.382134] acp3x-alc5682-max98357: probe of AMDI5682:00 failed with error -2
GamePlayer-8 commented 10 months ago

Problem with the webcam was reported before to the MrChromebox, but the issue got refused.

WeirdTreeThing commented 10 months ago

That is not a real issue, that's a separate driver that loads automatically even though it isn't used on this platform.

GamePlayer-8 commented 10 months ago

How to deal with it?

WeirdTreeThing commented 10 months ago

Ignore it or blacklist the module.

GamePlayer-8 commented 10 months ago

Which one should I blacklist exactly?

WeirdTreeThing commented 10 months ago

I don't remember off the top of my head, look for acp3x in lsmod.

WeirdTreeThing commented 10 months ago

MrChromebox 4.21.1 firmware has released today, which fixes emmc on warm reboots on the firmware side. The kernel patch is no longer needed.

GamePlayer-8 commented 10 months ago

I don't remember off the top of my head, look for acp3x in lsmod.

lsmod doesn't show any type of acp3x module loaded. The nearest one might be snd_soc_acp_rt5682_mach what's being used for the audio ports / speakers.

WeirdTreeThing commented 10 months ago

I just checked on my careena and yeah that's the one you need to blacklist.

GamePlayer-8 commented 10 months ago

I've blacklisted and still no change in the Webcam detection.

modprobe loaded snd_soc_acp_da7219mx98357_mach - even after blacklisting this one too, there's no audio device detected.

WeirdTreeThing commented 10 months ago

snd_soc_acp_da7219mx98357_mach is the one that's supposed to load. Blacklisting snd_soc_acp_rt5682_mach on my careena didn't break audio.

GamePlayer-8 commented 10 months ago

Yeah, I meant, on both modules camera doesn't work

WeirdTreeThing commented 10 months ago

Camera is not part of audio. Check for your camera in lsusb.

GamePlayer-8 commented 10 months ago

lsusb:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0438:7900 Advanced Micro Devices, Inc. Root Hub
Bus 001 Device 003: ID 0cf3:e300 Qualcomm Atheros Communications QCA61x4 Bluetooth 4.0
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 046d:c542 Logitech, Inc. M185 compact wireless mouse
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hu

lspci:

00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Processor Root Complex
00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Stoney [Radeon R2/R3/R4/R5 Graphics] (rev eb)
00:01.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Device 15b3
00:02.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Host Bridge
00:02.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Processor Root Port
00:02.4 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Processor Root Port
00:03.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 60h-6fh) Host Bridge
00:08.0 Encryption controller: Advanced Micro Devices, Inc. [AMD] Carrizo Platform Security Processor
00:09.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Carrizo Audio Dummy Host Bridge
00:10.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB XHCI Controller (rev 20)
00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 49)
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 4b)
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 11)
00:14.7 SD Host controller: Advanced Micro Devices, Inc. [AMD] FCH SD Flash Controller (rev 01)
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Stoney HT Configuration
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Stoney Address Maps
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Stoney DRAM Configuration
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Stoney Miscellaneous Configuration
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Stoney PM Configuration
00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Stoney NB Performance Monitor
01:00.0 Network controller: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter (rev 32)
02:00.0 SD Host controller: O2 Micro, Inc. Device 8620 (rev 01)
WeirdTreeThing commented 10 months ago

The usb device for your camera is missing. Either something in coreboot is broken or the physical cable is damaged. You can rule out coreboot by testing stock. I can say that on my careena, the camera cable was damaged and only worked at certain angles.

GamePlayer-8 commented 10 months ago

Nothing bad happened to my camera when I was using ChromeOS so probably a firmware issue. Will try to compile the original kernel and see the difference.

WeirdTreeThing commented 10 months ago

The kernel isn't gonna prevent usb devices from being detected. You will need to flash stock and verify the camera works there.

GamePlayer-8 commented 9 months ago

Works on stock firmware, but only under ChromeOS.

WeirdTreeThing commented 9 months ago

but only under ChromeOS

As in you tried to boot a mainline distro on stock firmware?

GamePlayer-8 commented 9 months ago

yes

WeirdTreeThing commented 9 months ago

I've never seen anything like this.

ellyq commented 9 months ago

snd_soc_acp_da7219mx98357_mach

This is the correct module for Stoney.

What to do about microphone?

dmesg reports:

[ 4754.381512] acp3x-alc5682-max98357 AMDI5682:00: DMIC gpio failed err=-2
[ 4754.382134] acp3x-alc5682-max98357: probe of AMDI5682:00 failed with error -2

ACP3x == Picasso (Ryzen 3000).

GamePlayer-8 commented 8 months ago

ACP3x == Picasso (Ryzen 3000).

What should I do about it?