Open Geofferey opened 2 years ago
Regarding your touchscreen issues: If you update to debian unstable, there should be no issue using Wayland with either Gnome or KDE
@leezu So Mate can potentially run on Wayland now?
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 figured out the sound, partially. At least I have it working for me now ;)
@leezu So Mate can potentially run on Wayland now?
Both KDE and Gnome work well with Wayland. My understanding is that touchscreen and gesture support is better on Wayland, but X11 may have improved since last time I checked.
Updated with a better solution to touch screen issues on Xorg. I had tried evdev
before but it wasn't actually installed. I guess Xorg was falling back to libinput
in its absence and giving me wrong impressions. Touchscreen works perfect on X now, better than Wayland.... Some issue in gnome when moving icons...
On 230922-01 Bookworm, touchscreen and pen input were not working out of the box. Enabling the Goodix hid-i2c driver in kernel config made it work out of the box, at least on GNOME Wayland.
@pulak1901 - thanks a lot for the report - which kernel config options exactly did you have to enable to get it working? i would like to add them for future kernels then.
@hexdump0815 - just I2C_HID_OF_GOODIX.
Regarding audio output, it seems the kernel alsa drivers are working fine, but as there is no UCM, pulseaudio is automatically configuring the default device (0) internal mic. The other devices are
aplay -l
, so digital output/hdmi?The only UCM config available for SC7180 is sc7180-rt5682-max98357a, but as coachz does not have rt5682, it is not matched. I tried forcing it to use the same config but that did not go well, I think rt5682 exposes a lot of configurations that are set with cset but adau7002 does not appear to have anything similar.
Note that simply creating `/etc/asound.conf` with `defaults.pcm.device 1` (thanks to the notes in @Geofferey 's initial post) will set the default device to the speaker and on subsequent reboots, pulseaudio will auto-configure the speakers instead of the mic.
To verify the order of devices, we can use aplay & arecord: ``` $ aplay -L ... hw:CARD=sc7180adau7002m,DEV=1 sc7180-adau7002-max98357a, Direct hardware device without any conversions hw:CARD=sc7180adau7002m,DEV=2 sc7180-adau7002-max98357a, Direct hardware device without any conversions ... $ arecord -L ... hw:CARD=sc7180adau7002m,DEV=0 sc7180-adau7002-max98357a, Direct hardware device without any conversions ... ```
To have both internal mic & internal speakers working, I figured out how to create a very basic UCM config that will point alsa/pulseaudio to the correct devices.
First make a directory for the new UCM config `# cd /usr/share/alsa/ucm2/Qualcomm/sc7180/` `# mkdir adau7002-max98357a && cd adau7002-max98357a` Inside this new directory, we'll have two files. One for the actual use case configuration, and another which acts as a loader. The loader will be named `sc7180-adau7002-max98357a-1mic.conf`, and it'll contain the following: (based on [sc7180-rt5682-max98357a-1mic.conf](https://github.com/alsa-project/alsa-ucm-conf/blob/master/ucm2/Qualcomm/sc7180/rt5682-max98357a/sc7180-rt5682-max98357a-1mic.conf) ``` Comment "SC7180 ADAU7002 MAX98357A single microphone sound card" Syntax 4 SectionUseCase."HiFi" { File "/Qualcomm/sc7180/adau7002-max98357a/HiFi.conf" Comment "Default" } Include.card-init.File "/lib/card-init.conf" Include.ctl-remap.File "/lib/ctl-remap.conf" ``` The other file will be named HiFi.conf, containing the following ``` SectionDevice."Speaker".0 { Value { PlaybackPCM "hw:CARD=${CardId},DEV=1" PlaybackChannels 2 PlaybackRate 48000 PlaybackPriority 100 PlaybackMixerElem "Speaker" PlaybackVolume "Speaker Playback Volume" } } SectionDevice."Internal Mic".0 { Value { CapturePCM "hw:CARD=${CardId},DEV=0" CapturePriority 100 CaptureMixerElem "Internal Mic" CaptureVolume "Internal Mic Capture Volume" } } #SectionDevice."HDMI".0 { # Value { # PlaybackPCM "hw:CARD=${CardId},DEV=2" # } #} ``` As I do not have any way to test the HDMI output, I've commented it out from the UCM config because it will conflict with the rest of the configuration. Also note that only the PlaybackPCM and CapturePCM values are required, the rest should be automatically configured. I've taken the other values from [sc7180-rt5682-max98357a](https://github.com/alsa-project/alsa-ucm-conf/blob/master/ucm2/Qualcomm/sc7180/rt5682-max98357a/HiFi.conf) & added PlaybackRate based on the output of `pulseaudio -vvv`. Now we just need to add this to the ucm configurations list, so: `cd /usr/share/alsa/ucm2/conf.d/SC7180` `ln -s ../../Qualcomm/sc7180/adau7002-max98357a/sc7180-adau7002-max98357a-1mic.conf sc7180-adau7002-max98357a.conf` And we're done! On rebooting (or restarting pulseaudio), both speaker and internal mic should be working.
@pulak1901 - for the audio setup it is usually a good idea to start from the chromeos ucm files and go from there - they usually will not work out of the box, but can give some direction - see also: https://github.com/hexdump0815/imagebuilder/blob/main/doc/alsa-ucm-pulseaudio-hacking.txt ... also be careful to always keep the volume low and try to avoid feedback within the internal mixer to keep the speakers and your ears well - also never put headphones fully on the head when trying to get audio working ... good luck
update: there also some audio notes in the issue description as well
@hexdump0815 the UCM config is indeed based on chrome os' [UCM] (https://chromium.googlesource.com/chromiumos/overlays/board-overlays/+/refs/heads/main/overlay-strongbad/chromeos-base/chromeos-bsp-strongbad/files/coachz/audio/ucm-config/sc7180-adau7002-max98357a/HiFi.conf) (doesn't work directly) and the audio-related notes from @Geofferey helped me quite a bit Additionally, I went through the postmarketOS wiki on UCM, plus the alsa configuration docs to figure out how the config files are loaded and how to debug the config
I think if we finish up the UCM (mic gain is too low, and the hdmi output), we'll have a complete Debian setup on coachz out of the box(ignoring fingerprint reader and webcams), so I'm trying to clear out any of the deal breakers that I come across :)
For instance, the touchscreen was not working out of the box, so I checked the device tree and it's a goodix touchscreen. I checked with the postmarketOS build and realized that it was only the driver that was missing, no other configuration is required
Edit: thanks for the volume warning :D, its really a "once bitten, twice shy" situation for me because I've already experienced that with Arch Linux a decade ago :P
Edit 2: I think with https://github.com/hexdump0815/imagebuilder/blob/main/doc/alsa-ucm-pulseaudio-hacking.txt I'll be able to figure out the microphone gain and the rest of the UCM config
With PostmarketOS, and maybe with these images (I haven't tried in a while), the touchpad is another issue: it's like the pressure threshold is too high. If I use the tip of my finger lightly, the cursor doesn't move, even though libinput debug-gui
shows the finger's presence. It's only when I use the flat of my finger that the cursor starts moving and the debug-gui starts drawing lines. But then if I press a little bit harder, it goes back to ignoring the finger, as if it's exceeding a palm-detect threshold or something.
@DanaGoyette Yeah that's the dreaded touch cancel
event. It happens on both the touchscreen and touchpad. Something called quirks
may help address the issue, I'm not sure if it's a kernel event that libinput can't ignore or what. I wish I could just disable that event somehow or adjust the threshold.
i have no idea if it helps, but in this issue - https://github.com/hexdump0815/imagebuilder/issues/53 - a lot of things were tried/done to significantly improve the touch functionality on kukui krane (so completely different chromeos device) - maybe reading through it helps and/or is good for some inspiration?
Thankfully libinput provides a whole host of tools to debug input issues. By mostly following the official docs I was able to figure out that the touchpad down pressure is 60 (light touches, like the tip of your finger, would register at around 30-40 from what I can see) and palm threshold is at 160.
You can then set your desired values in the following quirks configuration to /etc/libinput/local-overrides.quirks
or to /usr/share/libinput/
(50-system-google.quirks
has configurations for other Chromebooks)
[HP Chromebook X2 11"]
MatchUdevType=touchpad
MatchName=Google Inc. Hammer
MatchDeviceTree=*coachz*
ModelChromebook=1
AttrPressureRange=25:10
AttrPalmPressureThreshold=180
Notes:
Instead of boosting the gain in Pulseaudio (as mentioned here), I have been trying to figure out if I could have a boosted alsa pcm stream as the default for the mic. Unfortunately I couldn't get it to work by adding a card-specific configuration at /usr/share/alsa/cards, and it looked like pulse will grab the hardware stream anyways, so I'm leaving the mic gain situation for now.
Here's the softvol alsa config if anyone is interested.
Put this in your .asoundrc or asound.conf and `arecord -L` should show "boosted". On opening this stream for the first time, alsamixer should also show a "Boost" control. ``` pcm.boosted { type softvol slave { pcm "hw:CARD=sc7180adau7002m,DEV=0" } control { name "Boost Capture Volume" card 0 device 0 } max_dB 40.0 min_dB -10.0 } ```
Updated with a workaround for some issues with touchpad mouse / lidswitch on XFCE/Xorg...
@pulak1901 I have yet to implement your sound fixes but I did want to say how much I appreciate your input on the matter, as soon as I can I'll let you know how it goes :) Thank you for sharing!
homestar
below:Now I just gotta figure out those pesky little cameras, if at all possible. I have some ideas involving Waydroid. It may be possible to utilize the camera blobs from CROS's android implementation. This would likely isolate cameras to Waydroids container but it would still be awesome.
@hexdump0815 I just wanted to take one more moment to say how much I truly appreciate this project! I have a one of a kind device in large part to you and everyone that has contributed. On top of it all I have learned LOADS!!! Thanks again my friend. :)
@Geofferey - thanks a lot for your nice and positive feedback - i'm very happy to hear that as this was and is my intention with this project: to make it easier to get started with linux on some usually not so well supported platforms, to maybe encourage people to try to improve some of the still missing details around those images and to maybe build a little community across the github issues which brings the whole thing a bit forward in small steps at the benefit of others as well ... thanks once more
@Geofferey - oh and before i forget: thanks a lot for your contributions - writing things down as detailed as you did gives a very good starting point for others to use and/or extend the information
Since I finally got my hands on a usb hdmi adapter, here's a status update on my attempts to get it working with UCM out-of-the-box:
SectionDevice."HDMI".0 {
Comment "HDMI"
Value {
PlaybackPCM "hw:${CardId},2"
JackControl "HDMI Jack"
}
}
Note: you can get the jack kcontrol name with amixer -c 0 contents
With this it is working, but only if pulseaudio is able to open the PCM stream. i.e. the HDMI is plugged in while restarting the device (or pulseaudio). If HDMI is not plugged in, pulseaudio will fail to create a card profile with output similar to
``` I: [pulseaudio] module-udev-detect.c: Card /devices/platform/sound/sound/card0 (alsa_card.platform-sound) failed to load module. D: [pulseaudio] module-udev-detect.c: /dev/snd/controlC0 is accessible: yes D: [pulseaudio] module-udev-detect.c: /devices/platform/sound/sound/card0 is busy: no D: [pulseaudio] module-udev-detect.c: Loading module-alsa-card with arguments 'device_id="0" name="platform-sound" card_name="alsa_card.platform-sound" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"' D: [pulseaudio] reserve-wrap.c: Successfully acquired reservation lock on device 'Audio0' I: [pulseaudio] alsa-ucm.c: UCM available for card hw:0 D: [pulseaudio] alsa-ucm.c: UCM _alibpref=_ucm0005. I: [pulseaudio] alsa-ucm.c: Set UCM verb to HiFi D: [pulseaudio] alsa-ucm.c: Got CapturePCM for device Mic: _ucm0005.hw:sc7180adau7002m,0 D: [pulseaudio] alsa-ucm.c: Got PlaybackCTL for device Mic: _ucm0005.hw:sc7180adau7002m D: [pulseaudio] alsa-ucm.c: Got CaptureCTL for device Mic: _ucm0005.hw:sc7180adau7002m D: [pulseaudio] alsa-ucm.c: Got CapturePriority for device Mic: 100 I: [pulseaudio] alsa-ucm.c: UCM file does not specify 'CaptureChannels' for device Mic, assuming stereo. D: [pulseaudio] alsa-ucm.c: No _conflictingdevs for device Mic D: [pulseaudio] alsa-ucm.c: No _supporteddevs for device Mic D: [pulseaudio] alsa-ucm.c: Got PlaybackPCM for device Speaker: _ucm0005.hw:sc7180adau7002m,1 D: [pulseaudio] alsa-ucm.c: Got PlaybackCTL for device Speaker: _ucm0005.hw:sc7180adau7002m D: [pulseaudio] alsa-ucm.c: Got PlaybackPriority for device Speaker: 100 D: [pulseaudio] alsa-ucm.c: Got PlaybackRate for device Speaker: 48000 D: [pulseaudio] alsa-ucm.c: Got PlaybackChannels for device Speaker: 2 D: [pulseaudio] alsa-ucm.c: Got CaptureCTL for device Speaker: _ucm0005.hw:sc7180adau7002m D: [pulseaudio] alsa-ucm.c: UCM playback device Speaker rate 48000 D: [pulseaudio] alsa-ucm.c: No _conflictingdevs for device Speaker D: [pulseaudio] alsa-ucm.c: No _supporteddevs for device Speaker D: [pulseaudio] alsa-ucm.c: Got PlaybackPCM for device HDMI: _ucm0005.hw:sc7180adau7002m,2 D: [pulseaudio] alsa-ucm.c: Got PlaybackCTL for device HDMI: _ucm0005.hw:sc7180adau7002m D: [pulseaudio] alsa-ucm.c: Got CaptureCTL for device HDMI: _ucm0005.hw:sc7180adau7002m D: [pulseaudio] alsa-ucm.c: Got JackControl for device HDMI: HDMI Jack I: [pulseaudio] alsa-ucm.c: UCM file does not specify 'PlaybackChannels' for device HDMI, assuming stereo. D: [pulseaudio] alsa-ucm.c: No _conflictingdevs for device HDMI D: [pulseaudio] alsa-ucm.c: No _supporteddevs for device HDMI I: [pulseaudio] module-alsa-card.c: Found UCM profiles D: [pulseaudio] alsa-ucm.c: UCM mapping: HiFi: hw:sc7180adau7002m,0: source dev Mic D: [pulseaudio] alsa-ucm.c: UCM mapping: HiFi: hw:sc7180adau7002m,1: sink dev Speaker D: [pulseaudio] alsa-ucm.c: UCM mapping: HiFi: hw:sc7180adau7002m,2: sink dev HDMI D: [pulseaudio] alsa-mixer.c: Profile HiFi (Default), input=(null), output=(null) priority=8000, supported=yes n_input_mappings=1, n_output_mappings=2 D: [pulseaudio] alsa-mixer.c: Input HiFi: hw:sc7180adau7002m,0: source D: [pulseaudio] alsa-mixer.c: Output HiFi: hw:sc7180adau7002m,1: sink D: [pulseaudio] alsa-mixer.c: Output HiFi: hw:sc7180adau7002m,2: sink I: [pulseaudio] alsa-ucm.c: Set ucm verb to HiFi D: [pulseaudio] alsa-util.c: Trying _ucm0005.hw:sc7180adau7002m,1 with SND_PCM_NO_AUTO_FORMAT ... D: [pulseaudio] alsa-util.c: Managed to open _ucm0005.hw:sc7180adau7002m,1 D: [pulseaudio] alsa-util.c: Maximum hw buffer size is 256 ms D: [pulseaudio] alsa-util.c: Set buffer size first (to 4797 samples), period size second (to 1199 samples). I: [pulseaudio] alsa-util.c: Device hw:sc7180adau7002m,1 doesn't support 44100 Hz, changed to 48000 Hz. D: [pulseaudio] alsa-util.c: Trying _ucm0005.hw:sc7180adau7002m,2 with SND_PCM_NO_AUTO_FORMAT ... D: [pulseaudio] alsa-util.c: Managed to open _ucm0005.hw:sc7180adau7002m,2 D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Signed 16 bit Little Endian) failed: Invalid argument D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Signed 16 bit Big Endian) failed: Invalid argument D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Float 32 bit Little Endian) failed: Invalid argument D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Float 32 bit Big Endian) failed: Invalid argument D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Signed 32 bit Little Endian) failed: Invalid argument D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Signed 32 bit Big Endian) failed: Invalid argument D: [pulseaudio] alsa-util.c: Maximum hw buffer size is 128 ms I: [pulseaudio] (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed (-22) I: [pulseaudio] (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed (-22) I: [pulseaudio] (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed (-22) I: [pulseaudio] (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed (-22) D: [pulseaudio] alsa-util.c: Set neither period nor buffer size. I: [pulseaudio] (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed (-22) I: [pulseaudio] alsa-util.c: snd_pcm_hw_params failed: Invalid argument D: [pulseaudio] alsa-util.c: Trying _ucm0005.hw:sc7180adau7002m,2 without SND_PCM_NO_AUTO_FORMAT ... D: [pulseaudio] alsa-util.c: Managed to open _ucm0005.hw:sc7180adau7002m,2 D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Signed 16 bit Little Endian) failed: Invalid argument D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Signed 16 bit Big Endian) failed: Invalid argument D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Float 32 bit Little Endian) failed: Invalid argument D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Float 32 bit Big Endian) failed: Invalid argument D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Signed 32 bit Little Endian) failed: Invalid argument D: [pulseaudio] alsa-util.c: snd_pcm_hw_params_set_format(Signed 32 bit Big Endian) failed: Invalid argument D: [pulseaudio] alsa-util.c: Maximum hw buffer size is 128 ms I: [pulseaudio] (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed (-22) I: [pulseaudio] (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed (-22) I: [pulseaudio] (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed (-22) I: [pulseaudio] (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed (-22) D: [pulseaudio] alsa-util.c: Set neither period nor buffer size. I: [pulseaudio] (alsa-lib)pcm_hw.c: SNDRV_PCM_IOCTL_HW_PARAMS failed (-22) I: [pulseaudio] alsa-util.c: snd_pcm_hw_params failed: Invalid argument D: [pulseaudio] alsa-util.c: Trying plug:SLAVE='_ucm0005.hw:sc7180adau7002m,2' with SND_PCM_NO_AUTO_FORMAT ... I: [pulseaudio] (alsa-lib)pcm.c: Unknown PCM _ucm0005.hw:sc7180adau7002m,2 I: [pulseaudio] alsa-util.c: Error opening PCM device plug:SLAVE='_ucm0005.hw:sc7180adau7002m,2': No such file or directory D: [pulseaudio] alsa-mixer.c: Profile set 0xaaaad8f23f90, auto_profiles=no, probed=yes, n_mappings=0, n_profiles=0, n_decibel_fixes=0 E: [pulseaudio] module-alsa-card.c: Failed to find a working profile. E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="0" name="platform-sound" card_name="alsa_card.platform-sound" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed. I: [pulseaudio] module-udev-detect.c: Card /devices/platform/sound/sound/card0 (alsa_card.platform-sound) failed to load module. ```
@Geofferey from what I can see of sc7180-rt5682-max98357a ucm config, most of the changes you detailed are present in the config.
Speaker is already set to hw:X,1, mic to hw:X,2 which the same as
## Loading sink module for speakers with default sc7180-trogdor.dtsi, uneeded if dtsi is patched
load-module module-alsa-sink device=plughw:sc7180rt5682max,1
## If kernel is patched to re-order speakers as first device, comment above, uncommment below and set to 1 to enable mic
load-module module-alsa-source device=plughw:sc7180rt5682max,0
Similarly,
cset "name='IF1 01 ADC Swap Mux' 0"
cset "name='Stereo1 ADC L2 Mux' 1"
cset "name='Stereo1 ADC R2 Mux' 1"
cset "name='Stereo1 ADC MIXL ADC2 Switch' 0"
cset "name='Stereo1 ADC MIXL ADC2 Switch' 1"
cset "name='Stereo1 ADC MIXR ADC2 Switch' 0"
cset "name='Stereo1 ADC MIXR ADC2 Switch' 1"
is already present in init and Hifi configurations. the init conf is setting all the 0s, the Hifi conf has all the 1s under EnableSequence. If you want to manually trigger the Enable/DisableSequence sections, alsactl can do it with _enadev and _disadev
I'd suggest starting with a fresh usb stick, check the output of arecord -L & aplay -L (make sure hwX:0 is mic, hwX:1 is speakers), check pacmd list-cards (if dummy output, ucm is bad), and then try commenting out everything other than Speaker and Mic sections in the existing config.
Ideally, you would want it to work without any asound config, dtsi patching, and also without any modifications to pulseaudio config. UCM alone should be able to handle this and that way it'll be ready for pipewire too :)
On another note @Geofferey @hexdump0815. With 230922-01, here's what i can tell about the Partial/Broken issues mentioned at the beginning of this issue
That leaves:
I think we've already reached pretty much complete usability out-of-the-box if we finalize and add the quirks and ucm configurations to the base image :D
@pulak1901 - thanks a lot for the updates ... i'm very open to include any such improvements into the next round of images which i plan to roll in the next months based on a v6.6 lts kernel - lets see if they can be polished in a way so that we can ship them via files in extra-files or additions to postinstall* or rc-local-additions ... we should keep in mind that the image is shared among all trogdor devices, so they should not break the other devices and the changes should be as generic as possible (i.e. not only focussed on gnome, kde etc.) but its also fine if they just help on any of those use-cases (lets say working in gnome and kde, but not making sense in xfce) as long as they do not break the other use-cases ... the goodix touchscreen support is already in the kernel part - https://github.com/hexdump0815/linux-mainline-and-mali-generic-stable-kernel/commit/910e937a30af0d7a115f233f550769d139ec4800
@hexdump0815 i'll send prs to ship the improvements in extra-files most likely, i just haven't gotten around to playing with imagebuilder itself. Will definitely test out a combination of DEs & Xorg/Wayland/Pipewire/Pulseaudio during that time. I think most of the changes are in libinput and alsa ucm, so it should work with xorg as long as it is using the libinput drivers, and since pipewire-pulse should be the same as pulseaudio, i think that will be fine as well
@pulak1901 You're on coachz
, correct? I tried exactly what you detailed with unmodified kernel and it caused more issues + sound card names differ. For homestar
the best solution I've found is what I've detailed. Microphone gain is not a problem either EVERYTHING just works with the pulse config and bare minimum UCM to initialize mic. I believe there is some conflict due to dtb(s). I can get away with adding full microphone configuration in UCM but once I add speakers it all breaks. Also if playing with alsamixer I suggest using F5 to view all card mixer settings at once. Some of the settings that should be under capture etc are under playback... Maybe you will find the gain there?
@hexdump0815 I have some important info regarding 6.1.51
I immediately noticed that Xorg had extremely high cpu usage 40~60%
on the performance cores at idle with nothing moving on screen. I investigated Xorg logs and it complained about missing vgem... To enable that add DRM_VGEM
to kernel config. I also found some items that shouldn't be enabled for sake of performance but I'll update later once I've confirmed. For sure I remember KVM guest support isn't what one would think and is actually for running the kernel as a guest, a highly unlikely scenario, I believe. IIRC there comes a performance impact and it is noticeable. BTW I'm super late on testing the newer kernel because I refuse to upgrade unless it offers something, that something I was looking for was the hw video decoding/encoding ;)
Regarding 6.1.51
... H/W video decoding works somewhat with venus
, v4l2m2m2
and ffmpeg
so that's a plus. I recently found out what chrome considers H/W video acceleration is actually being done with GL shaders which isn't best. Sadly the v4l2 api isn't immediately available to chromium or firefox. There appears to be a shim out there that can translate v4l2 to vaapi but I had no luck getting it to compile, it look(ed)(s) promising. In case it's of interest here's a link libva-v4l2-request. It's a bit old but I know Fedora has pacakges/patches for it.
@Geofferey yep, coachz here.
Strange that it does not like the ucm2/Qualcomm/sc7180/rt5682-max98357a
setup. Can you run aplay -l
and check the full name of the sound card?
Regarding gain for coachz, the card itself doesn't report any controls at all. If I run amixer -c 0 contents
I can see 5 controls, but I believe those are all related to HDMI output, not the internal mic/speaker
And regarding firefox and v4l2 decode, I think it was merged in 116, Debian 12 has esr 115
@Geofferey - thanks for the hint about DRM_VGEM, i'll have a look at it as soon as i find some more time ... if you have any kernel config options which we should consider dropping, please let me know - i'm open for it as long as they are of no real use in the context of those image ... i think of remembering that libva-v4l2-request is not really working anymore without a lot of patches on top of a lot of software, but i might be wrong - i think people have other snapdragon/venus setups working with video decoding (h264 only i think, so h64ify might be required) and newer firefox versions (116+ might be correct)
@pulak1901 Below is some output of aplay -l
and arecord -l
for homestar
on unmodified 6.6.16
:
EDIT: FOR NOW EXCUSE ME I HAVE TO LEAVE UNFINISHED... WILL BE BACK...EDITS WILL COME
I don't know if you've seen the trashy kernel .patch
I made but it flips the devices 0
for 1
. With that, speakers just work without need for pulseaudio config or UCM... Thats for both devices afaik...
@Geofferey this is quite strange that it has the same card setup but behaves differently
The existing ucm2/Qualcomm/sc7180/rt5682-max98357a
was based on the trogdor-lazor
Strongbad/Homestar ChromeOS UCM
$ diff HiFi-lazor.conf HiFi-homestar.conf
45d44
< DependentPCM "hw:sc7180rt5682max,1"
66c65
< IntrinsicSensitivity "-3360"
---
> IntrinsicSensitivity "-2900"
So for Lazor the Headphone device is dependent on the Speaker PCM(I think it's the same as ConflictingDevice) and the mic sensitivity is different, but I'm not sure why Homestar behaves so differently.
Hi, I have a coachz (HP x2 11 without LTE).
I tried building 5.17.19, 6.6.9 using the guide in the repo, and I also tried the prebuilt 6.1.1-sbt-cbq image from https://github.com/hexdump0815/linux-mainline-and-mali-generic-stable-kernel.
Here's my findings:
I'm not able to get WiFi to work at all in any of these.
I was able to get touch working in 6.6.9, but not in the others.
In 6.6.9, I had some issue with gdm frequently crashing when trying to load gnome, and after I tried installing one of vulkan-freedreno or xf86-video-freedreno, gdm completely stopped loading.
I also tried compiling 6.7.10 using the .config file for 6.6.9 (https://github.com/hexdump0815/linux-mainline-and-mali-generic-stable-kernel/blob/master/config.exy-6.6.9-stb-exy%2B), but didn't boot (screen was black with nothing shown)
I couldn't see any trace of a wifi hardware in lsusb, lshw and dmesg. In x86, lshw used to show me "UNCLAIMED" devices. Is there any way to see a list of devices for which drivers are not loaded?
@itsfarseen - wifi should work and for others with an x2 it also worked as described above - can you please post your dmesg to some pastebin and link it here? maybe that would give a hint about where the problem is.
@hexdump0815 > pulak1901 - thanks a lot for the report - which kernel config options exactly did you have to enable to get it working? i would like to add them for future kernels then. Any progress on this?
I am using 230922-01 Bookworm on Homestar and it seems really good (thanks for your work). Wifi works. I installed Gnome which works. The speakers work after using pulakctl's workaround and fiddling with Pulseaudio. Only catch (and its a big one) is that there is no touchscreen input at all. I really need touch to work, so I am wondering if there is a new image with the kernel option set, or if there is a way to recover the touch on my current install.
I am happy to contribute an installation how-to for Homestar once I reach a working state :)
@itsfarseen is this on jammy or bookworm?
I also tried compiling 6.7.10 using the .config file for 6.6.9 (https://github.com/hexdump0815/linux-mainline-and-mali-generic-stable-kernel/blob/master/config.exy-6.6.9-stb-exy%2B), but didn't boot (screen was black with nothing shown)
Also the HP X2 would be using the cbq kernels, not the exy kernel
@cabbageman8 only a fresh kernel with that kconfig option enabled should do the job.
If you're comfortable doing the kernel builds, you can follow these steps with one of the cbq configs in that repo (instead of using the scripts/kconfig/merge_config.sh step)
Edit: before building the kernel with the provided cmdline and flashing it, have a read through the docs here and here to make sure you don't end up with an unbootable kernel
@hexdump0815 It seems that recent trogdor ubuntu release has wifi issue(no wifi at all). I tried build image, same issue. After some investigation, I found that copy qrtr-* and rmtfs binaries/services from debian release and install https://ubuntu.pkgs.org/22.04/ubuntu-universe-arm64/libqrtr-glib0_1.2.2-1_arm64.deb.html fixed this issue. Hope you can fix this in next release. Thank you for your hard work :)
@cabbageman8 - i have just uploaded a newer kernel i built some weeks ago here: https://github.com/hexdump0815/linux-mainline-and-mali-generic-stable-kernel/releases/tag/6.6.23-stb-cbq%2B - see https://github.com/hexdump0815/imagebuilder/blob/main/doc/installing-a-newer-kernel.md about how to install it - this should include touch screen support - maybe give that one a try
@TingyiChen - thanks a lot for reporting this and sharing the fix - i'll note that down for future images
@hexdump0815 That worked a treat! (currently typing on Duet 5 Gnome on screen keyboard :smile: ). Keyboard detection for tablet mode is working in Gnome, and orientation sensor is now working.
@hexdump0815 quick question about the 6.6.23
does the stylus work after this patch? have anyone tested it yet?
i finally got my hands on homestar and already checked the 6.6.23 kelner does fix the touch screen
but i don't know if i should get myself a stylus or just use external graphic tablet (if stylus doesn't work) stylus aint that expensive but still don't want waste money on sth i can't use
Regarding the audio on coachz, I got some help from the PMOS people in IRC, and this UCM seemed to work. Credit to them (I still need to get around to filing a proper bug report with them so it's recorded properly):
/usr/share/alsa/ucm2/conf.d/SC7180/sc7180-adau7002-max98357a.conf
Syntax 4
SectionUseCase."HiFi" {
Comment "HiFi quality Music."
File "/Qualcomm/sc7180/adau7002-max98357a/HiFi.conf"
}
/usr/share/alsa/ucm2/Qualcomm/sc7180/adau7002-max98357a/HiFi.conf
SectionVerb {
Value {
TQ "HiFi"
}
}
SectionDevice."Speaker" {
Comment "Speaker"
Value {
PlaybackChannels 2
PlaybackPCM "hw:${CardId},1"
PlaybackPriority 100
PlaybackVolume "Speaker Playback Volume"
}
}
SectionDevice."Mic" {
Comment "Internal Microphone"
Value {
CaptureChannels 2
CapturePCM "hw:${CardId},0"
CapturePriority 100
}
}
@LukIsHere - can't say anything about the stylus as most of my devices have broken displays / no touchscreen as they are usually the cheapest to get used :)
@DanaGoyette - thanks a lot for the ucm info, i took a note of it and will try to test and integrate it whenever i find the time
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) • KVMPartial
• 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.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 changeDriver "libinput"
toDriver "evdev"
• FOR REFERENCE:
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 thesc7180-trogdor.dtsi
a quick modification to the file and rebuild of kernel will fix us right up.sc7180-trogdor.dtsi
Before:sc7180-trogdor.dtsi
After:☝️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 configurehw:0,0
automatically.• FOR REFERENCE (
coachz
)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.
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 mycurrent kernel configuration
. It has support for many of items mentioned above...... to be continued....