cb-linux / breath

Linux for Chromebooks
https://cb-linux.github.io/breath/
MIT License
301 stars 53 forks source link

Include platform POPPY #147

Closed EMLommers closed 2 years ago

EMLommers commented 2 years ago

Running breath on poppy platform causes some devices not to work properly.

Do you have a solution?

Chromebooks concerning:

Platforms:

Running ChromeOS kernel:

RodBarnes commented 2 years ago

I'm not familiar with POPPY -- do you mean Puppy?

Running breath on poppy platform causes some devices not to work properly. Backlight screen Backlit keyboard

What is the output of sudo brightnessctl -l? It should display a list of the recognized devices.

MilkyDeveloper commented 2 years ago

Puppy is one of the older boards. I’m pretty sure that POPPY is one of the first Kabylake Baseboards, and even my NAMI device is based on it.

Headphone jack audio doesn’t work for any device, so I won’t be focusing on it.

I’m pretty sure that keyboard backlights are handled by one of the ChromeOS kernel EC modules, so maybe lspci -vvvv and lsusb would be useful there.

By the screen backlight, do you mean the screen’s brightness? Is it at minimum brightness at default? This is again another thing that I believe ChromeOS kernel modules should be handling.

Thanks for posting this issue!

EMLommers commented 2 years ago

Hi,

Keyboard brightness is OK! working.

Yes indeed it is the screen brightness, it is on max! and not adjustable, even when brightnessctl is mentioning GNOME settings... but not applying.

POPPY is indeed Kabylake platforms, see initial issue on top, also ChromeOS mosys give actual base board. This may differ from: https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/

I tried no use your script and liked to use ChromeOs kernel 4.4 and Ubuntu 20.04. Ubuntu 18-22 should be possible. Theoretically it should be possible. Your automated script is mentioning any ChromeOS kernel, but only 5.10, 5.10 alt and 5.4 are selectable. The steps for building own kernel in the docs ,(as I tried to use 4.4) will result in non bootable kernel/partition, when dd bzImage.signed to partition 1

Can you supply an automated kernel change and install script?

This is really good solution.

Can you look into a solution where ChromeOS kernel starts and runs/kexec a non ChromeOS kernel like 5.15 or higher

A solution for sound could be integrating cras to enable audio . ref: https://github.com/yusefnapora/pixelbook-linux

MilkyDeveloper commented 2 years ago

I've added some more kernel options to the script, try it out!

I don't understand your approach with kexec. If the ChromeOS kernel kexecs into a non-ChromeOS kernel, then you would just be using the mainline kernel, and, at that point, you could just use MrChromebox's firmware.

I've seen the CRAS audio stuff and it seems very hard to integrate. I always failed building it, and the process is overly complicated. You could try integrating it, but I cannot since Bluetooth audio works as of lately and so does internal audio.

EMLommers commented 2 years ago

Hi Have you seen the approach of Hexdump0815? https://github.com/hexdump0815/imagebuilder Using the ChromeOS kernel to boot into the mainline linux kernel, in order to keep the depthcharge ok.

That is something I do not want to do, to change firmware. not even RW Legacy. My goal is, to find a way (with help of others) to run mainline linux, on a chromebook, without changing firmware and not in developer mode. So in the end changing back from dev to normal with mainline linux .. If we could use just a mainline kernel instead of ChromeOS kernel with vbooot and deptcharge it would be ok. Is it possible to add in build.sh option to use mainline kernel instead of ChromeOS kernel and sign?

There is also a solution to run a bootloader (rEFind/Ventoy/etc..) as signed kernel and run.. I like to keep it secure and do not really trust UEFI or MBR.

I will check CRAS and try to integrate. Will test on Apollolake and Kabylake, get back to you.

MilkyDeveloper commented 2 years ago

You can boot a mainline kernel on Depthcharge without using a kexec from the ChromeOS kernel. You just put a bzImage into vbutil_kernel to sign it and then dd it, just like you can do with the normal ChromeOS kernel.

Throughout this whole process, you 100% cannot disable dev mode. It's simply impossible. DM Verity and Verified Boot Crypto would thwart this, unless you can sign your kernel from Google. If you wish to skip the timeout, you can do so by disabling the Write Protect and setting the GBB Flags to reduce the timeout from 30s to ~1s.

Also, why do you want mainline linux? There's little disadvantage to the ChromeOS kernel.

I've tried kexecing GRUB for DOS without avail. Using rEFind and Ventoy are interesting solutions that I'm currently looking at. Just wondering, why do you distrust UEFI?

EMLommers commented 2 years ago

My motto: nothing is impossible.. The depthcarge kernel should be signed , as the docs read, signed by anyone, not only google.

The mainline linux kernel has updated routines, patches and additional security for several platforms, including additions from Intel, AMD and others. I am not saying always update kernel, cause sometimes it also breaks things. When running kernel 5.13 or 5.15 on my apollolake everything is working (except audio headphones), but I will look into CRAS and see whether it solves the issue, also kabylake (and skylake derivatives)

