Lenovo ThinkSmart View ROM/OS Development

Interesting! Thanks for trying.

You might have one of the units that has a different screen.
Your Android kernel cmdline should tell you which screen the bootloader wants you to initialize:

For example:

[ 0.000000] Kernel command line: sched_enable_hmp=1 sched_enable_power_aware=1 console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 enforcing=0 androidboot.selinux=permissive androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 androidboot.bootdevice=7824900.sdhci earlycon=msm_hsl_uart,0x78af000 buildvariant=userdebug androidboot.emmc=true androidboot.verifiedbootstate=green androidboot.veritymode=enforcing androidboot.keymaster=1 androidboot.serialno=HUA0BXBW androidboot.psnno=ZA690000US androidboot.authorized_kernel=true androidboot.baseband=apq mdss_mdp.panel=1:dsi:0:qcom,mdss_dsi_boyift8201_800p_video:1:none:cfg:single_dsi

The drivers for the 3 possible panels are built in, weā€™d just need to select the right one for your scenario.

By any chance, could you send me a full dmesg output when running stock Android on your unit?

1 Like

Theyā€™re extremely similar but also different:

CD-17871Y: Internal Photos
SD-X501F: Internal Photos Part 1 Internal Photos Part 2
SD-8501F: Internal Photos

Mainboards are practically identical, with differences in Flash memory. These models use different cameras and a different speaker amp (TAS5805M vs. TAS5782M) as well.
Some models use a 10" Screen instead of the 8" on this unit. These screens also use a different touchscreen IC (Goodix vs. Focaltech).

1 Like

It seems mine has:

mdss_mdp.panel=1:dsi:0:qcom,mdss_dsi_hx83100a_800p_video:1:none:cfg:single_dsi

Hereā€™s the full output.

Perfect.

For dynamic selection to work I need lk2nd to work. I believe it actually might but I need to test again.

But in the meantime I can build a kernel for those boards that have other screens.

3 Likes

If it helps, hereā€™s some info on the boot process I found while looking for info on the sbl1 partition:

3 Likes

Quick update: I managed to get lk2nd somewhat working. I canā€™t access the fastboot mode of it, the device will crash into memdump mode (900e).

However, it does boot a kernel off the pmOS /boot partition (which from a device perspective lives on userdata) which is a big win. No more EDLing Kernel images to boot for testing.

I havenā€™t gotten the panel selection working yet. Also we have to hope that the touchscreen driver in mainline is the right one for this variant.

I unboxed the other two devices I had ordered to see whether I also have that variant, but mine are all the same (boyift8201 panels).

Also, I noticed that the device feels like three times snappier when booted via lk2nd. Instead of taking about a minute to fully boot Iā€™m now getting about the same - if not better - boot times compared with Android. Also I didnā€™t notice any graphics glitches this time. Maybe time to give Gnome another try :sweat_smile:
Wasnā€™t expecting that, honestly. A very pleasant surprise.

9 Likes

Iā€™ll try and test the driver on my device.

All I need to do is repack boot.img with the correct cmdline for my panel (match post above)?

Alternatively, I can send you a unit to test locally.

Thanks for offering to send a device for testing. Iā€™m hoping we can get it working without that being necessary.
I can provide an image later today that should have the panel selection working.

The only question mark for me is whether your configuration actually requires GPIO 95 (stock assigns it for backlight enable) and 100 (stock assigns that for panel external power supply) to be enabled. It is not required on my devices that have the boyift8201 panel configuration. The effect that would be seen if it was needed is simply that the screen might turn black sometime after bootloader initialization or wonā€™t come back on after it goes to sleep the first time.
If it is required it can be added. It doesnā€™t do anything on my devices that donā€™t need it, so itā€™s not dangerous to just enable it for all devices.

With these new images youā€™d simply have to flash the lk2nd.img to boot and the cd-18781y-rootfs.img to userdata using EDL and thatā€™s it.
Once my entire work is upstreamed to pmOS you only ever have to use apk to update the system, including kernels. Or use pmbootstrap sideload if you build kernel packages locally. No more flashing required.

