Fishwaldo / meta-pine64

Yocto Images for Star64 and PineTabV Boards from pine64
https://pine64.my-ho.st:8443/
MIT License
43 stars 7 forks source link

PineTab-V Image issues #12

Open Fishwaldo opened 1 year ago

Fishwaldo commented 1 year ago

Known Issues with the PTV image currently:

Techwizz-somboo commented 1 year ago

I'm assuming this falls under "Trackpad on the PTV is 'funky'" but for me left click doesn't work at all, other than that it isn't bad.

Fishwaldo commented 1 year ago

Yeah correct. I have been suggested a fix and will push a new image with some updates later today or tomorrow.

Fishwaldo commented 1 year ago
Fishwaldo commented 1 year ago

new images pushed with a few other fixes. right now, i'm working on the Charger...

Wulsi commented 1 year ago
  • Touchpad is better, but still has a big of "lag" do it.
  • LCD Backlight works, but there is a bug with the Starfive PWM driver, so we can't actually turn off the backlight (setting backlight to 0 actually turns the BL on full)

Don't disabled pwm or change pwm driver,then the BL will off. When the gpio45 pin is low level,you must first turn it on with a high level,and then use pwm to control the brightness.

`static void pwm_backlight_power_off(struct pwm_bl_data *pb) { struct pwm_state state;

pwm_get_state(pb->pwm, &state);
if (!pb->enabled)
    return;

if (pb->enable_gpio)
    gpiod_set_value_cansleep(pb->enable_gpio, 0);

if (pb->pwm_off_delay)
    msleep(pb->pwm_off_delay);

// state.enabled = false;
state.duty_cycle = 0;
pwm_apply_state(pb->pwm, &state);

regulator_disable(pb->power_supply);
pb->enabled = false;

}`

sxa commented 1 year ago

Just tried the 04082023 image and I'm seemingly getting a crash a few seconds after the login screen is displayed - anyone else had that? Is it related to Kernel Ooops when booting - Setting Orientation? I've tried starting the tablet up in both orientations but it happens regardless (The splash screen is always portrait, the login screen is always displayed in landscape until it disappears)

Fishwaldo commented 1 year ago

Do you have uart board connected? You should get some logs there on what's going wrong.

Fishwaldo commented 1 year ago

Btw, There is no accelerometer on the PinetabV, so auto rotation won't work.

sxa commented 1 year ago

Do you have uart board connected? You should get some logs there on what's going wrong.

Not yet but it's on my list to get one connected to it :-) Just wanted to confirm that it's not a common known issue first and it sounds like it isn't so far.

And great work on getting it this far!

Fishwaldo commented 1 year ago

If the battery is empty, the PtV will shutdown after the login screen appears. Let it charge for a while and try again. (Will fix that eventually)

sxa commented 1 year ago

If the battery is empty, the PtV will shutdown after the login screen appears. Let it charge for a while and try again. (Will fix that eventually)

Yep that is it - I thought it was near fully charged but I guess not :-) Now I've got to figure out what I've done with my UART adapter since I seem to have misplaced it ...

Fishwaldo commented 1 year ago
  • Touchpad is better, but still has a big of "lag" do it.
  • LCD Backlight works, but there is a bug with the Starfive PWM driver, so we can't actually turn off the backlight (setting backlight to 0 actually turns the BL on full)

Don't disabled pwm or change pwm driver,then the BL will off. When the gpio45 pin is low level,you must first turn it on with a high level,and then use pwm to control the brightness.

`static void pwm_backlight_power_off(struct pwm_bl_data *pb) { struct pwm_state state;

pwm_get_state(pb->pwm, &state);
if (!pb->enabled)
  return;

if (pb->enable_gpio)
  gpiod_set_value_cansleep(pb->enable_gpio, 0);

if (pb->pwm_off_delay)
  msleep(pb->pwm_off_delay);

// state.enabled = false;
state.duty_cycle = 0;
pwm_apply_state(pb->pwm, &state);

regulator_disable(pb->power_supply);
pb->enabled = false;

}`

This does not work. Assigning the BL pin to the enable function just runs pulls the PWM output to 100% and thus its either on/off. What should happen is when the PWM duty cycle goes to 0, the pin stays at logic 0, but for some reason, at duty cycle 0, the pin goes logic 1 and thus drives at full strength.

