Notes on Coachz + Homestar running 6.6.16
Here is list of working and non working features on the HP Chromebook X2 '11 (aka coachz - 11-da0023dx). I will update accordingly with detailed issues, logs and proposed fixes. My goal in long run is to find solutions to high priority issues such as suspend, lack of audio, touch issues and others. If we can get the right people looking at this stuff and trying things out we'll have a good chance.
In an extremely unfortunate incident I ended up dropping my X2 '11. Sadly a brand new display assembly cost nearly as much as a new device so I went out and bought featuring the SC7180 SoC (Lenovo Duet 5). Fortunately, the devices are nearly 100% identical in terms of hardware and fixes and everything here can be applied to the device.
Working
• WiFi
• Bluetooth
• Pen input
• Detachable KB/Mouse
• Internal EMMC installation (#43)
• USB C
• DisplayPort
• 3D Accelerated graphics (#41)
• Suspend (works on 5.16.X
up)
• KVM
Partial
• Touch (libinput needs quirks + reporting to freedesktop for TOUCH_CANCEL
)
• Orientation sensor (inverted)
• Built-in audio / speakers (kernel/userland issues)
• Built-in microphone (gain coachz)
• H/W video decode (partial)
Broken
• Rear & front camera (they're crap anyways)
• DPMS (display off) (coachz)
Untested
• Fingerprint sensor
Touchscreen Issues
There appears to be an issue with the touch screen, Xorg and libinput
where it will stop functioning once the user creates a substantial pressure point (e.g. resting thumb) on display. Wayland does not appear to be affected in the same way, so there's a consideration.
- Luckily all we need to do is install
xserver-xorg-input-evdev
and tell our touchscreen to utilize that driver.
-
sudo apt-get install xserver-xorg-input-evdev
-
sudo nano /usr/share/X11/xorg.conf.d/40-libinput.conf
-
Locate MatchIsTouchscreen "on"
and change Driver "libinput"
to Driver "evdev"
• FOR REFERENCE:
- There is also a workaround to the issue on Xorg that I discovered accidentally while running TouchEgg to simulate right click which still functions while Xorg is failing to recognize touch.
-
Install TouchEgg and Touchè from the releases via dpkg -i
& reboot
-
Open Touchè, if you can't find an icon just execute com.github.joseexposito.touche
in terminal.
-
In Global gestures
> Tap
> Tap with 3 fingers
set to Execute a command
and add xinput disable 6 && xinput enable 6
as the command to execute.
Now when touch stops responding all you will have to do is tap the screen with 3 phalanges and you'll be back in action. Another potential solution could involve using something like xbindkeys
and your imagination to achieve a similar result. Also, if you run LightDM and don't want to experience this problem on the login screen try switching to GDM3 which uses Wayland.
Sound Fixes
Turns out we can get the sound working as well. By the way this is all very confusing to me how ucm
(use case manager) works, in general I think it's broken for whatever reason and that's why I'm confused. I figured out the root cause is partially due to the ordering of sound devices in the sc7180-trogdor.dtsi
a quick modification to the file and rebuild of kernel will fix us right up.
sc7180-trogdor.dtsi
Before:
dai-link@0 {
link-name = "MultiMedia0";
reg = <MI2S_PRIMARY>;
cpu {
sound-dai = <&lpass_cpu MI2S_PRIMARY>;
};
sound_multimedia0_codec: codec {
sound-dai = <&alc5682 0 /* aif1 */>;
};
};
dai-link@1 {
link-name = "MultiMedia1";
reg = <MI2S_SECONDARY>;
cpu {
sound-dai = <&lpass_cpu MI2S_SECONDARY>;
};
sound_multimedia1_codec: codec {
sound-dai = <&max98360a>;
};
};
sc7180-trogdor.dtsi
After:
dai-link@1 {
link-name = "MultiMedia1";
reg = <MI2S_SECONDARY>;
cpu {
sound-dai = <&lpass_cpu MI2S_SECONDARY>;
};
sound_multimedia1_codec: codec {
sound-dai = <&max98360a>;
};
};
dai-link@0 {
link-name = "MultiMedia0";
reg = <MI2S_PRIMARY>;
cpu {
sound-dai = <&lpass_cpu MI2S_PRIMARY>;
};
sound_multimedia0_codec: codec {
sound-dai = <&alc5682 0 /* aif1 */>;
};
};
☝️See what I did there? 🤣 I'm still not convinced this is most appropriate solution. I have created a sc7180-trogdor.dtsi.patch
in case anyone may find it useful. It should be noted; the patch sacrifices automatic set-up of mic in favor of speakers because alsa seems inclined to configure hw:0,0
automatically.
• FOR REFERENCE (coachz
)
aplay - l
does report having HiFI-1
card 2: sc7180adau7002m [sc7180-adau7002-max98357a], device 1: MultiMedia1 HiFi-1 []
Subdevices: 1/1
Subdevice #0: subdevice #0`
Running aplay -D plughw:2,1 /home/geofferey/Downloads/piano2.wav
got me sound output. Yay!
Using info I obtained from Arch: ALSA/Troubleshooting I created /etc/asound.conf
with the following
pcm.!default {
type hw
rate 48000
card 2
device 1
}
defaults.pcm.card 2
defaults.pcm.device 1
defaults.ctl.card 2
Please keep in mind on my machine it's card 2
- device 1
because I have dummy and loopback audio drivers. Yours will likely be card 0
or card 1
; which is why the above solution may not be ideal, especially for inclusion in images. It also breaks automatic redirection to USB C headphones. More investigation is required.
Here is some more output of other commands in case anyone may be able to tell me what's going on with UCM.
cat /proc/asound/cards
reports:
0 [sc7180adau7002m]: SC7180 - sc7180-adau7002-max98357a
sc7180-adau7002-max98357a
Here is message from alsactl init
:
alsa-lib main.c:1014:(snd_use_case_mgr_open) error: failed to import hw:0 use case configuration -2
Found hardware: "SC7180" "" "" "" ""
Hardware is initialized using a generic method
This is what I could find in dmesg
:
[ 5.422974] max98357a audio-codec-0: GPIO lookup for consumer sdmode
[ 5.422989] max98357a audio-codec-0: using device tree for GPIO lookup
[ 5.620411] debugfs: Directory '62d87000.lpass' with parent 'sc7180-adau7002-max98357a' already present!
[ 5.677936] input: sc7180-adau7002-max98357a HDMI Jack as /devices/platform/sound/sound/card0/input6
Lid Switch Fixes
I noticed during my time using homestar and coachz that leaving the keyboard attached and closed leads to spurious mouse input if not in sleep state. Since I do not always want to sleep when I close the lid + plug waking device it got really annoying and hazardous to my working conditions. At first I thought it was related to touch input but it was actually caused by the touchpad. Another issue with lid switch is due to how upower/XFCE handle it in order to blank screen and often results in a black screen that stays after opening the keyboard flap. Below are some workarounds and scripting wizardry.
-
sudo apt-get install acpid brightnessctl
-
set IgnoreLid=true
in /etc/Upower/Upower.conf
-
optionally set HandleLidSwitch=ignore
in /etc/systemd/logind.conf
-
create the following file in /etc/acpi/events/lidswitch
# /etc/acpi/events/lidswitch
# run a script on lid open/close events
event=button/lid
action=/etc/acpi/actions/acpi-lid-switch.sh "%e"
- create the script in
/etc/acpid/actions/acpi-lid-switch.sh
#!/bin/sh
## This script is intended to be ran by ACPID daemon on lid switch events with the goal of disabling/re-enabling
# local tochpad on Chromebook trogdor + display on lid close/open. There is an issue with the touchpad that causes
# spurious input while the lid is closed and not suspeded + XFCE/upowers method of screen blanking causes issues
# with resuming session after opening the keyboard flap.
LOGFILE=/dev/null
## This is all being done so root can get display # and session cookie of the foreground users console
FG_USER=$(stat -c%U /dev/tty$(fgconsole))
FG_UID=$(id -u ${FG_USER})
FG_TTY="tty$(fgconsole)"
FG_XORG_PID=$(pgrep -xt ${FG_TTY} Xorg)
FG_XDISPLAY=:$(lsof -aUp "${FG_XORG_PID}" | sed '\|.*X11-unix/X\([0-9]\{1,\}\) .*|!d;s//\1/;q')
echo "$1" >> ${LOGFILE}
echo $(whoami) >> ${LOGFILE}
echo FG_USER=${FG_USER} >> ${LOGFILE}
echo FG_UID=${FG_UID} >> ${LOGFILE}
echo FG_TTY=${FG_TTY} >> ${LOGFILE}
echo FG_XORG_PID=${FG_XORG_PID} >> ${LOGFILE}
echo FG_XDISPLAY=${FG_XDISPLAY} >> ${LOGFILE}
export DISPLAY=$FG_XDISPLAY
## Just guessing some possible display managers to locate Xorg session cookie, not tested with other DMs
DMS="gdm lightdm"
for DM in ${DMS}; do
if [ -e /run/user/${FG_UID}/${DM}/Xauthority ]; then
export XAUTHORITY=/run/user/${FG_UID}/${DM}/Xauthority
echo DISPLAY_MANAGER=${DM} >> ${LOGFILE}
fi
done
state=$(echo "$1" | cut -d " " -f 3)
case "$state" in
close)
# Disable touchpads/screen on lid close to prevent phantom touches
echo "Disabing touch devices..." >> ${LOGFILE}
/usr/bin/synclient touchpadoff=1 >> ${LOGFILE}
/usr/bin/xinput disable "pointer:Google Inc. Hammer" >> ${LOGFILE} 2>&1
#/usr/bin/xinput disable "pointer:gt7375p 27C6:0E51" >> ${LOGFILE} 2>&1
/usr/bin/brightnessctl --save
/usr/bin/brightnessctl s 0
;;
open)
# Re-enable the touch devices after opening the lid
echo "Enabling touch devices..." >> ${LOGFILE}
/usr/bin/xinput enable "pointer:Google Inc. Hammer" >> ${LOGFILE} 2>&1
#/usr/bin/xinput enable "pointer:gt7375p 27C6:0E51" >> ${LOGFILE} 2>&1
/usr/bin/synclient touchpadoff=0 >> ${LOGFILE}
/usr/bin/brightnessctl --restore
;;
*)
# panic: not a state I know about!
echo "PANIC STATE" >> ${LOGFILE}
esac
echo "" >> ${LOGFILE}
Updating Kernel
In order to get KVM networking, waydroid, various USB peripherals and many other features working I opt'd to build mine from source following instructions from these repos. I have also written a simple script
to automate the process for myself and others. Here is a link to my current kernel configuration
. It has support for many of items mentioned above.
..... to be continued....