If youā€™re interested, the way panel and touchscreen selection works is this:
The deviceā€™s bootloader already passes along the panel selection string in the kernel cmdline (thatā€™s what we got from the dmesg output). Since itā€™s now lk2nd that receives that cmdline and not the Linux kernel, lk2nd picks it up and uses it to identify which panel and touchscreen to activate (this is a mapping I made in lk2nd). The mainline dts for the device has a generic placeholder for the panel compatible string that gets replaced with the correct one (which is actually different from what stock uses due to mainline naming rules). It also has nodes for both touchscreen chips but both of them are status = "disabled". lk2nd will overwrite whichever touchscreen chip it wants to enable to status = "okay" and thatā€™s that. Pretty nifty actually.

5 Likes

As promised, here is an updated image: pmos-lenovo-cd-18781y-testing-20240227.tar.xz (SHA256 481397d2e189f00dfef144cc61b5467565163660e939b734d7dbed0c3ef14644)

This has panel/touchscreen selection enabled. Sound output is enabled as well. I didnā€™t remove some of my debug messages from the speaker amp driver I am working on, so donā€™t worry about the messages in the kernel logs :stuck_out_tongue:
Microphones donā€™t work yet, unfortunately.
But this image should be quite snappy and usable as is (minus the fact that you still manually need to disable hardware acceleration in Firefox for now).

Installation:

edl w boot lk2nd.img
edl w userdata lenovo-cd-18781y-rootfs.img

Username and password are pmos, just like the last image.

If you try it and it doesnā€™t work for you feel free to send me the dmesg output so I can take a look.

3 Likes

Awesome, looking forward to trying it out. Iā€™m getting a 403 for that link though :sweat_smile:

Try again. Good 'ol SELinux at it again :stuck_out_tongue:

Haha working now, thx

1 Like

Way more responsive now! Looking good :raised_hands:

1 Like

Been lurking for a while as things get more stable. Is the current effort on this thread just pmOS, or Android 11? There were some 11 rom images floating around, but most recent discussion seems focused on pmOS. Specifically looking for the voice assistant functionality that I saw on a video posted a while back.

Thanks for all the amazing work on this device!

Parallel efforts - this thread is mainly focused on pmOS. I have one running Android 11 and now thanks to Felix a second running pmOS.

The Android efforts are currently gaming focused and active over in the Retro Handhelds discord server, with deadman providing most of the images and updates. Iā€™m using it to run Fully Kiosk for HA and once itā€™s up itā€™s great with motion detection working to turn the screen back on. The downside is somethingā€™s still up with the wifi driver and it often panics and restarts at boot so it takes a few tries to get it back up. Android 8.1 is still the more stable and recommended path there (with itā€™s own caveats). You can also use the snowboy wakeword plugin with tasker or automate that Endlessvoid put together.

pmOS just became way more viable so curious to see what weā€™re able to do with that. Also maybe a longshot but Iā€™m hoping we could make use of the arm64 kernel with Android and update past 11 at some point as well. The Android kernel is still 3.18 and 32-bit.

2 Likes

My main motivation behind pushing forward with pmOS is that I assume it is going to stay viable for longer than Android on this device. This is mainly due to the fact that we can build the entire OS from source using a mainline kernel that will continue receiving updates. As of right now there are only 4 components that need a binary blob to function: Bluetooth, GPU, Speaker Amp and WiFi. And those blobs are OS independent. The speaker amp binary blob is technically not even firmware (as it isnā€™t software) but rather DSP configuration values (EQs and stuff) very specific to this device.

Porting the OS is certainly only one part. Creating a user experience to make this device worthwhile with Home Assistant would be the next step weā€™d need to tackle. Iā€™m hoping there may be a larger community that we can rally around that effort, because it would be adaptable to other devices than just the ThinkSmart View.

Nowā€¦ If I could only get those dang Digital Microphones working :stuck_out_tongue:

8 Likes

I just tried this latest image and Iā€™m getting a blank display. This is the dmesg output: Pastefy

1 Like

Thanks for posting the dmesg. It does look like you have the other display variant and the other panel driver is being loaded. May have to look into those GPIOs again. Iā€™ll put together another kernel tonight for testing.

1 Like

Thanks! If thereā€™s anything I can do to test a build or help you out, let me know.

1 Like

Agree. Excited to be a part of that effort.

Theres been so many cool ideas posted that can potentially see the light of day now, thanks to @FelixKa.

Once the Linux image is booting successfully on all the display variants Iā€™ll put a big link to this thread at the top of my original post.

Pmos page on Firefox mentions trying ESR because it still supports the ā€˜oldā€™ accelerated rendering.

Maybe that could work around the adreno bug you referenced, if itā€™s GLES 3 related.

1 Like