Its either a error in the PWM driver, or the actual peripheral.

Fishwaldo commented 1 year ago

New Image just pushed that:

Wulsi commented 1 year ago
  • Touchpad is better, but still has a big of "lag" do it.
  • LCD Backlight works, but there is a bug with the Starfive PWM driver, so we can't actually turn off the backlight (setting backlight to 0 actually turns the BL on full)

Don't disabled pwm or change pwm driver,then the BL will off. When the gpio45 pin is low level,you must first turn it on with a high level,and then use pwm to control the brightness. `static void pwm_backlight_power_off(struct pwm_bl_data *pb) { struct pwm_state state;

pwm_get_state(pb->pwm, &state);
if (!pb->enabled)
    return;

if (pb->enable_gpio)
    gpiod_set_value_cansleep(pb->enable_gpio, 0);

if (pb->pwm_off_delay)
    msleep(pb->pwm_off_delay);

// state.enabled = false;
state.duty_cycle = 0;
pwm_apply_state(pb->pwm, &state);

regulator_disable(pb->power_supply);
pb->enabled = false;

}`

This does not work. Assigning the BL pin to the enable function just runs pulls the PWM output to 100% and thus its either on/off. What should happen is when the PWM duty cycle goes to 0, the pin stays at logic 0, but for some reason, at duty cycle 0, the pin goes logic 1 and thus drives at full strength.

Its either a error in the PWM driver, or the actual peripheral.

As long as the pwm is not disabled, the pin will not being logic 1,you can set duty cycle 0,then backlight off. When the duty cycle is set from 0 to other values, you must first set the duty cycle to 100% to make U5200 conduction, and then you can set the duty cycle at will。

Fishwaldo commented 1 year ago

As long as the pwm is not disabled, the pin will not being logic 1,you can set duty cycle 0,then backlight off. When the duty cycle is set from 0 to other values, you must first set the duty cycle to 100% to make U5200 conduction, and then you can set the duty cycle at will。

Thats not what is happening. At Duty Cycle 0, the pin is going high, and thus pulling up the EN pin on TCS5201, thus driving the BL at full power. I've confirmed this on a Star64 with a standard GPIO connected to PWM as well (so I could rule out any problems with the BL circuit)

As a workaround i set the PD register on the GPIO. Not sure if thats intended but it seems very counter-intuitive to set PU/PD registers on a PWM pin.

prushik commented 1 year ago

Uses a mainline driver for the charger IC rather than the vendor patched version shipped in the factory kernel. Charging is now much better, faster and more accurate (you can get a almost full charge now - Some more tweaks might be required). Battery Percent should be more accurate, but still needs confirmation

I think there is still something wrong with charging or accuracy. I let mine sit on a USB-PD charger overnight and in the morning the battery percentage was 56%. With the previous version it would have been around 71%.

Other than this, everything about 20230814 image is a major improvement.

Also, I am unfamiliar with Yocto, but I searched through this repo and I can't seem to figure out where the kernel source tree comes from or where your patches are stored and applied. Is this accessible somewhere?

Fishwaldo commented 1 year ago

I've used some pretty conservative values right now for charging as we don't have a official data sheet on the battery.

For slow "offline" charging you can improve by: 1) plugging in the PD charger while the PtV is turned on. The driver will increase the current limit for charging. Once plugged in, you can shutdown the PTV, and the charger will retain the current limit setting. 2) alternatively (but almost the same) - boot up the PtV once plugging in, so the driver can update.

I hope we can fix the offline charging, but only after I'm sure we are not going to burn down PtV's haha.

The patches (which apply on top of the Star64_linux repo) are here: https://github.com/Fishwaldo/meta-riscv/tree/ptv/recipes-kernel/linux/linux-starfive (I'll be pushing to the actual kernel repo soonish)

Fishwaldo commented 1 year ago

By the way, you can cat /sys/class/power/*/uevent to see the progress of charging. The previous driver was limiting charging to 500mA and a low voltage, and could never get a full charge. The new driver pushes upto 2A and can get 100% charge.

mbohun commented 1 year ago

Just tried the 04082023 image and I'm seemingly getting a crash a few seconds after the login screen is displayed - anyone else had that? Is it related to Kernel Ooops when booting - Setting Orientation? I've tried starting the tablet up in both orientations but it happens regardless (The splash screen is always portrait, the login screen is always displayed in landscape until it disappears)

@sxa yes, i had a similar experience 2 days ago, but it looks/feels like it was caused by me being impatient :-) when the plasma/SDDM login screen appears - there is like a 1-2min delay until one can actually enter username and password to login. So i think the first 2-3 times i was too impatient, started clicking my external mouse, and clicking the keys on my external keyboard - and i ended up with crashing the plasma/SDDM; although i could still switch to the console, and reboot from there. However if I just boot, and wait, i am able to login without any problems.

PLUS i had some issues (i have to double-check this) when i tried to boot with the UART adapter (in the bottom USB-C port) and some USB device (keyboard, mouse, USB dock) plugged into the upper USB-C port, it would boot UART adapter working fine, i was observing the boot process over minicom from my PineBookPro, but the USB device plugged into the upper USB-C port was not responding - i have to double-check that as i said, because again that could be related to that slow startup / delay.

So the last time i started my PineTab-V, it was connected as follows: IMG_20230817_152607

Only after the start and login, i reconnected the UART adapter: IMG_20230817_160026

The red USB-C cable, those are 2 separate USB-C cables:

I am using (have to - at the moment) an external monitor, because my PineTab-V display or the cable connecting the display to the motherboard is broken, and needs to be fixed. IMG_20230817_152852

mbohun commented 1 year ago

@sxa UPDATE: I double-checked, and I can have the UART adapter AND my USB-C dock connected BOTH at the time of the boot, and it works as expected. HOWEVER my PineTab-V "crashed" rebooted itself (overnight) after running OK for apx. 48 hours. I returned to my home office this morning and found the PineTab-V restarted.

xudianhua commented 1 year ago

@Fishwaldo would you tell me how to change system time? image

xudianhua commented 1 year ago

@Fishwaldo we has found the ways to configure the system time. thanks.

tinspin commented 9 months ago

Most applications do not draw bitmap content making them unusable?

Try launching GIMP f.ex.

Another thing they have in common is that the mouse pointer disappears.

Edit: Switching to X11 kinda works, but then the mouse pointer does not show on the desktop GUI, colors are wrong and the performance is much worse (X takes one core on it's own, why?!) than wayland (and the working softpipe wayland on Vision Five 2).

The above should be highest priority as it makes the device unusable for anything but YouTube. Edit: just realized this probably is caused by the GPU driver? Would be nice with a way to know if the display output uses the GPU in some more fundamental way than trying 3D accelerated apps.

I'm just listing things you probably know but for completeness:

My solution to most of these is a 3 port USB-C dongle + USB DAC that I plug wired keyboard + mouse into, it also has Ethernet! Works great for home use.

Hardcore problems to use the GPU and develop games:

Last but not least I have had one pretty scary hardware glitch; once I was trying to get Twitch webpage to load (won't happen for some reason, but I know it's one of the heavier sites out there) and all of a sudden black screen without recourse (had to pull all cables and force reboot); I could hear the USB DAC make a faint crackle noise when it happened (not twitch audio related) so pretty sure it was power related, I'm thinking full USB hub + eth and CPU max loaded for 5 min. = something really bad. But it happened with power plugged in. That said I can't seem to get it charging reliably; sometimes it charges fast, sometime it discharges WHILE the power cable is in! Rebooted fine though, so no permanent damage I think.

I didn't have the UART inserted because I was testing without keyboard stuff... anyhow this is worrying combined with the whole battery charging situation. Don't want to cause a fire with this thing.

Edit: Now that I think about it maybe the USB-C connectors are to blame, I never used those on moving items, maybe they are glitchy?

barracuda156 commented 4 months ago

The patches (which apply on top of the Star64_linux repo) are here: https://github.com/Fishwaldo/meta-riscv/tree/ptv/recipes-kernel/linux/linux-starfive (I'll be pushing to the actual kernel repo soonish)

@Fishwaldo Has there been any updates ever since for the OS itself?

And a minor issue: I cannot get Wifi connected to any of the networks (iPhone hotspot, 802.1x network): they are recognized, but never connecting to them fails.