Why I do not trust UEFI? https://www.google.com/search?client=firefox-b-e&q=intel+uefi+vulnerabilities

u-boot/depthcarge/vboot is ideal and very secure. Why not use, or example, coreboot, slim bootloader, redboot, ventoy, rEFInd etc as signed boot partition, and keep firmware easy and simple, just secure boot and let the boot kernel do the original bios checks and boot OS.

Currently for my apollolake I use GBB 0xd

I really love the google chromebook hardware, but like to get away from chromeos as far as possible. ;)

I will check the script and kernel options.. Thanks a lot! `

MilkyDeveloper commented 2 years ago

This is a good idea. A few months ago, I made a repo here. I would reccomend you to not look at this (barebones) repository and build a kernel there using the minimal kernel config.

EMLommers commented 2 years ago

I will look at the kernel config and scripts and build the kernel using minimal config. Get back to you!

RodBarnes commented 2 years ago

I really love the google chromebook hardware, but like to get away from chromeos as far as possible. ;)

Exactly my thoughts. I could go get another laptop and take a simpler route but I really, really like this laptop device and so it's worth it (for me) to go down this path with Breath or something similar.

RodBarnes commented 2 years ago

@EMLommers I, too, have an ApolloLake device so am interested in what you find.

EMLommers commented 2 years ago

Build CRAS.... Still working on it.. results so far: Build on Apollolake (Babymega) using GCC-8

Using gnome: Output: cras Input: cras Using SOF v2.0 and sof-signed. kernel 5.13 . Ubuntu 21.10 latest tplg / modified tplg

Some noise through headphones. Can disable and enable L & R Enabling ALC in alsamixer freezes audio.

$ cras_test_client System Volume (0-100): 100 Capture Gain (0.00 - 0.00): 0.00dB User muted: Not muted Output Devices: ID Name 12 sof-bxtda7219max: :0,7 11 sof-bxtda7219max: :0,6 10 sof-bxtda7219max: :0,5 7 sof-bxtda7219max: :0,1 6 sof-bxtda7219max: :0,0 Output Nodes: Stable Id ID Vol Plugged L/R swapped Time Hotword Type Name (1b4c3f23) 12:0 100 no no 0 HDMI HDMI/DP,pcm=7 Jack (ea064cf9) 11:0 100 no no 0 HDMI HDMI/DP,pcm=6 Jack (92adced0) 10:0 100 no no 0 HDMI HDMI/DP,pcm=5 Jack (febb3885) 7:0 100 yes no 1649703988 UNKNOWN (default) (9e934263) 6:0 100 no no 0 HEADPHONE Headphone (72a57953) 6:1 100 yes no 1649703986 INTERNAL_SPEAKERSpeaker Input Devices: ID Name 13 sof-bxtda7219max: :0,8 9 sof-bxtda7219max: :0,2 8 sof-bxtda7219max: :0,1 5 Post DSP Loopback 4 Post Mix Pre DSP Loopback Input Nodes: Stable Id ID Gain Plugged L/R swapped Time Hotword Type Name (e363fa47) 13:0 0 yes no 1649704000 UNKNOWN (default) (a6476c33) 9:0 0 yes no 1649703992 UNKNOWN (default) (61aab6ba) 8:0 0 no no 0 MIC Mic (4ce2eaa5) 8:1 0 yes no 1649703990 INTERNAL_MIC Internal Mic (8c74f766) 5:0 0 yes no 0 POST_DSP_LOOPBACK Post DSP Loopback (8a04af91) 4:0 0 yes no 0 POST_MIX_LOOPBACK Post Mix Pre DSP Loopback Attached clients: ID pid uid 16 1422 1000 26 1422 1000 27 3786 1000 Num active streams: 2 Last audio active time: 1297, 650531134

$ cras_test_client --dump_server_info

System Volume (0-100): 100 Capture Gain (0.00 - 0.00): 0.00dB User muted: Not muted Output Devices: ID Name 12 sof-bxtda7219max: :0,7 11 sof-bxtda7219max: :0,6 10 sof-bxtda7219max: :0,5 7 sof-bxtda7219max: :0,1 6 sof-bxtda7219max: :0,0 Output Nodes: Stable Id ID Vol Plugged L/R swapped Time Hotword Type Name (1b4c3f23) 12:0 100 no no 0 HDMI HDMI/DP,pcm=7 Jack (ea064cf9) 11:0 100 no no 0 HDMI HDMI/DP,pcm=6 Jack (92adced0) 10:0 100 no no 0 HDMI HDMI/DP,pcm=5 Jack (febb3885) 7:0 100 yes no 1649703988 UNKNOWN (default) (9e934263) 6:0 100 no no 0 HEADPHONE Headphone (72a57953) 6:1 100 yes no 1649703986 INTERNAL_SPEAKERSpeaker Input Devices: ID Name 13 sof-bxtda7219max: :0,8 9 sof-bxtda7219max: :0,2 8 sof-bxtda7219max: :0,1 5 Post DSP Loopback 4 Post Mix Pre DSP Loopback Input Nodes: Stable Id ID Gain Plugged L/R swapped Time Hotword Type Name (e363fa47) 13:0 0 yes no 1649704000 UNKNOWN (default) (a6476c33) 9:0 0 yes no 1649703992 UNKNOWN (default) (61aab6ba) 8:0 0 no no 0 MIC Mic (4ce2eaa5) 8:1 0 yes no 1649703990 INTERNAL_MIC Internal Mic (8c74f766) 5:0 0 yes no 0 POST_DSP_LOOPBACK Post DSP Loopback (8a04af91) 4:0 0 yes no 0 POST_MIX_LOOPBACK Post Mix Pre DSP Loopback Attached clients: ID pid uid 16 1422 1000 26 1422 1000 28 3811 1000 Num active streams: 2 Last audio active time: 1463, 934123748

$ cras_test_client --dump_audio_thread Audio Debug Stats: -------------devices------------ Output dev: sof-bxtda7219max: :0,0 buffer_size: 16384 min_buffer_level: 0 min_cb_level: 1102 max_cb_level: 1102 frame_rate: 48000 num_channels: 2 est_rate_ratio: 0.999997 num_underruns: 0 num_severe_underruns: 0 highest_hw_level: 3577 software_gain_scaler: 0.000000

Input dev: sof-bxtda7219max: :0,1 buffer_size: 16384 min_buffer_level: 0 min_cb_level: 1200 max_cb_level: 1201 frame_rate: 48000 num_channels: 2 est_rate_ratio: 1.000002 num_underruns: 0 num_severe_underruns: 0 highest_hw_level: 2037 software_gain_scaler: 1.000000

-------------stream_dump------------ stream: 1703936 dev: 6 direction: Output stream_type: CRAS_STREAM_TYPE_DEFAULT buffer_frames: 2204 cb_threshold: 1102 effects: 0x0000 frame_rate: 48000 num_channels: 2 longest_fetch_sec: 0.014752289 num_overruns: 0 is_pinned: 0 pinned_dev_idx: 0 num_missed_cb: 0 volume: 1.000000 runtime: 1166.687756180 channel map:0 1 -1 -1 -1 -1 -1 -1 -1 -1 -1

stream: 1048576 dev: 8 direction: Input stream_type: CRAS_STREAM_TYPE_DEFAULT buffer_frames: 2204 cb_threshold: 1102 effects: 0x0000 frame_rate: 44100 num_channels: 2 longest_fetch_sec: 0.000000000 num_overruns: 0 is_pinned: 0 pinned_dev_idx: 0 num_missed_cb: 0 gain: 1.000000 runtime: 1664.701391124 channel map:0 1 -1 -1 -1 -1 -1 -1 -1 -1 -1

Audio Thread Event Log: start at 1225 1691.495200452 DEV_SLEEP_TIME dev:8 wake:000001691.519782293 .... 1694.198393616 PB_MSG msg_id:6

MilkyDeveloper commented 2 years ago

You're using this on Kernel 5.13, which is an external kernel not supported by Breath, but I think the same steps would apply. But I don't see the value in CRAS unless you connect it (somehow) to PulseAudio or PA :D.

EMLommers commented 2 years ago

I trying to build breath and run CRAS.. but not sucessfully could build breath. so I tested on non chromeos kernel. After installing CRAS it automatically switches between headphone and speaker. The only option for sound is cras. I am now going to build it on chromeOS kernel v4.4 v.4.14 and v 5.4 Screenshot from 2022-04-12 12-23-18

EMLommers commented 2 years ago

Using breath: FETAURES=ISO,KEYMAP xfce ubuntu focal-20.04 Kernel 5.10.... Build CRAS.. no problem. tested on 2 chromebooks : Apollolake and Kabylake, Audio is detected.ad No sof installed. Have to check audio routing via CRAS. Had some audio through headphones. (After playing with alsamixer) Audio bxt-da-7219-max detected out of the box. and kbl-r5514-5663 max also out of the box No sound heard trough speakers, or routings or lower kernel.

Will check 4.4, 4.14, 5.4.

runcros commented 2 years ago

Hello @EMLommers , poppy sound is working right now. Please join our discord to make it working on your platform ! https://discord.gg/WatsaYhXCa

EMLommers commented 2 years ago

In the meantime I installed Coreboot and running fedora with everything working... Thanks anyway!

MilkyDeveloper commented 2 years ago

Does it have kernel 5.19 or ahead?

EMLommers commented 2 years ago

5.15, 5.16, 5.17, 5.18 Not updated yet to 5.19, cannot inform, but I think no problem

EMLommers commented 2 years ago

Check repository pixelbook-fedora, maybe you can help some of his changes