yashsingh1/xdaforums huggingface dataset:
[General Topics] wwortel:
Update:

Well, no luck so far. The bma180 kernel driver installs fine now but it leaves our I2C and ACPI device 'BOSC0200' alone.

Am contemplating to add the 250 chip to the driver that knows the 250E and to compile an alternative bmc150_accel_i2c driver.

The problem is that although bma180 could handle our accelerometer, it is not exporting that it would support BOSC0200 but rather BMA250.

The bmc150_accel_i2c driver looks for BOSC0200 but is not aware that it could be the BMA250 with Chip_ID 0x03.

Either of the drivers needs to be changed to handle this specific combination of something that calls itself BOSC0200 but is a BMA250.

However, the ACPI DSDT (Differentiated System Description Table)from BIOS lists: "BOSC0200" : CONFIG_BMC150_ACCEL_I2C CONFIG_IIO : drivers/iio/accel/bmc150-accel-i2c.c

So the way forward is to adapt that driver to the BMA250.
[General Topics] wwortel:
Before doing that I'll see whether udev can manually be set to let i2c-BOSC0200' actions be handled by the bma180 kernel module.
[General Topics] wwortel:
Looking into the source code of both drivers I noticed the bma180 driver is only fit for I2C via the SMBus. So it cannot see and read registers from our device.

So the only option remaining is to add the BMA250 to the bmc150_accel_i2c driver. That one checks for I2C bus compatibility and can read the device as it throws the chip_id error correctly.

Victory! The automatic rotation is working now. There are some warnings when the recompiled bmc_150_accel_xxx modules load but it now works and interacts properly with the 2in1screen routine.

Warnings:

bmc_150_accel_core: 'loading out-of-tree module taints kernel.' and 'module verification failed: signature and/or required key missing'

bmc_150_accel_i2c: 'mounting matrix not found: using identity...'

Have to read a bit more about how to compile in a way that Manjaro sees it as completely compatible and original but now the proof of concept exists.
[General Topics] wwortel:
setting Xorg display parameters

My Hi10 Air's display size was not being properly detected in 5.4.2.-1-Manjaro. It was being assumed much bigger than in reality and hence it was assuming a much lower dpi resolution than reality.

I measured the screen to be W: 216.4 and H: 135.4 mm. The pixel number is being detected correctly (1920x1200). This yields 226 dpi. The specs say 224 so I've added a millimeter.

Following resolved it.

in /etc/X11/xorg.conf.d make an entry e.g. called 90-lcd.conf with contents:

Section "Monitor"

Identifier "DSI1"

DisplaySize 218 136

Option "Rotate" "right"
​

EndSection

(the quotes need to be there! Typos will prevent the X server from starting and the screen will remain black; in case this happens reboot the tablet with a live OS version from an USB stick, mount the internal drive from live linux and restore the error)

xdpyinfo (from the package xorg-xdpyinfo) can be used to show what the X server is working with. Command:

xdpyinfo | grep -B2 resolution
[General Topics] wwortel:
Calibration of touchscreen Hi10 Air

After setting the display size and orientation to 224x224 dpi landscape it is useful to calibrate the touchscreen.

This proved somewhat more complicated than thought because

1. xinput_calibrator is of no use anymore as it does not work with libinput, and

