Open leezu opened 2 years ago
@leezu Thanks for this systemctl disable --now iio-sensor-proxy
. I had also read some documentation on flipping the orientation of the sensor in user land so no changes need be made to kernel. I'll have to dig it up again because I had more pressing issues but it's a thought. Speaker audio is broken for you too? I'll have to see that kernel now... Still haven't figured if it's user side or kernel.
i really like the idea to have such an issue per system to discuss its current state and problems - i have just renamed the title a bit so that we have an easy to find subject directly related to the system name in the framework - i hope this is ok?
@hexdump0815 Works for me. We can make lightning ⚡ progress if we keep this up. I still plan to update the doc and scripts. Collecting all this info and coming up with potential fixes. 😊 I still haven't attempted a full build again to spit out images. Will get there.
@leezu - i have added a link to your notes to the trogdor page: https://github.com/hexdump0815/imagebuilder/commit/31462ce63bb0dca63d59e94817953360b58d926e
@Geofferey - there is no hurry with anything here, just take the time you need for everything you want to do - i think its better to go slow and continue moving than to go fast an running out of breath too quickly :) ... first step is to identify potential problems, second is finding solutions for them if possible, third to think about including them into the corresponding images and as a long term topic there is trying to improve the quality of the documentation ...
@hexdump0815 I told you I got A LOT of time on my hands! 🤣 But this is for a limited time only. I'm almost done here though and then I can start thinking about the doc 😜 My goal is always to document and fix issues first. I think I've nearly checked them all now except cameras.
@Geofferey - cameras should either be usb video class devices and already be probed as such in dmesg or they are just some plain cameras (often OVxyz and not probed as they are usually connected in complex ways - the dtb might help to find out how) for which is done a lot of dsp stuff in closed source blobs most probably and in that case it would be very hard to impossible get them working (same applies to kukui krane = lenovo duet 10.1 - kukui kappa = hp cb 11a and kukui juniper = acer cb311-3h both have usb video class devices and those are working well)
@hexdump0815 @Geofferey I took a closer look at the suspend issues on this system.
With 5.15.2-stb-cbq from https://github.com/hexdump0815/imagebuilder/releases/tag/211120-02 (boot from usb), issuing systemctl suspend
brings the system into PM: suspend entry (deep)
, but the system wakes up again shortly (~1 second) thereafter. Looking at the embedded controller (EC) logs, it's clear that the EC detects an issue and wakes the system back up:
[33479.596920 Handle sleep: 1]
[33489.598512 Warning: Detected sleep hang! Waking host up!]
[33489.599167 event set 0x0000000000080000]
[33490.599948 MKBP not cleared within threshold, toggling.]
[33490.671534 Handle sleep: 2]
[33490.678368 Lid Accel ODR: 10000 - roundup 1 from config 1 [AP 0]]
[33490.682236 PD:S3->S0]
[33490.695668 Base Accel ODR: 10000 - roundup 1 from config 1 [AP 0]]
[33490.711119 Gyro ODR: 0 - roundup 0 from config 0 [AP 0]]
With kernel 5.18 (boot from encrypted emmc), the EC also detects an issue and attempts to wake the system back up, but the system fails to come back up. Pressing power-button will not help (besides long-press, to completely reset the system):
[31045.942099 Unhandled VB reg 11]
[31351.502099 Handle sleep: 1]
[31351.532439 power state 3 = S0, in 0x001e]
RTC: 0x627d214a (1652367690.00 s)
[31351.533411 power state 7 = S0->S3, in 0x001e]
[31351.535166 Lid Accel ODR: 10000 - roundup 1 from config 2 [AP 0]]
[31351.539477 PD:S0->S3]
RTC: 0x627d214a (1652367690.00 s)
[31351.541955 power state 2 = S3, in 0x001e]
[31351.542533 Base Accel ODR: 10000 - roundup 1 from config 2 [AP 0]]
[31351.554454 Gyro ODR: 0 - roundup 0 from config 0 [AP 0]]
[31368.259650 power state 2 = S3, in 0x000e]
RTC: 0x627d215b (1652367707.00 s)
[31368.260616 power state 6 = S3->S0, in 0x000e]
RTC: 0x627d215b (1652367707.00 s)
[31368.266388 power state 3 = S0, in 0x000e]
[31369.259629 MKBP not cleared within threshold, toggling.]
[31370.261480 MKBP not cleared within threshold, toggling.]
[31378.264244 Warning: Detected sleep hang! Waking host up!]
Do you have any ideas about what is going wrong?
Suspending the system to s2idle works fine
sudo bash -c "echo s2idle > /sys/power/mem_sleep"
systemctl suspend
and results in the following EC log (including the wakeup from the suspend):
[39358.118183 Handle sleep: 1]
[39358.128388 power state 3 = S0, in 0x001e]
RTC: 0x627d407d (1652375677.00 s)
[39358.129545 power state 7 = S0->S3, in 0x001e]
[39358.131874 Lid Accel ODR: 10000 - roundup 1 from config 2 [AP 0]]
[39358.135142 PD:S0->S3]
RTC: 0x627d407d (1652375677.00 s)
[39358.137637 power state 2 = S3, in 0x001e]
[39358.138215 Base Accel ODR: 10000 - roundup 1 from config 2 [AP 0]]
[39358.147325 Gyro ODR: 0 - roundup 0 from config 0 [AP 0]]
[39368.248327 power state 2 = S3, in 0x000e]
RTC: 0x627d4087 (1652375687.00 s)
[39368.249292 power state 6 = S3->S0, in 0x000e]
BAD-in_msg=[00 00 00 ]
RTC: 0x627d4087 (1652375687.00 s)
[39368.258853 power state 3 = S0, in 0x000e]
[39368.455998 Unexpected state 1 in CSNRE ISR]
[39368.657626 Unexpected state 1 in CSNRE ISR]
[39368.859176 Unexpected state 1 in CSNRE ISR]
[39369.060754 Unexpected state 1 in CSNRE ISR]
[39369.248291 MKBP not cleared within threshold, toggling.]
[39369.262400 Unexpected state 1 in CSNRE ISR]
[39369.464002 Unexpected state 1 in CSNRE ISR]
[39369.665567 Unexpected state 1 in CSNRE ISR]
[39369.867231 Unexpected state 1 in CSNRE ISR]
[39370.068789 Unexpected state 1 in CSNRE ISR]
[39370.249213 MKBP not cleared within threshold, toggling.]
[39370.270344 Unexpected state 1 in CSNRE ISR]
[39370.472052 Unexpected state 1 in CSNRE ISR]
[39370.673622 Unexpected state 1 in CSNRE ISR]
[39370.875105 Unexpected state 1 in CSNRE ISR]
[39371.076685 Unexpected state 1 in CSNRE ISR]
[39371.278388 Unexpected state 1 in CSNRE ISR]
[39371.489547 Unexpected state 1 in CSNRE ISR]
Though for some reason I'm unable to set the default suspend type to s2idle as the kernel command line parameter is ignored..
% cat /proc/cmdline
cros_secure root=LABEL=rootemmc loadpin.enforce=0 mem_sleep_default=s2idle
% cat /sys/power/mem_sleep
s2idle [deep]
A workaround is to use systemd tmpfiles
% cat /etc/tmpfiles.d/mem_sleep.conf
# Path Mode UID GID Age Argument
w /sys/power/mem_sleep - - - - s2idle
@leezu - in theory it should be possible to get some deeper sleep working - at least if running from emmc - see: https://oftc.irclog.whitequark.org/aarch64-laptops/2022-03-25#30771427
[12:40] <macc24> :O !!! i think suspending to what ec calls "S3" finally works on lazor
[16:54] <steev> nice!
[18:31] <hexdump0815> macc24: oh - that sounds good - anything special required or just by using a newer kernel?
[18:32] <macc24> hexdump0815: it just worked on 5.17
lets see if we can find out more details on irc ...
Hi, i have just installed trogdor lazor with 6.1.1-stb-cbq kernel. It seems that sleep is working, most features i have tested are working. Sound, wifi, usb-c displayport, emmc install. Very usable system state.
Do you have any pointers on how to make usb-c displayport audio work ? I tried most alsa sinks, none of them output sound to hdmi/dp
@robots - i'm happy to hear this and that everything works so well ... i have no real idea regarding what is needed to get displayport audio to work as i do not even have a hdmi display with audio myself. it might be worth a try to ask at the aarch64-laptops irc channel maybe (https://oftc.irclog.whitequark.org/aarch64-laptops/) - maybe someone around there has an idea
best wishes - hexdump
I have been playing with the ucm2 file, uncommenting HDMI section will break pulseaudio, but with plugged in usb-c to hdmi and valid display connection pulseaudio will load correctly, audio plays correctly to TV! Problem is that pulseaudio will not load, when cable is not plugged in, it will just not see "hw:sc7180rt5682max,2" device. I wonder if its possible to tell pulseaudio to ignore this device for a while and rescan it when ready. However unplugging hdmi cable will not break running pulseaudio. Might need more googling :-) This ucm2+alsa+pulseaudio concept is very new for me.
i think ucm is not easy to really understand and to deal with in my experience - it takes quite a bit of time to get forward there step by step ... please keep me up to date here in case you find anything out about this ... good luck :)
ps: it will most probably not help much here, but i just want to make you aware of this - https://github.com/hexdump0815/imagebuilder/blob/main/doc/alsa-ucm-pulseaudio-hacking.txt
Soo, very close to solution:
Create file /usr/share/alsa/ucm2/SC7180/HDMI.conf
SectionVerb {
EnableSequence [
]
DisableSequence [
]
Value {
TQ "HiFi"
}
}
SectionDevice."HDMI" {
Comment "HDMI Output"
EnableSequence [
]
DisableSequence [
]
Value {
PlaybackPriority 200
PlaybackPCM "hw:sc7180rt5682max,2"
JackControl "HDMI Jack"
}
}
Edit sc7180-rt5682-max98357a-1mic.conf in the same folder add SectionUseCase.HDMI:
# bla bla original content
# add:
SectionUseCase."HDMI" {
File "HDMI.conf"
Comment "HDMI output"
}
Now, HDMI output works, if you restart pulseaudio with hdmi cable plugged in. In the mixer you can select output to default, or output to "HDMI output". Even unplugging works. Audio will switch to internal speakers. Plugging the hdmi cable back in will also work, and switch audio back. The output can be switched by switching profile in pavucontrol (last tab)
What does not work: If pulseaudio is started and hdmi cable is not connected, pulseaudio will try to open the hw:sc7180xxxxx,2 device, and it does not succeed, and will ignore the card forever (untill pulseaudio restart) but at least the internal sound keeps working.
I have also noticed that official alsa-ucm-conf repo contains trogdor/lazor config files that should work with headphones:
https://github.com/alsa-project/alsa-ucm-conf/tree/master/ucm2/Qualcomm/sc7180/rt5682-max98357a
I have no yet tested those. HDMI audio is now priority for me.
JackControl tells pulseaudio to monitor kcontrol signals. JackDev should monitor events, but those are not available in user space without root. So JackControl is better way. To know what should be written there just check:
amixer -c 0 contents
"HDMI Jack" goes to on when connected, off when disconnected. Same for "Headset Jack" on when connected, off disconnected.
sleeping works, resume works also. Not sure how well. I have not noticed anything wrong yet
I had an issue with the CPU governor not dropping down frequencies on idle but i managed to get it to work. Still power draw seems to be much higher than chromeOS
@sowa705 - i think chromeos does some extra tricks to get the power consumption down, but i think even with mainline linux it is very useable (i.e. many hours battery life in use and it should surive a night or a few days even in sleep mode i think)
i so far did not notice that cpu governor issue - what did you do to fix it? maybe switching to schedutil might be better anyway: https://github.com/hexdump0815/imagebuilder/blob/main/files/extra-files/etc/rc.local#L92-L100 - are you running my latest v6.1.1 kernel already?
Hi, i switched the governor to ondemand (it was set to performance keeping clocks at max) I'm using the prebuilt image with ubuntu. imo good battery life is the biggest advantage of this laptop and going from 10 hours to 5 makes it pointless.
Ill be looking into minimizing power draw (hw video accel will probably help a lot)
Prebuilt images are quite old tho. Ill try building newer ones
@sowa705 - now that v6.1 is set as lts kernel i'll most probably start building a new round of images based on v6.1, but it will take a bit of time until i'm done with all of the ones i would like to build ... in case you try to build your own, i just recently tried to write down at least some basic info about how to do it here: https://github.com/hexdump0815/imagebuilder/blob/main/doc/using-the-imagebuilder-framework.md
Hi, sorry for derailing the thread but are there any additional steps to make the image bootable? I've built the latest kernel with the guide and jammy image but i cant get it to boot :( Only thing im getting is just that my image is invalid
@sowa705 - the image resulting from the build should be bootable, but i think i forgot one step in the build info: the bootable kpart kernel image has to be extracted from the kernel.tar.gz for chromebooks using the native kpart chromebook bootloader i.e. this here: https://github.com/hexdump0815/imagebuilder/blob/main/systems/chromebook_trogdor/get-files.sh#L9 ... just doing that step in the imagebuilder-download folder and running the create-image.sh step again should result in a bootable image ... i*ll have to add this to the doc ... if that still does not work, lets open a new issue to try to debug what the problem then is ... btw. aside from that: depending on the usb device used pressing ctrl-u immediately after power-on might be too fast sometimes, it looks like usb needs a moment to initialize first sometimes
best wishes and good luck - hexdump
@sowa705 - short version: just dd the extracted vmlinux.kpart to the first partition of your sd card after writing your image to it in case you do not want to rebuild it completely ...
btw. i built a fresh kernel yesterday as well: https://github.com/hexdump0815/linux-mainline-and-mali-generic-stable-kernel/releases/tag/6.1.11-stb-cbq ... new image should come within the next days
Huge thanks, ill try running my own kernel (6.2 so it may not work) and if it fails ill use your prebuilt one
@sowa705 - just fyi: new image with v6.1.11 kernel - https://github.com/hexdump0815/imagebuilder/releases/tag/230218-03 ... i did not have the time yet to test it myself, but it should work
I've got an Acer Chromebook Spin 513 Lazor / Trogdor device and I'd like to try to install one of your images on it. So if I understood the process correctly, for that I'll have to:
gunzip chromebook_trogdor-aarch64-jammy.img.gz
dd if=chromebook_trogdor-aarch64-jammy.img of=/dev/sda status=progress
(where sda is a 4GB usb-stick)dd if=~/chromebook-linux.img of=/dev/mmcblk1
Is that about it or did I miss anything?
@thomas725 - it should work as you wrote .. two notes maybe: the jammy image has not yet been tested, but it should work (just if it does not, then maybe give the bookworm one a try) - and the other note: maybe test it a bit first running from usb before installing it to emmc - for that i have tried to put together some notes at https://github.com/hexdump0815/imagebuilder/blob/main/doc/install-to-emmc-on-arm-chromebooks.md ... for getting started please also read: https://github.com/hexdump0815/imagebuilder/blob/main/doc/first-steps.md and https://github.com/hexdump0815/imagebuilder/blob/main/doc/important-information.md (which should not apply to the jammy image, but to the bookworm image) ... btw. there is no special bootloader required as the chromebook bootloader is used which lives in some special flash memory so does even continue to work when you wipe the emmc ...
good luck and best wishes - hexdump
Thank you for your detailed response @hexdump0815 ! I've tried the jammy image, and will try the bookworm next.
Things I didn't like about jammy:
I wonder if maybe a wayland based desktop manager would have better touchscreen support?
@thomas725 - the way ubuntu goes is also the reason why i have switched completely to debian meanwhile ... for display scaling maybe have a look at the files in /etc/lightdm, there is a little hack using scaling via xrandr ... all the little fine details have to be configured individually as it is too dependend on all the different systems and would be too much work to handle it properly across all image - the idea of the images is to give a good starting point to adjust the system as one likes it then - before it was hours of work of finding out of how to boot it, which kernel patches are required, which kernel config works etc. and now one can start with a working system at least within a few minutes :) ... in case you find out any improvements, feedback here is very welcome as of course i'm open for improving the images over time as long as the changes are doable and do not break the images for other systems
best wishes and good luck - hexdump
Tested on my machine:
Hardware decoding works well but no hardware encoding support.
power
To save power, we can install tlp. It seems to extend the working hours. (from 7 - 8 hours to 9 hours+ in my case)
When updating to linux 6.8.2, kernel fails to detect battery. 6.7.4 works great.
@linsyking - it looks like this seems to be some regression or config change - others saw it as well: https://oftc.irclog.whitequark.org/aarch64-laptops/2024-04-07#33086247
Hi hexdump, what does "Graphics Hardware Acceleration with https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17888" mean? How to enable that?
@linsyking - can you please give a bit more context? i'm not fully understanding what you mean ...
update: ok - found it - i think its with gpu enabled in firefox this is not fully stable - seems to be merged in newer major versions of mesa than the one mentioned there
can confirm that stylus is working on this device as well more details: https://github.com/hexdump0815/imagebuilder/issues/68#issuecomment-2174602291
@hexdump0815 can you provide a document or something on how to compile and install a kernel on the chromebook lazor. i have tryied the normal way with a kernel source code downloaded on kernel.org and compiled it on the lazor but after im stuck... i know its not a x86 platform but a arm64 so sudo make install not gonna make it work... Thanks
@glauzon67 you see general building info is here specyfic for this device steps r here info on installation is here it is recommended to compile it on arm64 platform
if you want it to just be make install
you would have to setup depthcharge-tools i managed to do it myself but it's not trivial atm (and currently requires kelner partitions to be 64mb)
there is also an issue with kelner compiled on debian trixie not working so be aware of that
i managed to compile a kernel and boot it (Linux changeme 6.10.0-stb-cbq #1 SMP PREEMPT Wed Jul 17 13:51:03 EDT 2024 aarch64 GNU/Linux) everything work fine exept all the usb ports get disabled about 30 seconds after boot. (i know the usb ports was working because my mouse was working before the 30 seconds timeout) dmesg spit:
[ 35.808200] pp3300_hub: disabling [ 35.812155] usb 1-1: USB disconnect, device number 2 [ 35.817652] usb 1-1.1: USB disconnect, device number 3 [ 35.847159] usb 1-1.3: USB disconnect, device number 4
Any idea on whats wrong
Device: Lazor
Thanks
@glauzon67 i don't think 6.10 is the most stable kelner to run but i once had similar issues on corsola chromebook (different cpu, still arm64) when touchpad wasn't working
iirc it was either incorrect/missing .dts or modules not working/loading/existing
still the .config file you generated wasn't really meant for 6.10 (afaik) so it might be configuration issue
i do own this device myself and can try it out
still have u by any chance not pick 6.10 kelner version on purpose? (if yes, you can just git reset --hard v6.6.23
and there should be no problem). be aware that running stuff as critical as kelner from the latest commit aint the best idea :3
@glauzon67 - it might be a good idea to first start from a known working version like @LukIsHere and if that works maybe move on ... it could be that something is broken in v6.10 (happens from time to time) or it could be that something is not rightz with your kernel build
@glauzon67 please if you want to inclute long text wrap it in ``` and the whole thing put in
<details>
<summary>title</summary>
<--additional enter for formatting
`` <--this should be triple
content
`` <--same here
</details>
like this
i will join the file haha sorry its from make olddefconfig from kernel 6.1.51-stb-cbq
i don't really get that stuff well yet so can't really look at that and diagnose it
but if u r using any config you probably should use the latest (6.6.23-stb-cbq+)
i will give a try
So, i have tryied kernel 6.10.0 with "make olddefconfig" from config-6.6.23-stb-cbq yesterday and ... same thing, all usb ports get disabled after 30 seconds... Today i have compiled kernel 6.9.9 with config-6.6.23-stb-cbq and so far everything runs great... usb ports, wifi, bt etc... i wil try it for some days and give some updates.
Cheers
so it looks like either there is a regression in v6.10 or maybe some new kernel config options got introduced which will be required now - lets maybe wait a bit for v6.10 to stabilize and if the problem is then still there maybe bisecting v6.10 against v6.9 might be an option to find out which commit breaks it
After some days of testing of the kernel 6.9.9-stb-cbq... Everything runs fine... no crash but some graphical glitches in gtk apps (ex: Firefox-esr). ive been using kde-plasma-desktop on wayland and its smooth... Battery life is about 12 plus hours (from a battery health reporting at 84%)
pretty usable at the end
cheers
thanks for all the comments fellas! I successfully installed debian on my old girlfriends spin513. So sick! A tip for someone else if they looking is you need to go into the terminal on chromeOS and enable usb boot. the command is crossystem dev_boot_usb=1. this will enable you to boot from ur usb when your in dev mode. Thanks for the hard work and Great Project!
Notes on Lazor running 5.19.0
Here is list of working and non working features on the Acer Chromebook Spin 513 (sc7180-trogdor-lazor-r3) with the 5.19.0 kernel.
dmesg errors on 5.18.2
``` [ 0.427884] leds_pwm: probe of pwmleds failed with error -22 .... [ 0.628565] power_supply sbs-12-000b: driver failed to report `time_to_empty_now' property: -5 ... [ 3.181785] [drm:ti_sn_bridge_attach] *ERROR* Fix bridge driver to make connector optional! [ 3.187892] [drm:drm_bridge_attach] *ERROR* failed to attach bridge /soc@0/geniqup@8c0000/i2c@888000/bridge@2d to encoder DSI-31: -22 [ 3.211005] [drm] Initialized msm 1.9.0 20130625 for ae00000.mdss on minor 1 [ 3.218576] msm ae00000.mdss: Direct firmware load for qcom/a630_sqe.fw failed with error -2 [ 3.227256] msm ae00000.mdss: [drm:adreno_request_fw] *ERROR* failed to load a630_sqe.fw .... ``` [dmesg-5.18.0-rc5.txt](https://github.com/hexdump0815/imagebuilder/files/8611031/dmesg-5.18.0-rc5.txt)To fix orientation issues, make sure you have file
Due to an unknown issue, sensor:modalias:platform:cros-ec-accel does not match and the catchall sensor:modalias:platform:* is required.
Working
Partial
Untested
Observed issues
Touchpad stops working
In case of the cursor going missing and the touchpad no longer working, the Chromebook embedded controller may wrongly assume that you are operating the computer in Tablet mode. To verify, use `evtest`: ``` localhost ~ # evtest No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: hid-over-i2c 04F3:2C07 /dev/input/event1: cros_ec /dev/input/event2: hid-over-i2c 04F3:2C07 UNKNOWN /dev/input/event3: cros_ec_buttons /dev/input/event4: hid-over-i2c 04F3:2C07 UNKNOWN /dev/input/event5: hid-over-i2c 04F3:2C07 Stylus /dev/input/event6: hid-over-i2c 04F3:2C07 Stylus /dev/input/event7: Elan Touchpad /dev/input/event8: sc7180-rt5682-max98357a-1mic Headset Jack /dev/input/event9: sc7180-rt5682-max98357a-1mic HDMI Jack Select the device event number [0-9]: 3 Input driver version is 1.0.1 Input device ID: bus 0x6 vendor 0x0 product 0x0 version 0x1 Input device name: "cros_ec_buttons" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 114 (KEY_VOLUMEDOWN) Event code 115 (KEY_VOLUMEUP) Event code 116 (KEY_POWER) Event type 5 (EV_SW) Event code 0 (SW_LID) state 1 Event code 1 (SW_TABLET_MODE) state 0 Key repeat handling: Repeat type 20 (EV_REP) Repeat code 0 (REP_DELAY) Value 250 Repeat code 1 (REP_PERIOD) Value 33 Properties: Testing ... (interrupt to exit) ``` If it displays `SW_TABLET_MODE) state 1`, the embedded controller got stuck in tablet mode and thus the Linux kernel ignores the touchpad inputs. To fix this issue, you need to restart the embedded controller. One way to reset the controller is to update the Cr50 firmware (this will force reboot your system): ``` sudo apt install libssl-dev libusb-1.0-0-dev git clone -b cr50_stab https://chromium.googlesource.com/chromiumos/platform/ec cd ec/extra/usb_updater sed -i '/Werror/d' Makefile make gsutil cp gs://chromeos-localmirror/distfiles/cr50.r0.0.11.w0.5.112.tbz2 . tar -xvjf cr50.r0.0.11.w0.5.112.tbz2 sudo ./gsctool -s cr50.r0.0.11.w0.5.112/cr50.bin.prod ``` If that doesn't help, see if `sudo dmesg | grep 7-0015` or `sudo dmesg | grep elan` provides any output. If not, your system is not detecting the touchpad at all and there may be a hardware issue.