arnoldthebat / chromiumos

Stub Repo for chromiumos issues
https://arnoldthebat.co.uk/
Other
269 stars 34 forks source link

R72 special + one mix yoga (Intel x5-Z8350 Cherry Trail) #248

Open ngvincent opened 5 years ago

ngvincent commented 5 years ago

One mix yoga, chromefy using R72 special + eve R71

7" 1920x1200 Goodix Capacitive 9111 4020 touchscreen (ACPI\GDIX1001, VEN_GDIX, DEV_1001) Intel x5-Z8350 on BIOS 5.11 05/21/2018, Cherry Trail bytcr-rt5651 audio/sound (Intel UCM RT5651), 3.5mm jack

  1. chromefy-ed img boots via usb, but does not install properly.
    1. most likely due to device using /dev/mmcblk , had to use dd to copy img directly to mmc device
  2. battery meter/brightness-control does not work
    1. brightness control works, see edits below to build kernel
    2. on a ubuntu 18.10 distro with kernel 4.15+, had to manually add pwm-lpss, pwm-lpss-platform, pwm-lpss-pci to initram modules to fix battery/brightness-control.
    3. any ideas on how to do this on chromiumos? believe R72 uses 4.16 kernel
  3. sound does not work sound works now
    1. see comment below on getting sound set up
    2. .img shipped with bytcr-rt5651, but distro booted up with no sound (sound bar slider cannot be moved), and any website/app using video will hang/spin forever
    3. replaced with bytcr-rt5651 from here https://github.com/plbossart/UCM/blob/master/bytcr-rt5651/README
    4. sound bar slider can be moved, but no sound. youtube/... does not hang, video plays withotu sound
      1. alsamixer shows speaker/3.5mm as 0 volume
      2. alsamixer also shows the Intel HDMI audio first. blacklisted it, but nothing changed 1 Blacklist the snd_hdmi_lpe_audio : Create a file under /etc/modprobe.d with the name blacklist_snd_hdmi_lpe_audio.conf containing a single line: blacklist snd_hdmi_lpe_audio
    5. sound is broken in ubuntu 18.10 too even with these fixes, need to look further
  4. pen does not work (touchscreen works)
    1. not a major item, will need to investigate pen properly with a linux distro
ngvincent commented 5 years ago

sound: managed to get speaker working(distortion free, correct volume)

using plbossart's UCM bytcr-rt5651, blacklisted snd_hdmi_lpe_audio

enabling speaker

  1. shell
  2. sudo -s
  3. alsamixer -c 0
  4. Speaker -> should already be unmuted. if not, press m to unmute
  5. LOUT MIX OUTVOL L -> unmute
  6. LOUT L -> unmute
  7. LOUT MIX OUTVOL R -> unmute (optional?) do not unmute LOUT R. looks like this is a monospeaker?

if you need to switch back to speaker from 3.5mm, you need to mute "LOUT MIX OUTVOL", mute "L OUT L", then unmute them accordingly

enabling 3.5mm (didnt test microphone yet)

  1. alsamixer -c 0
  2. Headphone -> unmute
  3. Speaker -> mute
  4. HPO L -> unmute
  5. HPO MIX DAC1 -> unmute
  6. DD MIXR DAC R1 -> unmute
ngvincent commented 5 years ago

steps to build custom kernel to get working brightness (and battery-bar, TBD)

inside chroot: setup env

  1. sudo apt-get install git-core make kernel-package bc nano
  2. git clone https://chromium.googlesource.com/chromiumos/third_party/kernel -b chromeos-4.14
  3. git checkout 66ab05738a89be545af257dbea63970a127565b3 (use the same build hash from R72 special - https://github.com/arnoldthebat/chromiumos/blob/master/sys-kernel/chromeos-kernel-4_14/chromeos-kernel-4_14-9999.ebuild)

inside chroot: set up configs

  1. -- take .config from R72 build git repo, copy to /
  2. sudo modprobe configs; zless /proc/config.gz
  3. cat /proc/config.gz | gunzip > base.config
  4. wget 'https://raw.githubusercontent.com/arnoldthebat/chromiumos/master/kconfigs/.config'
  5. copy to root folder
  6. add these additional flags to get brightness working. battery-bad TBD CONFIG_PWM=y CONFIG_PWM_CRC=y CONFIG_PWM_LPSS=y CONFIG_PWM_LPSS_PLATFORM=y CONFIG_PWM_LPSS_PCI=y

inside chroot: build kernel

  1. sh ./chromeos/scripts/prepareconfig chromeos-intel-pineview (skip step since we copied .config from R72 build)
  2. make oldconfig. if prompts come up, choose "y" or "m"(if Y is not available). basically, we are compiling these additional items (PWM support etc) directly into the kernel
  3. make -j8
  4. //wait until build is successful
  5. sudo make modules_install
  6. (note: chroot may not have write access to /lib/modules/4.14.. you may have to remove/rename folder outside chroot, then do 'make modules_install' within chroot, then copy the /lib/modules/4.14.<> to the same location outside chroot)

outside chroot: copy kernel to device

  1. mkdir efifolder
  2. mount /dev/mmcblk0p12 efifolder
  3. cd efifolder/syslinux
  4. mv vmlinux.A vmlinuz.A.bkup (backup existing kernel)
  5. mv bzImage vmlinuz.A
ngvincent commented 5 years ago

able to compile and install kernel

added these flags, able to control brightness now CONFIG_PWM=y CONFIG_PWM_CRC=y CONFIG_PWM_LPSS=y CONFIG_PWM_LPSS_PLATFORM=y CONFIG_PWM_LPSS_PCI=y

couple of things left

  1. battery bar still missing (uses AXP288_FUEL_GAUGE)
  2. wifi not working after sleep (iwlwifi complains after waking up)
  3. sleep was still unstable (maybe due to lack of the PWM kernels), will continue testing/monitoring tomorrow

EDIT: just PWM configs above - stable added CONFIG_AXP288_FUEL_GAUGE=m . device now freezes 2-5 min after boot. can't see what's happening in /var/log/messages (force reboot means log messages do not get flushed into the file properly), frustrating