2. it is easy to load the wrong Silead firmware. (Source: https://github.com/onitake/gsl-firmware)

To solve 1. the 'xcal' python3 script proved useful from here: https://github.com/reinderien/xcal

It requires packages 'python-numpy' and 'tk' to run. It calculates the matrix and can store it in a volatile way for experiment until a next boot.

Problem 2. proved more tricky as with a wrong firmware the touchpad does react but in my case was giving out useless X and Y values as one coordinate was not working.

A calibration programme then cannot solve the equations to come to a so called affine transformation that is used by libinput to define LCD screen coordinates from the coordinate values the Silead chip produces. Touchpanel and LCD are in physical contact but yet separate devices with their own coordinate system.

Figured that out by compilation of the 'evemu' package and using evemu-record to see the actual values given out by the silead_ts driver ( https://www.freedesktop.org/wiki/Evemu/ ).

Which is the proper firmware? Here the problem emerges that, while a tablet may be called Hi10 Air, hardware-wise it may be a Hi10 Pro with a different touchscreen.

My tablet, production 2019/08, from BIOS is actually called a Pro and then by systemd rebaptized to an Air. The mssl1680.fw that works here is the one published for the 'Hi10 Pro-z8350', called firmware.fw, size 42768 bytes, md5sum 0e9698a77c1e6b2a6c8af8b97b35afb6. Rename it mssl1680.fw

The transformation settings can be seen with the command 'xinput list-props silead_ts'

The matrix gets temporarily set in the 'libinput Calibration Matrix (325)' by xcal. For experiment it can also manually be set with the command 'xinput set-prop silead_ts 325 _matrix values_'.

The resulting entry in /etc/xorg.conf.d/91-calibrate_ts.conf to make it permanent over reboots:

Section "InputClass"

Identifier "calibration"

MatchProduct "silead_ts"

Option "TransformationMatrix" "2.1746 0 -0.0438 0 -3.2764 1.0048 0 0 1"​

EndSection

P.S.

work in progress: the automatic rotation as described in this thread works but the script does not set the lcd properties and touchpad transformation properly. See next post.
[General Topics] wwortel:
Touch screen calibration after automatic rotation

My Hi10 Air (201908xxxx) must via xandr be set to 'right' orientation to have proper landscape orientation. But 'xandr -o right' results in wrong resolution. The panel is 224 dpi, regardless its orientation. So after any rotation detection and xandr action 'xandr --dpi 224' must be issued; current 2in1screen does not do that..

After touchscreen calibration, in regular landscape mode, that matrix ends up in what is called Coordinate Transformation Matrix (170), as shown by the 'xinput list-props silead_ts' command.

It is put there from an InputClass section in xorg.conf.d

libinput makes yet another transformation using 'libinput Calibration Matrix (325)'. That is the one 2in1screen is writing into. But the scaling, offsets, and rotation are off target.

The orientation of the device is detected correctly.

Reference is xserver's 'right' orientation which is our landscape. So 'right' has to correspond to doing nothing in addition to our calibration, i.e. matrix 1 0 0 0 1 0 0 0 1. Because we correct all the time to get back to 224 dpi all transformations away from the landscape situation need to adapt for the different scalings and offsets. What works fine here:

'normal' 0 1.6 0 -0.625 0 0.3125 0 0 1 (this is the mode after rotating the device 90º cw from landscape)

'inverted' 0 -1.6 0.5 0.625 0 0 0 0 1 (this is after rotating 90º ccw from landscape)

'left' -1 0 0.5 0 -1 0.3125 0 0 1 (landscape upside down)

'right' 1 0 0 0 1 0 0 0 1 (landscape, do nothing additional to calibration)

The numbers stem from the 16:10 aspect ratio, maintaining 224 dpi.

The lines to be edited in 2in1screen.c:

sprintf(command, "xrandr -o %s ; xrandr --dpi 224", ROT[current_state]);

and

char *TOUCH[] = {"-1 0 0.5 0 -1 0.3125 0 0 1", "1 0 0 0 1 0 0 0 1", "0 1.6 0 -0.625 0 0.3125 0 0 1", "0 -1.6 0.5 0.625 0 0 0 0 1"};

With those adaptations the compiled result maintains proper font sizes in all orientations and the touchpanel works correctly.

Big thank you to Myself5 for his work! My new Chuwi Hi10 Air tablet/PC now runs Manjaro nicely and the stylus pen works properly.

The active area of my touchpanel reaches to almost the edge of the LCD screen area but for a few mm. Apparently they used one that is slighly smaller than the LCD.
[General Topics] fulguropoing:
Pen Input works?

Hi [MENTION=3066867]wwortel[/MENTION], I'd be interested in hearing more details about what you mean by `the stylus pen works properly`?

For example, how does it behave in xournalpp? or write? clean lines? zig-zags?drops?

My setup seems to be correctly configured when I use the fingers. Lines in xournalpp are clean and straight, but if I use the pen, I get zig-zags or holes in my input.

Also, does the pen always click even if you are hovering the pen a few millimeters away from the screen?

I'm using manjaro XFCE with kernel 5.4 and tried the different firmwares just in case, using xinput_calibration and xcal, with or without rotation applied. Also, `lshw` showed a Chuwi Hi10 Pro.

Thank you in advance!
[General Topics] Lookanio:
I confirm. It works for me as well :)
[General Topics] wwortel:
no audio with recent v5 kernel and alsa-lib package

just to save you time when there is no audio (anymore).

Problem: neither from headphone nor speaker any sound.

System: Chuwi Hi10 Air ( CWI529 ).

From 'dmidecode' :

bios C109D_X_T.301, Product Name: Hi10 pro tablet (!), board manufacturer: Morshow, Board name: Cherry Trail CR, version V100.

OS: Linux 5.4.6-2-MANJARO

dmesg and aplay -l/-L show installed audio system but dmesg shows many repetitions of this error message:

'Audio Port: ASoC: no backend DAIs enabled for Audio Port'

Cause: some bug in recent version of the alsa-lib package. After much experimentation without any result I found a temporary fix here: https://bbs.archlinux.org/viewtopic.php?id=251153

The problem appears to come from alsa-lib and reversing to an earlier version makes the sound come alive.

sudo pacman -U alsa-lib-1.1.9-2-x86_64.pkg.tar.xz --overwrite "*"

It switches fine and automatically between headphone, when plugged in, and speakers.
[General Topics] sungeunbae:
To get your touchscreen orientation fixed.

xinput set-prop "silead_ts" "Evdev Axes Swap" 1

xinput set-prop "siilead_ts" "Evdev Axis Inversion" 0 1

---------- Post added at 03:05 AM ---------- Previous post was at 03:02 AM ----------
[General Topics] DarkThanos:
Some info about multi booting Linux from the SD:

Let's assuming that you already have a Linux running and you want to add/test more Linux installations without removing the currently installed.

On boot (while on grub) the SD card is not accessible. To boot an other Linux from the SD card your grub must be able to access their boot files (/boot/initrd.img* and /boot/vmlinux*), thus you can either manually move them somewhere on the internal storage and then add a custom grub entry, or while on the installation, you can place only the BOOT partition on the internal storage (just 512MB of space is more than enough).

I got an 128GB SD card and I tested both methods. I was running Manjaro, I shrank the root partition of Manjaro (about 8GB as I was going to add a swap partition as well) using an Ubuntu live USB, and I installed Ubuntu on the SD card (I gave to it 64GB) but with the Boot partition on the internal storage. So, right now I have about 1GB space on the internal storage to add more boot partitions if I like, and another 64GB space left on the SD card.
[General Topics] bobdamnit:
I'm running Manjaro's latest. Everything works fine until I get to the part of checking xinput for my touchscreen. I get this:

So I did the following to update pacman's repo's and sync and install xorg-input:

But no matter what I do, I cannot get xorg-input to install at all. The package simply doesn't exist. Even after enabling AUR packages. However, using libinput, I was able to determine that my silead touchscreen is not being detected. Kernel is

I'm lost.
[General Topics] wwortel:
In xarch the package may be called 'xorg-xinput' not xorg-input as in your post.

Assuming it is present, verify that its path is searched as part of $PATH.
[General Topics] rocket2nfinity:
Newbie question - how do you go about adding the BMA250 to the bmc150_accel_i2c driver?

Another question- my acpi says I have two cameras gc2355. Not the OV camera. It is a newer model I believe of the Hi 10 Air on the cover but High10Pro in the system files and actually has a spot in boot options for Ubuntu and Android 1A.

I found this github.com/friendlyarm/h3_lichee/blob/master/linux-3.4/drivers/media/video/sunxi-vfe/device/gc2355.c On GitHub. Can this be used to activate the cameras with a 5.4 kennel?
[General Topics] wwortel:
your Q1:

it requires recompiling that driver and swapping the original .ko files for the modified ones.

you can download the modified files here:

dorpstraat.com/bmc150_sources_w_bma250.zip

Basically the BMA250 has been made known to the driver in various places where it detects the actual IC and makes specific settings.

Their folder in the kernel tree is <kernel>/drivers/iio/accel/

You'll probably have to force-load the new kernel modules as they will be detected as 'tainted' and not part of the original kernel build.

Make a file in /etc/modprobe.d ending in .conf and give it the lines

install bmc150_accel_core /sbin/modprobe -i -f bmc150_accel_core

install bmc150_accel_i2c /sbin/modprobe -i -f bmc150_accel_i2c

install bmc150_accel_spi /sbin/modprobe -i -f bmc150_accel_spi

your Q2:

My Hi10 Air has the same: 2 pcs gc2355.

The driver for that is the minor problem. Examples exist for look-alikes from GalaxyCore/TI and adaptation to the gc2355 is relatively easy.

A thing that deviates from the standard is that in our Hi10 the cameras receive their DC power from an external PowerManagementIC, the AXP288C, and not from the SoC's power management.

But patches are available to cope with that.

The major problem, or rather stumbling block, is the absence of a good driver for the 'ISP' Image Signal Processor in the z8350.

The cameras interface through MIPI/CSI2 to the SoC and the z8350 can actually do all sorts of fancy processing on the image data, like noise reduction, geometrical correction, color adaptation, zoom, etc.

Some years ago Intel changed policies about their SoC product portfolio and this z8000 Cherrytrail generation sort of never made it to complete Linux support. Up to kernel 4.19 a driver 'atomisp' was present in the staging phase but it was not really working well, if at all, and was poorly structured. Due to lack of support it was early 2018 removed from the Linux kernel as it is pointless to keep a heap of useless code.

Later Intel CPUs with an ISP on board got support again through the 'ipu3-cio2' driver (drivers/media/intel). But that version, nice and clean, is not hardware compatible with the z8350.
[General Topics] bobdamnit:
That worked, thanks. Unfortunately, it confirmed that the touchscreen just isn't being recognized at all. I've tried several steps, and at this point I had it working better (albeit with reversed x/y axis) on Ubuntu/Debian based operating systems. I'm not comfortable with Arch or its spinoffs. So I guess I'm going back to kUbuntu because it at least had working screen rotation out of the box. I'm sure I can fix the reversed axis, I just didn't feel like tinkering with it. Kind of wish I had now, because Arch/Manjaro while documented well, just isn't my cup of tea.
[General Topics] wwortel:
what does dmesg show about the silead driver. What do the lines look like that start with 'silead_ts' ?

If there are none your kernel probably has been compiled without that driver having been included or added as loadable module.
[General Topics] rocket2nfinity:
Thanks

Thanks. I'm kind of new at this and think I need it broken down Barney Style - I'm confused as to whether I can just use gcc to compile the four files you provided, or whether I need to download the whole kennel source? From what I've been reading, It seems I might need the whole source.

Could the camera/isp drivers be extracted from the Windows partition? I read about NDISwrapper that is used in these situations. It's a shame my other Hi10Air had an emmc failure, it had the OV cameras and all was working.
[General Topics] rocket2nfinity:
WiFi problem

I have a strange WiFi problem happening. I have an older wireless router the Hi10 Air successfully connects to. But it won't connect to my new wireless router. It sees the network, asks for my password over and over then quits. Any ideas what going on?
[General Topics] bobdamnit:
[ 6.726383] silead_ts i2c-MSSL1680:00: i2c-MSSL1680:00 supply vddio not found, using dummy regulator
[ 6.726488] silead_ts i2c-MSSL1680:00: i2c-MSSL1680:00 supply avdd not found, using dummy regulator
[ 6.726853] silead_ts i2c-MSSL1680:00: Silead chip ID: 0x80360808

Inside of /lib/firmware/silead I have mssl1680.fw only. I used both the instructions in the original post and the instructions posted on page 10 by [MENTION=3750714]DarkThanos[/MENTION] and none of has worked at all. Here's the output of xinput:

⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ HS-C109S-US-01-00- USB Keyboard Mouse id=13 [slave pointer (2)]
⎜ ↳ HS-C109S-US-01-00- USB Keyboard Consumer Control id=16 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Power Button id=8 [slave keyboard (3)]
↳ bytcr-rt5651 Headset id=9 [slave keyboard (3)]
↳ gpio-keys id=10 [slave keyboard (3)]
↳ gpio-keys id=11 [slave keyboard (3)]
↳ HS-C109S-US-01-00- USB Keyboard Wireless Radio Control id=12 [slave keyboard (3)]
↳ HS-C109S-US-01-00- USB Keyboard System Control id=14 [slave keyboard (3)]
↳ HS-C109S-US-01-00- USB Keyboard id=15 [slave keyboard (3)]
↳ HS-C109S-US-01-00- USB Keyboard Consumer Control id=17 [slave keyboard (3)]
[General Topics] wwortel:
Indeed the rest of the kernel needs to be present to be able to compile kernel modules. So you either make a custom kernel package following the guidlines of your distribution, or you compile using the same kernel version as installed and only swap the specific drivers, in which case it will be detected that they are not 'original' but can be force loaded..
[General Topics] wwortel:
The three silead_ts lines are exactly identical to those in my CW1529. But here I have two more lines (Debian buster Linux kernel 4.19):

silead_ts i2c-MSSL1680:00: i2c-MSSL1680:00 supply vddio not found, using dummy regulator

silead_ts i2c-MSSL1680:00: Linked as a consumer to regulator.0

silead_ts i2c-MSSL1680:00: i2c-MSSL1680:00 supply avdd not found, using dummy regulator

silead_ts i2c-MSSL1680:00: Silead chip ID: 0x80360808

silead_ts i2c-MSSL1680:00: firmware: direct-loading firmware silead/mssl1680.fw

So it would appear that the driver is not finding/loading what it is looking for.

Why the line Linked as a consumer etc. is missing I do not know.

You can find out what file name will be loaded in your kernel 5.4 in two steps:

1. using '/usr/sbin/dmidecode' find information on system vendor, board name, and 'SKU' (bios)

2. check in /drivers/platform/x86/touchscreen_dmi.c , in struct dmi_system_id touchscreen_dmi_table[],

whether your particular combination of data is known as a device. If not, just define an additional one and add a properties list for your particular Air10.

It appears that there is quite a variety of Air10 devices in the market with varying hardware on board.

In those lists one of the entries is the firmware name and without the complete system having been recognized the driver will be clueless as to what to load as firmware.

As your Silead IC is exactly mine the firmware that works is likely to be the same as here with md5sum 0e9698a77c1e6b2a6c8af8b97b35afb6 and size 42768 bytes

success!
[General Topics] bobdamnit:
I appreciate the help, [MENTION=3066867]wwortel[/MENTION], but that's just entirely too much work for a touchscreen. I don't like Manjaro, so I'm going back to kUbuntu. I can at least get the screen functional albeit with reversed X/Y axis.
[General Topics] wwortel:
Once the driver is reacting and provided with the proper firmware you can calibrate the touchscreen. It's a matter of adding a few .conf files in /etc/X11/xorg.conf.d/

What works here and might work in yours as we have the same Silead IC and Ubuntu is related to Debian:

90-LCD.conf (sets proper resolution and landscape orientation)

Section "Monitor"

Identifier "DSI-1"

DisplaySize 218 136

Option "Rotate" "right"

EndSection

and

91-calibrate-touchscreen.conf (makes the cursor track the touch point;

here the touchscreen does not extend to the full LCD size but lacks a few mm around the perimeter.)

Section "InputClass"

Identifier "calibration"

MatchProduct "silead_ts"

Option "TransformationMatrix" "2.1746 0 -0.0438 0 -3.2764 1.0048 0 0 1"

EndSection
[General Topics] bobdamnit:
I had saw that on the Mint forums for someone else using a Hi10 Pro, but was unsure whether or not that was applicable to Ubuntu or the Hi10 Air. Thanks for confirming that it might indeed work. As for the few mm on the edges of the screen, that is exactly how the screen operates in Windows 10 so it is normal behavior.

Edit: I may end up just using Debian Buster. My Hi10 Air seems to be fairly close to yours and you have it working fairly fine. I don't require Bluetooth. Just Wifi, touchscreen, auto-rotation, and hibernation. If you're more comfortable using Debian and can help me get that going, I'm fairly comfortable with Debian as well. (I run it on my Rock64 and Pi3.)

---------- Post added at 02:53 PM ---------- Previous post was at 02:21 PM ----------

Where is "here"? If this one:

https://github.com/onitake/gsl-firmware/blob/master/firmware/linux/silead/gsl1680-chuwi-hi10-air.fw

that's what I've been loading.

However I've also been contemplating gitcloning the whole gslx680-acpi and gsl-firmware git's and then doing the following to copy it into /lib/firmware, install dkms and kernel headers, make the module, and modprobe it:

sudo cp ~/src/gsl-firmware/firmware/chuwi/hi10_air/* /lib/firmware
apt install -y dkms
cd ~/src/gslx680-acpi
make
make install
modprobe gslx680_ts_acpi

Edit/Update 2: Doing the above actually gets the touchscreen properly loaded in kubuntu with a name other than "silead_ts". The problem then becomes that random touches are detected even though I'm not touching the screen. For example, I'll be working in konsole with Firefox behind it and suddenly Firefox is the focus and it scrolled half way down the page because the touchscreen "touched" the right side of the screen on the scroll bar. Likewise, the X/Y axis were completely swapped, so touching the lower left portion of the screen would actually be the upper right. Also, using the above 90-LCD.conf by [MENTION=3066867]wwortel[/MENTION] did indeed set the login screen to the correct orientation, however it also had the effect of making the text about a thousand percent larger. As a result, all I could see on the login screen was the box to input your password. Once logged in, text everywhere but the menubar at the bottom was also this way, making it unusable. I was unable to read the kde menu because opening it took the entire screen and stretched the text so badly it was unreadable. I've given up and am reinstalling.

Edit/Update 3: Ok, I've read this whole entire thread while tinkering and waiting. I'm not sure how in the heck I missed this post by user wwortel:

Because I think this is exactly my problem in all of the versions of Linux I've tried. The bolded parts are specific to my situation and are exactly what I am experiencing. The large red text is exactly what needs to be loaded.

Edit/Update 4: So loading that firmware renamed to mssl1680.fw did not work for me. It does not show in xinput and only shows the same 3 lines in dmesg. At this point, I'm giving up and going back to Windows 10. I hate the laptop insanely badly right now and at least Windows 10 does what I need it to do, albeit slowly.
[General Topics] wwortel:
Bluetooth works fine under Debian.

Install packages

'bluetooth' 'bluez' 'blueman'

for control and

'firmware-realtek'

for the firmware needed by the RT wifi/BT combi chip.

The font size issue I also noticed but only after first, without the resolution setting, having increased all font settings in the desktop drivers because everything was so tiny.

A fresh install plus xorg resolution setting to the 240 dpi makes everything start with already reasonable font and icon sizes.