Development High Resolution Mod for Xperia 1 IV - Sony Xperia 1 IV

Hey everyone,
before the official Android 12 release from Sony it was possible to force the display to render at full 4K resolution via "wm size" command.
With the release of Android 12 this behaviour changed and it´s no longer possible to force 4K resolution that way.
I looked into quite a few ways go get full 4K rendering back and discovered that even for supported apps, where the kernel switches to timings for 4k resolution, the actual rendering for the displayed content is upscaled 2k.
That means there unfortunately is no way, that I was able to find, to force full 4k rendering on the device as of now.
The best I could do, is to force the default 4k mode where kernel panel timings are at 4k, but content is upscaled 2k for regular usage. The result is the following: Every app, except the ones you add to game optimizer app, will be rendered like apps that sony enabled 4k resolution for.
That´s the best I can do at the moment.
This mod might impact battery life, smoothness and other things, as more resources are needed.
However I didn´t have any problems during my usage.
The difference is not huge, but it´s visible if you look for it. For example the fonts at the bottom of Google Fotos app, like Fotos, Search etc are way more crisp.
You can check in logcat if high-resolution config is used via:
Code:
adb logcat | grep "high resolution"
While having this mod flashed, the following line means high-resolution mode (panel running at 4k, content is upscaled 2k at 120fps) is enabled:
Code:
11-11 18:56:49.801 1475 1758 D SDM : HWCDisplay::SetActiveConfigWithConstraints: Setting to a high resolution config: 1
While having this mod flashed, the following line means high-resolution mode (panel running at 4k, content is upscaled 2k at 60fps) is enabled:
Code:
11-11 18:56:56.725 1475 1761 D SDM : HWCDisplay::SetActiveConfigWithConstraints: Setting to a high resolution config: 0
Changelog:
update with dtbo.img for firmware 64.1.A.0.869
Requirements:
- Sony Xperia 1 IV running on A13, with at unlocked bootloader
- fastboot method does not require root
- method via kernel managers does require root
- backup your current dtbo.img or make sure you have a copy of the same (EXKM can backup dtbo.img, or you can grab it from xperifirm)
Installation:
1. Download one of the attached dtbo.imgs
Please note: This mod is made for Android 13 firmware, it will not work on Android 12 firmware
2. Do either 2a or 2b!
2.a Boot to fastboot and flash via:
Code:
fastboot flash dtbo filenameofdtbo.img
2.b Flash filenameofdtbo.img via EXKM or any app that allows flashing dtbo.img
3. reboot

this one is mine too

this as well

Anyone tried this yet, if so what was the impact on the battery?

sillygooes said:
Anyone tried this yet, if so what was the impact on the battery?
Click to expand...
Click to collapse
Please refrain from asking questions which can be answered with your own common sense lmao

Mijan94 said:
Please refrain from asking questions which can be answered with your own common sense lmao
Click to expand...
Click to collapse

Just flashed it and it seems to work pretty well so far, can notice a slight difference in sharpness of text and stuff with the new dtbo image flashed vs stock, only side effect was the boot animation being corrupted but it's fine once booted into Android.
A question though, should this be safe to flash for future Android 13-based firmware versions? Or is this specific to only the initial Android 13 firmware? (64.1.A.0.851)

OhayouBaka said:
Just flashed it and it seems to work pretty well so far, can notice a slight difference in sharpness of text and stuff with the new dtbo image flashed vs stock, only side effect was the boot animation being corrupted but it's fine once booted into Android.
A question though, should this be safe to flash for future Android 13-based firmware versions? Or is this specific to only the initial Android 13 firmware? (64.1.A.0.851)
Click to expand...
Click to collapse
Yes, boot animation can get scrambled up indeed.
It depends on changes done to future firmware updates. Can't foresee the future, but it's unlikely there are much changes.
It's easy to either backup dtbo.img before flashing the modded one or simply reflash Stock extracted from Xperiafirm/unsin tool though.

No Bootloader unlock needed. Still.
service call SurfaceFlinger 1035 i32 x
(x=0,1,2,3)
1. 1096x2560x60x397132cmd
2. 1644x3840x120x397108cmd
3. 1644x3840x60x397108cmd
4. 1096x2560x120x397132cmd
Google changed the behavior for native Resolution switches in the Android Settings. Just like Samsung has it since YEARS. Thanks for the alternative tho

Also note that some apps do not work with an unlocked bootloader, for security standards requires a locked bootloader.
All throughout the internetz, people have had issues with apps like banking/finance apps, Google proprietary finance apps like Wallet or Google pay, or apps store like Google play.

OhayouBaka said:
Just flashed it and it seems to work pretty well so far, can notice a slight difference in sharpness of text and stuff with the new dtbo image flashed vs stock, only side effect was the boot animation being corrupted but it's fine once booted into Android.
A question though, should this be safe to flash for future Android 13-based firmware versions? Or is this specific to only the initial Android 13 firmware? (64.1.A.0.851)
Click to expand...
Click to collapse
Figured out a more elegant method that doesn't corrupt the boot animation and should work on any future firmware updates. Simply flash this Magisk Module, which contains the commands that @Miustone provided. Yes, this does still require a bootloader unlock as you are only able to apply this command with root privileges or a Magisk script.
You should also be able to use this on other devices as well running Android 12 or newer, by following these steps to edit the Magisk module .zip provided:
Just run:
Code:
adb shell
Code:
su
Code:
dumpsys SurfaceFlinger | grep hwcId
Pick your id number according to resolution/refresh rate you desire from the list.
Here is an example output from Xperia 1 IV:
Code:
{id=0, hwcId=0, resolution=1096x2560, refreshRate=60.00 Hz, dpi=428.28x427.79, group=0}
{id=1, hwcId=1, resolution=1096x2560, refreshRate=120.00 Hz, dpi=428.28x427.79, group=0}
{id=2, hwcId=2, resolution=1644x3840, refreshRate=60.00 Hz, dpi=642.42x641.68, group=0}
{id=3, hwcId=3, resolution=1644x3840, refreshRate=120.00 Hz, dpi=642.42x641.68, group=0}
Edit the service.sh file inside the Magisk module zip
Code:
service call SurfaceFlinger 1035 i32 3
At this line, replace the number at the end with the id number you grabbed from the earlier adb commands

OhayouBaka said:
Figured out a more elegant method that doesn't corrupt the boot animation and should work on any future firmware updates. Simply flash this Magisk Module, which contains the commands that @Miustone provided. Yes, this does still require a bootloader unlock as you are only able to apply this command with root privileges or a Magisk script.
You should also be able to use this on other devices as well running Android 12 or newer, by following these steps to edit the Magisk module .zip provided:
Just run:
Code:
adb shell
Code:
dumpsys SurfaceFlinger | grep hwcId
Pick your id number according to resolution/refresh rate you desire from the list.
Here is an example output from Xperia 1 IV:
Code:
{id=0, hwcId=0, resolution=1096x2560, refreshRate=60.00 Hz, dpi=428.28x427.79, group=0}
{id=1, hwcId=1, resolution=1096x2560, refreshRate=120.00 Hz, dpi=428.28x427.79, group=0}
{id=2, hwcId=2, resolution=1644x3840, refreshRate=60.00 Hz, dpi=642.42x641.68, group=0}
{id=3, hwcId=3, resolution=1644x3840, refreshRate=120.00 Hz, dpi=642.42x641.68, group=0}
Edit the service.sh file inside the Magisk module zip
Code:
service call SurfaceFlinger 1035 i32 3
At this line, replace the number at the end with the id number you grabbed from the earlier adb commands
Click to expand...
Click to collapse
Was about to do a Module. Thanks for sharing the Details!

OhayouBaka said:
Figured out a more elegant method that doesn't corrupt the boot animation and should work on any future firmware updates. Simply flash this Magisk Module, which contains the commands that @Miustone provided. Yes, this does still require a bootloader unlock as you are only able to apply this command with root privileges or a Magisk script.
You should also be able to use this on other devices as well running Android 12 or newer, by following these steps to edit the Magisk module .zip provided:
Just run:
Code:
adb shell
Code:
dumpsys SurfaceFlinger | grep hwcId
Pick your id number according to resolution/refresh rate you desire from the list.
Here is an example output from Xperia 1 IV:
Code:
{id=0, hwcId=0, resolution=1096x2560, refreshRate=60.00 Hz, dpi=428.28x427.79, group=0}
{id=1, hwcId=1, resolution=1096x2560, refreshRate=120.00 Hz, dpi=428.28x427.79, group=0}
{id=2, hwcId=2, resolution=1644x3840, refreshRate=60.00 Hz, dpi=642.42x641.68, group=0}
{id=3, hwcId=3, resolution=1644x3840, refreshRate=120.00 Hz, dpi=642.42x641.68, group=0}
Edit the service.sh file inside the Magisk module zip
Code:
service call SurfaceFlinger 1035 i32 3
At this line, replace the number at the end with the id number you grabbed from the earlier adb commands
Click to expand...
Click to collapse
Thanks for this also I just found out you can add the script to fkm so you can easily switch between all resolution
Edit: Actually I think you can only run 2 res at a time 4k @120/60 or 1080 @120/60

Miustone said:
No Bootloader unlock needed. Still.
service call SurfaceFlinger 1035 i32 x
(x=0,1,2,3)
1. 1096x2560x60x397132cmd
2. 1644x3840x120x397108cmd
3. 1644x3840x60x397108cmd
4. 1096x2560x120x397132cmd
Google changed the behavior for native Resolution switches in the Android Settings. Just like Samsung has it since YEARS. Thanks for the alternative tho
Click to expand...
Click to collapse
OhayouBaka said:
Figured out a more elegant method that doesn't corrupt the boot animation and should work on any future firmware updates. Simply flash this Magisk Module, which contains the commands that @Miustone provided. Yes, this does still require a bootloader unlock as you are only able to apply this command with root privileges or a Magisk script.
You should also be able to use this on other devices as well running Android 12 or newer, by following these steps to edit the Magisk module .zip provided:
Just run:
Code:
adb shell
Code:
dumpsys SurfaceFlinger | grep hwcId
Pick your id number according to resolution/refresh rate you desire from the list.
Here is an example output from Xperia 1 IV:
Code:
{id=0, hwcId=0, resolution=1096x2560, refreshRate=60.00 Hz, dpi=428.28x427.79, group=0}
{id=1, hwcId=1, resolution=1096x2560, refreshRate=120.00 Hz, dpi=428.28x427.79, group=0}
{id=2, hwcId=2, resolution=1644x3840, refreshRate=60.00 Hz, dpi=642.42x641.68, group=0}
{id=3, hwcId=3, resolution=1644x3840, refreshRate=120.00 Hz, dpi=642.42x641.68, group=0}
Edit the service.sh file inside the Magisk module zip
Code:
service call SurfaceFlinger 1035 i32 3
At this line, replace the number at the end with the id number you grabbed from the earlier adb commands
Click to expand...
Click to collapse
raven213 said:
Thanks for this also I just found out you can add the script to fkm so you can easily switch between all resolution
Edit: Actually I think you can only run 2 res at a time 4k @120/60 or 1080 @120/60
Click to expand...
Click to collapse
nice, thanks for the information. Much appreciated!
Wasn´t aware of this command or this way to set the ID.
One thing I noticed. This way basically breaks refresh rate switching though. E.G. if a different FPS is set for any app via game enhancer that will break for some reason.
I use this little trick to set 60hz mode for video apps for example as colours and gamma are way better on 60fps, and it´s unnecessary to drive the phone at 120hz during 60fps videos.
Had a small hope this would circumvent the upscaled 2k content despite running 4k panel mode, but it´s still the same.

Is it available on xperia1iii?

1219545479 said:
Is it available on xperia1iii?
Click to expand...
Click to collapse
Check Sony xda TG I think someone created a zip file for the III

First thanks for this mod. But 4k 120hz is sooooo hot although my room's temp is 9°C .... Fxxk 8gen1 that's why I want to buy s23ultra

1219545479 said:
Is it available on xperia1iii?
Click to expand...
Click to collapse
Yeah see here.... 2nd post by me.....
High Resolution & High Refresh Guide for Xperia 1 III
Welcome! Short and painless for You No Root needed Download the Android Platform Tools from Google Extract the Folder Containing adb & fastboot open a Terminal in the extracted Folder run one by one: adb shell service call SurfaceFlinger 1035...
forum.xda-developers.com

updated for firmware 64.1.A.0.869

It's so awesome that this mod exists and I don't even have the phone! Thank you for this mod. I really do hope more people discover this, as I'm sure many Xperia 1 users would want it.

Related

[Updated: JUN 15] Easier XMir Setup (Now with Libertine!)

EDIT: I bring you the new OFFICIAL way of installing X11 applications, I've been neglecting this thread way too much and need to give it some love.
The old instructions (OLD METHOD) are no longer needed as of April on the rc and rc-proposed channels, this should work on all channels however (tested up to latest devel-proposed image)
NOTE: You still need a writable image for the first parts of this, after you install the tools, it can go back to read-only.
1) Open Terminal
2) Install the following packages: libertine libertine-tools python3-libertine-chroot
3) Open the Ubuntu Store and install the scope: libertine-scope
4) Open the Libertine application that's now available in your launcher and follow instructions, it will set up a Ubuntu Vivid chroot in your home directory, install the components needed, and drop you at the package management screen. From here, you can update and add PPAs to the container via the Settings Icon -> Manage Container, Install packages via the plus icon, etc.
5) Favorite the Libertine XApps scope by swiping up on the home screen and hitting the star, then open the scope and you'll see any applications you installed there.
If you cannot install your container via the Libertine application (I know that it didn't have support for chroot until recently, not sure if that version has landed yet), you can install your container via the teminal, so open your terminal but DO NOT sudo su. All Libertine-container-manager commands MUST be done as phablet.
To create a container (this line will likely change when Xenial drops as Libertine will be switching to LXC on Xenial):
Code:
libertine-container-manager --create -i <container id> -n <friendly name (this shows up in the Libertine app)> -t chroot
Using this command, the system will build the new libertine container, wait until it's finished and then you can continue by using the installed Libertine application.
Onscreen Keyboard in Libertine Applications
THIS CAN FINALLY BE DONE! The only con to it, is that it is mostly unusable in applications that open dialog boxes along the bottom of the screen, the XMir window does not scroll up like native applications do to give a better viewing window. (I have been told that this will change in OTA-12 when the keyboard support drops for Libertine/Puritine apps)
To install on-screen keyboard:
Open Libertine and add ppa:brandontschaefer/maliit to your container. Then hit update in Manage Containers. Once done, install the following, maliit-inputcontext-gtk2, maliit-inputcontext-gtk3, maliit-framework. After that, setup is complete in your container, now we need to do some extra work outside the container to make it pass the GTK_IM_MODULE variable we need over to Libertine. To do this, add this line to your .bashrc or if you have a writable image, you can add this to the systemwide profile (not sure if this will be replaced on OTA though):
Code:
export GTK_IM_MODULE=maliitphablet
Restart the tablet OS, Open an application such as Libreoffice Writer and BEHOLD!
Notes
You can also manage your container via the terminal with libertine-container-manager. To get a root shell without installing mate terminal (You can't get a root shell via this method (installing a term), Proot acts like fakeroot all over your container's rootfs), you can use the following:
- l-c-m exec -c bash (This command does not mount any user directories (/home/phablet will not exist) and is best used for making changes to the container's rootfs)
or if you only need a user shell:
- DISPLAY= libertine-launch <containerid (default is vivid)> bash (This mounts user directories, but is no different than if you installed something like mate-terminal and ran it. The reason we are passing an empty DISPLAY variable is because libertine-launch will refuse to start if DISPLAY isn't set, even it if doesn't exist.)
- DPI Hacks: To change the DPI of applications in Libertine, you need a new way to make the .Xdefaults file as only the XDG User directories get mounted inside the libertine container, not your entire Home. To do this, install your favorite editor inside of the libertine container (I find nano to be the easiest for new users), and open Terminal, then follow these instructions:
1) Open your editor to ~/.local/share/libertine-container/user-data/[my container id, default = vivid]/.Xdefaults and fill it with the following:
Code:
Xft.dpi: 175
or what your preferred DPI is. On the Nexus 7 flo the comfortable DPI is 175 with an application font size of 14 (I use Liberation Sans which comes from Libreoffice).
- You can make your applications look great still, you don't have to be stuck with the default Raleigh GTK style. Download and install LXAppearance in your container and add ppa:noobslab/themes then start installing themes. Enjoy! The Ubuntu Touch Themes are wonderful and FlatPlat works well with the system UI as well.
Some cons to this:
- It requires at least 3GBs available in your internal storage (wherever your home folder resides) to store a full, non-touch Ubuntu Vivid container.
Pros:
- It survives OTAs, the only thing able to break this would be a change to XMir, PRoot, or Libertine. Which is landing in the images shortly by default so there's not much of a chance to break this.
- Nothing you do will break your UTouch system. Unlike the old method, this only installs the items needed to run the container, which are to become standard inside the images very soon.
OLD METHOD
--------------------
EDIT: I have not tested this in stable, rc, rc-proposed yet. Only the dev-proposed channel.
So there is some questioning I see going on about how to run things like Firefox efficiently and well. So I figured I'd write up a little something for it.
First you'll want to set your DPI in ~/.Xdefaults, as I have a Nexus 7, mine looks similar to this:
Xft.dpi: 240
Note that you may need to do some additional tweaking.
Now that you have Xdefaults made, install the ubuntu-pocket-desktop and matchbox-window-manager packages (along with the program you wish to use, for this tutorial, I'll use libreoffice).
Create a file in /bin called wm-wrapper.sh (or whatever you choose here, just remember the name), fill it with:
Code:
#!/bin/bash
matchbox-window-manager -use_titlebar no -use_dialog_mode const-horiz &
exec [email protected]
and save it, then chmod a+x it.
EDIT: For this next part, I recommend copying the .desktop to ~/.local/share/applications to avoid them being overwritten on package updates.
Now, navigate to /usr/share/applications/ and open the .desktop file for the application you are wanting to run. Add the following lines under [Desktop]:
Code:
X-Ubuntu-Touch=true
X-Ubuntu-XMir-Enable=true
Change the Exec line so that your wrapper (in my case wm-wrapper.sh) is in front of the executable, such that the line becomes (or similar):
Code:
Exec=/bin/wm-wrapper.sh libreoffice %U
Save it, then search for your application in the Unity Scopes. Open it up and you should see your application running as an XMir app easy. For future applications, you will simply need to do the changes to it's .desktop file.
EDIT: A helpful redditor gave me this tip to enable sending touch events over to Xmir. Setting the GTK_TEST_TOUCHSCREEN environment variable to 1 will apparently remove hover events and the like (events that are not normally sent with a touch screen, but with a mouse). I have not had time to take a look at this yet however so YMMV.
Thanks man, gonna try this on my n4 later today. ?
thumbzzzz said:
Thanks man, gonna try this on my n4 later today.
Click to expand...
Click to collapse
No problem, Like I said, not sure if it works on other channels, but it works great on the dev-proposed channel. You will also want to close applications using their menu items as closing the Xmir root window will cause the application to terminate without asking to save anything. Libreoffice can get around this via Document Recovery though.
I had been working on this for a good solid week testing applications and different ways to get X11 applications working so I could make it a full workstation, so I figured why not post my findings since the Ubuntu forum doesn't seem to get much love.
Thanks for the matchbox tip! It works quite nicely, especially, it brings a nice onscreen keyboard with it. I use the following setup now:
~/.local/share/applications/gedit-mb.desktop
Code:
[Desktop Entry]
Name=GEdit in Matchbox
Type=Application
Terminal=false
Icon=/usr/share/gedit/logo/gedit-logo.png
X-Ubuntu-Touch=true
#X-Ubuntu-XMir-Enable=true
Exec=/home/phablet/bin/matchbox-wrapper.sh gedit
~/bin/matchbox-wrapper.sh
Code:
#!/bin/bash
export DISPLAY=:1
Xmir $DISPLAY &
sleep 1
# xlogo
# xeyes
# x11vnc -forever -nopw -quiet -display $DISPLAY &
matchbox-window-manager &
sleep 1
matchbox-keyboard &
[email protected]
~/.matchbox/kbdconfig
Code:
# http://unix.stackexchange.com/questions/223110/what-are-the-keyboard-shortcuts-for-matchbox-window-manager
<ctrl><alt>p=prev
<ctrl><alt>n=next
<ctrl><alt>d=!matchbox-desktop
<ctrl><alt>x=!xterm
<ctrl><alt>f=!firefox
Together with the Xft.dpi setting (I use 220) this gives me a quite usable editor. If you have any other tips ShadowEO, I'd love to hear them!
One thing I'd like to figure out is how to modify the DPI for the Mir GDK Backend. Currently GTK3 applications started with the backend are way to small.
ShadowEO said:
One thing I'd like to figure out is how to modify the DPI for the Mir GDK Backend. Currently GTK3 applications started with the backend are way to small.
Click to expand...
Click to collapse
Do you have a specific example? Which application are you looking at?
doniks said:
Do you have a specific example? Which application are you looking at?
Click to expand...
Click to collapse
Sorry, for some reason I wasn't subscribed to this post (weird.)
Anyway the specific application I was looking at was gedit, when started with the native GDK Mir backend, it is almost unusable with touch as the elements are so small. GDK_SCALE doesn't work and neither does any of the GTK dconf settings for scaling.
Also, I have switched to using rc-proposed, so any more changes I do will likely be able to be installed without worrying about the snapshot channel.
Also messing with some touch-screen specific .gtk2.0-rc entries seem to help, but since I reformatted, I don't quite have those offhand at the moment. I'll have to look them up again.
Hi!
Thanks a lot for all these useful explanations! Finally I was able to run Firefox on my bq E4.5 (rc-proposed)! But I have a few questions:
1) I don't have any on-screen keyboard
2) it works like with a mouse (no touch scrolling for instance)
Is there something I can do about that?
takri said:
Hi!
Thanks a lot for all these useful explanations! Finally I was able to run Firefox on my bq E4.5 (rc-proposed)! But I have a few questions:
1) I don't have any on-screen keyboard
2) it works like with a mouse (no touch scrolling for instance)
Is there something I can do about that?
Click to expand...
Click to collapse
You could try the touchegg package for multi touch gestures, I haven't gotten around to testing it yet. As for keyboard, you can use onboard for most applications or if the application is a QT application, it will pop up the system keyboard (behavior was exhibited by calibre)
ShadowEO said:
You could try the touchegg package for multi touch gestures, I haven't gotten around to testing it yet. As for keyboard, you can use onboard for most applications or if the application is a QT application, it will pop up the system keyboard (behavior was exhibited by calibre)
Click to expand...
Click to collapse
Thanks a lot for your answer. Sorry I don't know much yet about all this so my questions might be silly!
1) I installed touchegg but I don't know how to make it work
2) I have no keyboard in any app I installed (caja, gedit, firefox, ...)
Another question: I have a bq E4.5 and although I have 3.5G of free space on my internal memory the space available for apt-get-ed apps is much smaller (I have 50M left after installing just those few apps above). So no way to try libreoffice or other heavier app. Do you know if there is a solution for that?
Thank you very much!
takri said:
2) I have no keyboard in any app I installed (caja, gedit, firefox, ...)
Click to expand...
Click to collapse
If you use the matchbox setup I described above then you should have a keyboard.
Another question: I have a bq E4.5 and although I have 3.5G of free space on my internal memory the space available for apt-get-ed apps is much smaller (I have 50M left after installing just those few apps above). So no way to try libreoffice or other heavier app. Do you know if there is a solution for that?
Click to expand...
Click to collapse
This website describes a tweak to put the apt cache on an external SD card. It's in German, but the command lines should be clear enough. Let us know how it goes.
https://wiki.ubuntuusers.de/Ubuntu_Touch/Terminal/#Freien-Speicher-beobachten
You would need to run touchegg in the wrapper. Sadly wth keyboard, the only applications that will get the system keyboard are QT based applications. GTK+ and other applications will require onboard to be installed. I messed around with trying to install maliit-context-gtk2 to get the system keyboard to show in all apps, but that broke the keyboard completely.
Remember XMir is better used with a physical keyboard since it doesn't trigger the Ubuntu keyboard for everything.
You can also make the system img bigger if using MultiROM: you simply run e2fsck -fp /path/to/Ubuntu.IMG and resize2fs <target size> /path/to/Ubuntu.IMG.
ShadowEO said:
You would need to run touchegg in the wrapper.
Click to expand...
Click to collapse
I've played around with this a bit, but I can't get touchegg to work. I start an xmir application, then log in via ssh from my desktop. After setting the DISPLAY variable, I can start more X applications ok. After starting touchegg I see an output like this:
Code:
Reading config from "/home/phablet/.config/touchegg/touchegg.conf"
Try to make a multitouch gesture. If everything goes well the information about the gesture must appear
[+] Avaliable gesture:
Name -> Flick
[+] Avaliable gesture:
Name -> Drag
[+] Avaliable gesture:
Name -> Pinch
[+] Avaliable gesture:
Name -> Rotate
[+] Avaliable gesture:
Name -> Tap
[+] Avaliable gesture:
Name -> Touch
I assume that I am supposed to see some more output when a touch gesture is recognised by touchegg, but nothing ever shows up.
I can see touch events with either xinput or evtest
Code:
$ xinput test "xmir-fake-touch-pointer:0"
motion a[0]=36317 a[1]=42290
button press 1
motion a[0]=36590 a[1]=41730
motion a[0]=36645 a[1]=41275
motion a[0]=36536 a[1]=40469
motion a[0]=36263 a[1]=39524
motion a[0]=35935 a[1]=39034
motion a[0]=34897 a[1]=38019
motion a[0]=33532 a[1]=36934
motion a[0]=32713 a[1]=36303
motion a[0]=31839 a[1]=35778
motion a[0]=31293 a[1]=35533
motion a[0]=30856 a[1]=35323
motion a[0]=30638 a[1]=35253
motion a[0]=30419 a[1]=35148
motion a[0]=30255 a[1]=35078
motion a[0]=29928 a[1]=34903
motion a[0]=29873 a[1]=34868
motion a[0]=29873 a[1]=34868
motion a[0]=29873 a[1]=34868
button release 1
Code:
$ evtest /dev/input/event0
Input driver version is 1.0.1
Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0
Input device name: "elan-touchscreen"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event type 3 (EV_ABS)
Event code 47 (ABS_MT_SLOT)
Value 0
Min 0
Max 9
Event code 48 (ABS_MT_TOUCH_MAJOR)
Value 0
Min 0
Max 31
Event code 53 (ABS_MT_POSITION_X)
Value 0
Min 0
Max 1343
Event code 54 (ABS_MT_POSITION_Y)
Value 0
Min 0
Max 2239
Event code 57 (ABS_MT_TRACKING_ID)
Value 0
Min 0
Max 65535
Event code 58 (ABS_MT_PRESSURE)
Value 0
Min 0
Max 255
Properties:
Property type 1 (INPUT_PROP_DIRECT)
Testing ... (interrupt to exit)
Event: time 9936.473027, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 1159
Event: time 9936.473088, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 12
Event: time 9936.473088, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 27
Event: time 9936.473118, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 338
Event: time 9936.473118, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1059
Event: time 9936.473149, -------------- SYN_REPORT ------------
Event: time 9936.509709, type 3 (EV_ABS), code 48 (ABS_MT_TOUCH_MAJOR), value 11
Event: time 9936.509709, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 43
Event: time 9936.509709, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 351
Event: time 9936.509739, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1061
Event: time 9936.509739, -------------- SYN_REPORT ------------
Event: time 9936.512791, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 46
Event: time 9936.512791, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 357
Event: time 9936.512791, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 1063
Some websites point to synclient for the configuration of touchegg, but that doesn't seem to work in Xmir:
Code:
$ synclient
Couldn't find synaptics properties. No synaptics driver loaded?
Does anyone else have more luck with touchegg?
While researching it, I stumbled over references to xSwipe, but I haven't looked into that any further.
ShadowEO said:
You would need to run touchegg in the wrapper. Sadly wth keyboard, the only applications that will get the system keyboard are QT based applications. GTK+ and other applications will require onboard to be installed. I messed around with trying to install maliit-context-gtk2 to get the system keyboard to show in all apps, but that broke the keyboard completely.
Click to expand...
Click to collapse
Just to reiterate, the matchbox-keyboard works fine for me!
Oh, and one thing I wanted to share: The firefox extension Grab and Drag allows a more natural touch screen style drag-to-scroll.
I completely forgot the matchbox keyboard while writing that reply, I'm not sure what's going on with touchegg as I haven't had a chance to play with it on Ubuntu touch. It could be that XMir isn't actually passing that much information about touch events.
matchbox-window-manager struggle
I am on the new Aquarius m10 Ubuntu tablet.
Tried to run tome applications and realized the X11 and Mir problem.
Came across your solution! Thank you for sharring!
Well, I dont seem to be able to install matchbox-window-manager
It shows a lot of missing dependencies and I am not abble to install them manually either..
The following packages have unmet dependencies:
matchbox-window-manager : Depends: libmatchbox1 (>= 1.7-1) but it is not going to be installed
Depends: libstartup-notification0 (>= 0.2) but it is not going to be installed
Depends: libxsettings-client0 but it is not going to be installed
Any light?? Thank you very much
eskizon said:
I am on the new Aquarius m10 Ubuntu tablet.
Tried to run tome applications and realized the X11 and Mir problem.
Came across your solution! Thank you for sharring!
Well, I dont seem to be able to install matchbox-window-manager
It shows a lot of missing dependencies and I am not abble to install them manually either..
The following packages have unmet dependencies:
matchbox-window-manager : Depends: libmatchbox1 (>= 1.7-1) but it is not going to be installed
Depends: libstartup-notification0 (>= 0.2) but it is not going to be installed
Depends: libxsettings-client0 but it is not going to be installed
Any light?? Thank you very much
Click to expand...
Click to collapse
Mhm, not sure. You do have set it to read-write and you did an apt update, right?
doniks said:
Mhm, not sure. You do have set it to read-write and you did an apt update, right?
Click to expand...
Click to collapse
Thanks for sharing this info! I also own the M10 ubuntu tablet and try to run some X11 apps.
I am able to apt-get matchbox-window-manager. But it won't start and says it can't find the display.
Running either:
Code:
matchbox-window-manager
matchbox-window-manager -d :0
as a normal user or root always returns: "can't open display! check your DISPLAY variable.".
ubuntu-pocket-desktop is up to date and I also set the DPI in ~/.Xdefaults.
What could be the reason it can't find the display? What could I try?
Tazard4 said:
What could be the reason it can't find the display?
Click to expand...
Click to collapse
You don't have an X server running. At least not at :0.
What could I try?
Click to expand...
Click to collapse
Follow the instructions in the original post or in my post #4.
Bumping this thread as I've edited the OP with the official instructions for running Legacy X Applications on Ubuntu Touch. As well as information about getting the system maliit-based OSK showing in X Applications (It's not that great though, you still may have better luck with matchbox-keyboard/on-board, but not sure how you'd even start those in Libertine.)

[WIP][MOD][SPLASH][OP6] Splash Screen Image Injector

Hey folks, thanks to @iElvis sharing his or her logo 'data' from the OP6. I have adapted my previous OnePlus programs that let you change the splash screen to work with the OP6. This means that the encoding of the data structure and the encoding of the image data are done. I do not have a OP6 and can not test certain things like where to put the modified file. In the past, flashing was always easy (and always has been especially with the OnePlus models).
My holdup and why I need the XDA/OP6 community support is to find out where to exactly put this modified file. In the past I haphazardly made a super fast in-memory program for altering the splash screen for the Nexus 6p that was (and is currently) at a roadblock for one reason. That reason was Google used ELFs to populate partitions (not short people with pointy ears and green clothing), and at that time utilized separate partitions that the ELFs populate. Not all were ELF generated, but that is outside of the scope of what I do because to a certain point the ones that I wanted to change were generated that way.
This concept of splitting partitions, back then, was just trying to grab a footing on seamless upgrades initially from what I have read up until this newer style. I have put some research into some things involving this, but Google is kind of bland in it's description of what this all means. This is different than the Nexus 6P that I mentioned previously, and if you read that last link, it may be just as easy as flashing it to both partitions logo_a & logo_b. One partition is always active and has two different statuses, which make the device 'ideally' always bootable after an OS update.
Most of my research was done through reading a lot of the open source code put out by the AOSP for "fastboot". You can learn more than you can ever derive from documentation in this realm. I hope to hear some feedback of attempts so that I can delete all of this up above
Please read below so you can better understand this type of encoding being used:
What Is A Raw Image?
A raw image, whether it be a file or an image in memory, is simply pixel data. There is no extra information like width, height, name, end of line... Absolutely nothing, just pixel data. If you have an image that is raw and the resolution is 1080x1920 and you are using a typical RGB24 or BGR24 (like the ones used here), then your exact filesize or size in memory will be 1080x1920x3! We use 3 here because there is one byte for the R or red component, one for the G (green), and one for the B(blue).
What Is A Run Length Encoded Image?
A run length image encoding uses a count ;usually a single byte (char), 2 bytes (short int), or 4 bytes (long int); and then the pixel components. So instead of writing out 300 bytes of '0's to make a line of 100 black pixels. Black is RGB(0,0,0). You could encode this as 100, 0, 0, 0. And only use 4 bytes of data to get the exact same image as the 300 byte raw image. All the run length encoding I've found, except the Motorola style which is a little different, use a run length encoding that is pixel-oriented like this.
Now I've found this new one and it is a byte-oriented run length encoding. This is for runs of bytes, not pixels. You may think, well whats the big deal? When you add a little area of color, you increase the run length encoded image in you logo.bin immensely! You use 6 bytes per pixel if there aren't any runs of color data. If you had an image that was a 1080x1920 black image with a 25 pixel horizontal line in the middle. The encoder would be doing runs of black data efficiently until it reached the red area.
.....0 255 0 255 0 255 0 255 0 255 0 133 /// we've reached the top left corner of the red line /// 13 1 30 1 255 1 // << that was just one red pixel!! in bgr color order (13, 30, 255) <<// And it keeps going through the rest of the red pixels on that line using 6 bytes per pixel, which is the opposite of compression. Before reaching the red line the encoding was decoding to 255 zeros over and over, until finally 133 zeros. 255 zeros is 85 black pixels stored in just 2 bytes!
This type of encoding is ONLY good for grey scale images. It is not good with color, but it still will handle color of course. In grey scale, the Red, Blue, and Green data components are always the same values. All the way from black (0,0,0) to white (255, 255, 255); including every shade of grey in between>>>(1,1,1) (2,2,2) (3,3,3)....(243, 243, 243) (254, 254, 254)<<<
One other difference in this method of run length encoding is that the color byte is before the count, which is backwards from all of the other methods.​
The attachment contains the executable that was compiled using mingw32 on a 64 bit Windows 10 PC. The awesome PNG library that I used for generating the pngs is LodePng, the source can be found here.
To use the OnePlus 6 Logo Injector:
Decode your logo.bin:
Code:
OP6Logo -i logo.bin -d
All the PNG 's will be extracted from logo.bin. Edit the PNG(s) that you want to change...
Note:
Your original "logo.bin" file is never changed, it is just read. If the file you try to load isn't a logo file, or a different style, then the program will tell you and exit.​
Inject the image(s) back in to the logo.bin:
Code:
OP6Logo -i logo.bin -j fhd_oppo fhd_at
To list whats in your logo file:
Code:
OP6Logo -i logo.bin -l
For a more detailed list:
Code:
OP6Logo -i logo.bin -L
If the colors are messed up use the "-s" switch while decoding.
Code:
OP6tLogo -i logo.bin -d -s
If you had to use the "-s" switch to decode properly, you'll have to use it to inject also:
Code:
OP6Logo -i logo.bin -j image_name -s
Note:
You can put as many names after "-j" as you want, and it's not case sensitive. You also don't have to put the whole name. If you just put "-j fhd" every image in the logo.bin that starts with "fhd" will be injected. There has to be a PNG with the name in the directory though​
The size of your modified.logo.bin will displayed along with the original size, if everything went good. The 'splash' partition is 16 MB on the OP6. If you use too much color on too many of the images you will easily go over 16 MB. The program will tell you and delete the "modified.logo.bin" that was created. If for some strange reason you would like to keep it, use the "-B" flag on the command.
The last step is to flash the modified logo file via fastboot with the command
Code:
fastboot flash LOGO modified.logo.bin
Use this at your own risk.
Always make backups.
Always.
Source
Source:
I haven't had a chance to work up a custom splash and flash it just yet, in part because I realized that on this phone, the splash screen only shows up for a split second before it's replaced by the "Your phone is unlocked and insecure, don't put sensitive files on it blah blah" warning. So I'm not sure this is going to do a whole lot for us. I'm going to try later tonight or this weekend and report back. Pretty sure "flash logo" should work fine, but it will flash only to the active partition. We may need to "flash logo_a" and "flash logo_b" to get it on both partitions.
Also, thanks for posting the source. I'm going to see if I can get this to compile in Xcode so we have an OSX version.
Edit 6/10: I can't get it to compile in Xcode, but I'm sure it's something I'm doing wrong.
Anyone tested it splash screen
Okay, welp, I'm throwing in the towel on this one. The bootloader warning is not in text like it was on the HTC phones I've modded to remove it. On those phones, the text showed up in the bootloader file in a hex editor, and could be replaced with empty spaces to remove it.
I pulled the boot file from /dev/block/bootdevice/by-name/ and searched through it. None of the text in the warning can be found with a simple search. As I suspected, that warning screen looks like it's a function coded into the boot process, which means removing it is probably impossible.
work Fine !
file :
lodepng.h
lodepng.c
OP6Logo.c
# gcc lodepng.c -c
# gcc OP6Logo.c -c
# gcc *.o -o OP6_prog OR # gcc lodepng.o OP6Logo.o -o OP6_prog
# ./adb shell
# su
# cd /dev/block/bootdevice/by-name
# ls --color --all
lrwxrwxrwx 1 root root 16 1970-01-06 04:29:20.549999999 +0100 LOGO_a -> /dev/block/sde20
# dd if=LOGO_a of=/sdcard/LOGO_a
exit
# ./adb pull /sdcar/LOGO_a ./
# OP6_prog -i LOGO_a -d
MODIFY YOUR PICTURE .....
# ./OP6logo -i LOGO_a -j fhd_
you have modified.logo.bin
Just dd if of and work fine !
And for the Real Splash :
./adb pull /system/media/bootanimation.zip ../
God bless
gao0309 said:
file :
lodepng.h
lodepng.c
OP6Logo.c
# gcc lodepng.c -c
# gcc OP6Logo.c -c
# gcc *.o -o OP6_prog OR # gcc lodepng.o OP6Logo.o -o OP6_prog
# ./adb shell
# su
# cd /dev/block/bootdevice/by-name
# ls --color --all
lrwxrwxrwx 1 root root 16 1970-01-06 04:29:20.549999999 +0100 LOGO_a -> /dev/block/sde20
# dd if=LOGO_a of=/sdcard/LOGO_a
exit
# ./adb pull /sdcar/LOGO_a ./
# OP6_prog -i LOGO_a -d
MODIFY YOUR PICTURE .....
# ./OP6logo -i LOGO_a -j fhd_
you have modified.logo.bin
Just dd if of and work fine !
And for the Real Splash :
./adb pull /system/media/bootanimation.zip ../
God bless
Click to expand...
Click to collapse
Way to remove bootloader unlocked warning?
NO
Please create flashable zip. Of splash screen
I'm trying this on linux on a 6T boot splash screen but I get a segmentation fault:
Code:
__________________________________________________________-_-
OP6 Logo Injector v1
Written By Makers_Mark @ XDA-DEVELOPERS.COM
_____________________________________________________________
FILE: logo.bin
_____________________________________________________________
RGB is the color order. Use "-s" switch to change it to BGR.
#01: Offset:0
Header=SPLASH!!
Width=1080
Height=1920
Data Length=81798
Special=1
Name=
Metadata=
Segmentation fault
Any idea why?
foobar66 said:
I'm trying this on linux on a 6T boot splash screen but I get a segmentation fault:
Any idea why?
Click to expand...
Click to collapse
For 6T, maybe you need look at this thread
https://forum.xda-developers.com/oneplus-6t/development/tool-splash-screen-modification-t3874158
Sent from my ONEPLUS A6000 using XDA Labs
I tried to report that the error memory could not be read under Windows 10 and wimdows7. Then I executed the following instructions under Linux and still reported the error. What can I do, oneplus 6, Android 9.0?
gcc lodepng.c -c
gcc OP6Logo.c -c
gcc *.o -o a.out
./a.out -i logo.bin -d
The following are the results of implementation:
__________________________________________________________-_-
OP6 Logo Injector v1
Written By Makers_Mark @ XDA-DEVELOPERS.COM _____________________________________________________________
FILE: logo.bin _____________________________________________________________
BGR is the color order. Use "-s" switch to change it to RGB.
#01: Offset:0
Header=SPLASH!!
Width=1080
Height=1920
Data Length=77716
Special=1
Name=
Metadata=
Segmentation fault
Code:
C:\Users\denie\Documents\logo>OP6Logo -i logo.bin -d
__________________________________________________________-_-
OP6 Logo Injector v1
Written By Makers_Mark @ XDA-DEVELOPERS.COM
_____________________________________________________________
FILE: logo.bin
_____________________________________________________________
BGR is the color order. Use "-s" switch to change it to RGB.
#01: Offset:0
Header=SPLASH!!
Width=1080
Height=1920
Data Length=81798
Special=1
Name=
Metadata=
C:\Users\denie\Documents\logo>
Any ideas?
Does this work?
Prakyy said:
Does this work?
Click to expand...
Click to collapse
There's no way to hide the Google warning about unlocked bootloaders, if that's what you mean.
iElvis said:
There's no way to hide the Google warning about unlocked bootloaders, if that's what you mean.
Click to expand...
Click to collapse
Really... This is what I've been searching all over for for my 6t... Get rid of the stupid bootloader unlock warning. On all my other devices we always used a custom made boot-logo.bin and installed it on slot a and slot b using fastboot.. I guess if it could be covered up it definitely would have by now. ?
Edit added: I just read the thread. From what I've gathered basically this device (6&6t) is designed different and that's why we can't tamper with/cover up the bootloader warning message.
flash713 said:
Really... This is what I've been searching all over for for my 6t... Get rid of the stupid bootloader unlock warning. On all my other devices we always used a custom made boot-logo.bin and installed it on slot a and slot b using fastboot.. I guess if it could be covered up it definitely would have by now. ?
Edit added: I just read the thread. From what I've gathered basically this device (6&6t) is designed different and that's why we can't tamper with/cover up the bootloader warning message.
Click to expand...
Click to collapse
I gave up after a lot of experimenting. I'm not aware of anyone managing it.
iElvis said:
I gave up after a lot of experimenting. I'm not aware of anyone managing it.
Click to expand...
Click to collapse
You should get an award for your XDA signature. ?? It's funny because it's real and oh so true! The way some people comment on things never ceases to blow me away. I see some posts and I think to myself, "what the hell?" "Who raised this person!?" There are definitely many different types of humans out there in the world that's a fact. I try and stay out of it as much as possible. ? lol.
It sucks we can't just make a ton of boot logos and cover that up. Oh well the 6 & 6t are awesome devices!! Usually whenever I end up on down the road selling my phone and purchasing another one from eBay or swappa things similar to this begin to be solved and then 15 custom roms all drop outa nowhere all at once. ? Happens every...single...time...haha!! Thanks for giving it a shot! :good:

[FLASHLIGHT] Low flashlight brightness fix (torch light, not photo flash)

Hello.
Stock libraries on XZ1 Compact are using 25mA current for the flashlight, which leads to very dim light.
I fixed this to get 400mA current, and now flashlight is very bright, much better than on 25mA (stock) current.
WARNING: You may damage (or even fry) your flashlight LED with these libraries, but i'm think 400mA is fine, because there is 25..400mA limits in the code, and after 2 minutes of light at 400mA my phone's LED was just a bit warm (but not hot).
WARNING: You must disable dm-verity for /vendor/ partition before flashing any .zip attached below, or you will get bootloop.
NOTES:
1. The easiest way to disable dm-verity is to use Magisk to get root (it will automatically disable dm-verity of both /system/ and /vendor/ partitions when installed with default settings). The patched libraries does not require root access, Magisk is mentioned here only for disabling dm-verity.
2. To install Magisk you must unlock bootloader and flash TWRP. Please read [RECOVERY] TWRP 3.2.3-0 (lilac) [UPDATE: 2018-11-28] to learn more about TWRP installation for XZ1 Compact (or find appropriate TWRP for your device).
3. Please read [XZ1c/XZ1/XZp] temp root exploit to backup drm keys implemented to learn more about the way to backup your TA with DRM keys before unlocking your device's bootloader (this is important, because DRM keys will be lost on bootloader unlock, and you will have no way to get them back if you don't have TA backup with those DRM keys).
If you need other current value (in 25..400mA range) - feel free to contact me.
If you need patch for another ROM version or device - please contact me with attached /vendor/lib/libcameralight.so and /vendor/lib64/libcameralight.so from your ROM (and please tell me your device's model and version of your ROM).
You may try to do patch by yourself, tech details about patching is in Post #17 - feel free to upload patched .so files or flashable .zip for your device (please don't forget to write device model and ROM version in the description).
Files without model in name is for XZ1 Compact, other files (with model at the end of file name) is for corresponding phone models.
Files for 47.2.A.0.306 are also compatible with 47.2.A.2.33, 47.2.A.4.41 and 47.2.A.4.45 ROM versions, and may be compatible with future ROM releases (or may not - I don't know exactly, so please check compatibility before flashing).
Please check Post #25 for details about compatibility between fixes and ROM versions, and how to check compatibility if your ROM isn't listed.
You can use Magisk module from Post #32 instead of flashing the ZIP files directly to the /vendor/ (just replace existing .so files in Magisk module ZIP with desired versions (using any ZIP archiver) and install the module).
4PDA.ru post (in Russian)
@S-trace
please can modify for me the one for xz3 and for xzp. thank u
I assume root is needed?
karrouma said:
@S-trace
please can modify for me the one for xz3 and for xzp. thank u
Click to expand...
Click to collapse
Please upload necessary files here and tell me device models and firmware versions of each device you need, and which current should i set.
mEREHAIGE said:
I assume root is needed?
Click to expand...
Click to collapse
Yes, you must get root using Magisk (or disable verity on /vendor/ in any other way) before installing this mod, or you may get bootloop.
Root access itself is not necessary for mod to work, just disabled verity is needed (but installing Magisk is the easiest way to get this for me)
@S-trace
can you make a 350ma for pie version of xz1c
it is same as xzp
Can you make some medium for xz1c? Like 250 ?
karrouma said:
@S-tracecan you make a 350ma for pie version of xz1c
it is same as xzp
Click to expand...
Click to collapse
Done.
manuerduarte said:
Can you make some medium for xz1c? Like 250 ?
Click to expand...
Click to collapse
Done.
Thanks!
S-trace said:
Done.
Done.
Click to expand...
Click to collapse
Thank you my friend.
Teting the 350 and 400
400 is better in all condition for cam
And 400 has no heat so it is fine for daily use.
Thank you for your work
Here for xz3
Attached
Can you modified to 400ma
Thank you
Hi,
This is a welcome patch. It used to be (on Z3C) to just change flashled_calc_parameters file - do you think it's still possible on XZ1C? Can you share more details on how exactly you patch the .so files?
gshegosh81 said:
Hi,
This is a welcome patch. It used to be (on Z3C) to just change flashled_calc_parameters file - do you think it's still possible on XZ1C? Can you share more details on how exactly you patch the .so files?
Click to expand...
Click to collapse
Is there anyway, we can control the current that goes to the flash on the go?
S-trace said:
Done.
Done.
Click to expand...
Click to collapse
@S-trace
Can i take a little bit from your time
Can you make an 450ma and 500 for me.
Thank you
rsk_kelkar said:
Is there anyway, we can control the current that goes to the flash on the go?
Click to expand...
Click to collapse
You can use following script for testing different current values:
Code:
#!/system/bin/sh
toggle=$(cat /sys/class/leds/led:switch_0/brightness)
if [ "$toggle" = "0" ];then
echo 60 > /sys/class/leds/led:torch_0/brightness
echo 60 > /sys/class/leds/led:torch_1/brightness
echo 1 > /sys/class/leds/led:switch_0/brightness
echo "on"
else
echo 0 > /sys/class/leds/led:torch_0/brightness
echo 0 > /sys/class/leds/led:torch_1/brightness
echo 0 > /sys/class/leds/led:switch_0/brightness
echo "off"
fi
60 means 120mA here, stock value is 13 (25mA).
I don't know any way to control flashlight current dynamically from the Android OS (like display brightness can be controlled).
karrouma said:
@S-trace
Can i take a little bit from your time
Can you make an 450ma and 500 for me.
Thank you
Click to expand...
Click to collapse
No, it won't work (I tried) - kernel will limit current to 400mA. Maybe it will be possible if you will patch kernel/dt to overcome this limit, but I'm not sure.
S-trace said:
You can use following script for testing different current values:
Code:
#!/system/bin/sh
toggle=$(cat /sys/class/leds/led:switch_0/brightness)
if [ "$toggle" = "0" ];then
echo 60 > /sys/class/leds/led:torch_0/brightness
echo 60 > /sys/class/leds/led:torch_1/brightness
echo 1 > /sys/class/leds/led:switch_0/brightness
echo "on"
else
echo 0 > /sys/class/leds/led:torch_0/brightness
echo 0 > /sys/class/leds/led:torch_1/brightness
echo 0 > /sys/class/leds/led:switch_0/brightness
echo "off"
fi
60 means 120mA here, stock value is 13 (25mA).
I don't know any way to control flashlight current dynamically from the Android OS (like display brightness can be controlled).
No, it won't work (I tried) - kernel will limit current to 400mA. Maybe it will be possible if you will patch kernel/dt to overcome this limit, but I'm not sure.
Click to expand...
Click to collapse
Thank you
Can you use this on lineageos?
karrouma said:
Here for xz3
Attached
Can you modified to 400ma
Thank you
Click to expand...
Click to collapse
Modified
Can you tell exact ROM version (from which you have taken libraries) to let me upload these patched libraries and original libraries to the OP?
4684361 said:
Can you use this on lineageos?
Click to expand...
Click to collapse
This depends on LineageOS you have.
gshegosh81 said:
Hi,
This is a welcome patch. It used to be (on Z3C) to just change flashled_calc_parameters file - do you think it's still possible on XZ1C? Can you share more details on how exactly you patch the .so files?
Click to expand...
Click to collapse
I'm think /vendor/etc/flashled_calc_parameters.cfg holds only camera flash parameters, not torch parameters.
But you may try to edit this file if you want.
Details about patching (offsets is for XZ1c):
Code:
32bit 8.0: (Thumb-2)
0x3F52 ALL 23=>22
0x3F9A 300 00E0FFE746F2A810=>49F2E030C0F20400
0x3F9A 400 00E0FFE746F2A810=>41F68020C0F20600
64bit 8.0: (ARM64)
0x4BBC ALL 0003=>E002
0x4C18 300 020000140100001400358CD2=>007C92D28000A0F21F2003D5
0x4C18 400 020000140100001400358CD2=>005083D2C000A0F21F2003D5
32bit 9.0: (Thumb-2)
0x4D52 ALL 3C=>3B
0x4DCC 250 00E0FFE746F2A810=>4DF29000C0F20300
0x4DCC 350 00E0FFE746F2A810=>45F23070C0F20500
0x4DCC 400 00E0FFE746F2A810=>41F68020C0F20600
64bit 9.0: (ARM64)
0x5CAC ALL E0=>C0
0x5D64 250 020000140100001400358CD2=>00129AD26000A0F21F2003D5
0x5D64 350 020000140100001400358CD2=>00E68AD2A000A0F21F2003D5
0x5D64 400 020000140100001400358CD2=>005083D2C000A0F21F2003D5
Payloads:
32bit:
MOVW R0, #0x1A80
MOVT R0, #6
64bit:
MOVZ X0, #0x1A80
MOVK X0, #0x6, LSL #16
NOP
The first one-byte patch is just a fixup for BEQ offset (to make it jump to correct offset, because we need 4 extra bytes to insert one more instruction, so we'll replace two useless B opcodes with MOV* instructions).
The second multi-byte patch is a payload, in this example MOV* instructions store 0x61A80 (400000) in R0/X0.
You may use http://armconverter.com/ to assemble payload with desired current value and then use HEX editor to patch your libraries (32bit is more important, i don't know who and when will use 64bit library, but patch it too just to leave OS libraries consistent).
S-trace said:
Modified
Can you tell exact ROM version (from which you have taken libraries) to let me upload these patched libraries and original libraries to the OP?
This depends on LineageOS you have.
I'm think /vendor/etc/flashled_calc_parameters.cfg holds only camera flash parameters, not torch parameters.
But you may try to edit this file if you want.
Details about patching (offsets is for XZ1c):
Code:
32bit 8.0: (Thumb-2)
0x3F52 ALL 23=>22
0x3F9A 300 00E0FFE746F2A810=>49F2E030C0F20400
0x3F9A 400 00E0FFE746F2A810=>41F68020C0F20600
64bit 8.0: (ARM64)
0x4BBC ALL 0003=>E002
0x4C18 300 020000140100001400358CD2=>007C92D28000A0F21F2003D5
0x4C18 400 020000140100001400358CD2=>005083D2C000A0F21F2003D5
32bit 9.0: (Thumb-2)
0x4D52 ALL 3C=>3B
0x4DCC 250 00E0FFE746F2A810=>4DF29000C0F20300
0x4DCC 350 00E0FFE746F2A810=>45F23070C0F20500
0x4DCC 400 00E0FFE746F2A810=>41F68020C0F20600
64bit 9.0: (ARM64)
0x5CAC ALL E0=>C0
0x5D64 250 020000140100001400358CD2=>00129AD26000A0F21F2003D5
0x5D64 350 020000140100001400358CD2=>00E68AD2A000A0F21F2003D5
0x5D64 400 020000140100001400358CD2=>005083D2C000A0F21F2003D5
Payloads:
32bit:
MOVW R0, #0x1A80
MOVT R0, #6
64bit:
MOVZ X0, #0x1A80
MOVK X0, #0x6, LSL #16
NOP
The first one-byte patch is just a fixup for BEQ offset (to make it jump to correct offset, because we need 4 extra bytes to insert one more instruction, so we'll replace two useless B opcodes with MOV* instructions).
The second multi-byte patch is a payload, in this example MOV* instructions store 0x61A80 (400000) in R0/X0.
You may use http://armconverter.com/ to assemble payload with desired current value and then use HEX editor to patch your libraries (32bit is more important, i don't know who and when will use 64bit library, but patch it too just to leave OS libraries consistent).
Click to expand...
Click to collapse
52.0.A.3.84 xz3
karrouma said:
52.0.A.3.84 xz3
Click to expand...
Click to collapse
Thank you.
Uploaded files to the OP.
S-trace said:
Thank you.
Uploaded files to the OP.
Click to expand...
Click to collapse
Thank you

[KERNEL][CM13] Kernel with ZRAM swap

Hello! After many years without development, today I'm sharing a new kernel with ZRAM and swap support for this device.
The kernel is based upon weritos' Cyanogenmod 13 kernel source code and should work on both rev. 1 and rev. 2 devices.
Installation procedure is as follows:
1. Download the latest TWRP, kernel build and modules.
2. Install the kernel and TWRP from ADB shell (the device must be booted into Android) or a terminal app:
Bash:
su (from a terminal app; not required from ADB shell)
cat </path/to/TWRP_image> > /dev/block/mmcblk0p13
cat </path/to/kernel_image> > /dev/block/mmcblk0p8
reboot recovery
3. Install the kernel modules:
Bash:
mount /dev/block/mmcblk0p21 /system
unzip -o </path/to/modules.zip> -d /system/lib/modules
4. Done! Reboot into Android.
NOTE: The < and > symbols should never be issued within the commands!
Version Information
Status: Beta (Bluetooth, camera recording and screen recording do not work.)
Created: 2021-05-11
Last Updated: 2021-05-12 (Import and enable Ultra KSM driver.)
I still have this device, will this kernel with twrp installed fix the crashing problems in cm 13, thanks for your effort
@Krush206 it's saying can't open zip file on the last step, how to fix??
SerjSX said:
@Krush206 it's saying can't open zip file on the last step, how to fix??
Click to expand...
Click to collapse
fixed it, I was supposed to write:
Code:
unzip -o /sdcard/modules.zip -d /system/lib/modules
instead of:
Code:
unzip -o /storage/emulated/0/modules.zip -d /system/lib/modules
in TWRP terminal.
However, how do I know if it successfully worked?? My phone booted up normally but no sign that shows if it worked 100% or not. @Krush206
not working
Turkish developers said:
I still have this device, will this kernel with twrp installed fix the crashing problems in cm 13, thanks for your effort
Click to expand...
Click to collapse
This is the reason I exported the ZRAM driver to the kernel. However, I have noticed it breaks Wi-Fi, so I will have to fix it for proper testing.
SerjSX said:
However, how do I know if it successfully worked?? My phone booted up normally but no sign that shows if it worked 100% or not.
Click to expand...
Click to collapse
Either install Termux (or a terminal app of your choice) or use ADB and issue the free -m command.
Krush206 said:
This is the reason I exported the ZRAM driver to the kernel. However, I have noticed it breaks Wi-Fi, so I will have to fix it for proper testing.
Either install Termux (or a terminal app of your choice) or use ADB and issue the free -m command.
Click to expand...
Click to collapse
Hi, thanks for your response. Just did i and looks like it worked, 59 total swap, used 58, and free 541.
Are you sure you checked the correct line? The total should be 255 (256), not 59.
can you compile a kernel for overclocking in stock room or cm 11 please our quttro needs it now
overclock kernel pls
Sorry for the delay. The battery of my device has swollen, so I cannot really check whether overclocking is possible or not.
However, though overclocking may be possible, it may cause system instability and crashes.
I could probably have a look at the code and see how to get it done, but I cannot post results and would not recommend overclocking.
The battery in my device was swollen, I found a battery and the best software for this device is 4.1.2. I want to try overclocking for this version. Bide 4.1.2 also does not play hd videos in the original software. Is there a code or a mod for this?
1.5 Ghz overclock pls
any update?
If you two, @Fever070720, @Turkish developers, are still looking into overclocking, please, send the output of the following command:
Code:
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq

How To Guide Force 120Hz MIUI 13 & MIUI 14

This is a thread for those who don't want to root their device to force 120Hz on every app.​If you are looking for a root solution, then use the LSPosed module called MIUI Performance Saver - Download here
In this way, you can force 120Hz in applications such as: YouTube, MX Player, Google Maps and many others that run at 60Hz by default in MIUI.
You will notice the changes, but you can check it by turning on the refresh rate counter in developer options and check the changes before and after.
​First method via ADB
1. In your device, in developer options, enable usb debugging and usb debugging (security settings) and connect your phone to the PC.
2. Download platform tools and extract to a folder
3. Open console in the platform tools folder
4. Enter the following command:
For MIUI 13:
Code:
adb shell settings put system user_refresh_rate 1
For MIUI 14:
Code:
adb shell settings put secure user_refresh_rate 1
If first method doesn't work for you, then try second method.
Second method via Settings Database Editor app
Download this app from the Play Store and for it to work properly, download and install this file from github (settings-database-provider.apk).
For MIUI 13:
1. Open Settings Database Editor app
2. Search "user_refresh_rate"
3. Cick on it to edit the value and replace 120 with 1 and save changes
4. Done
For MIUI 14:
MIUI 14 requires you to grant permissions to the Settings Database Provider app via ADB
1. In your device, in developer options, enable usb debugging and usb debugging (security settings) and connect your phone to the PC.
2. Download platform tools and extract to a folder
3. Open console in platform tools folder
4. Enter the following command:
Code:
adb shell pm grant com.netvor.settings.database.provider android.permission.WRITE_SECURE_SETTINGS
5. Open Settings Database Editor app
6. Search "user_refresh_rate"
7. Cick on it to edit the value and replace 120 with 1 and save changes
8. Done
Keep in mind that it may not work because Xiaomi changes something under the hood of the updates.
I dont know what to say, force fps can cause useless battery drain on app that dont really need ... Do you really need 120hz when you send sms or making call or even messenger ... All do what they want but i wont use it
snx413 said:
I dont know what to say, force fps can cause useless battery drain on app that dont really need ... Do you really need 120hz when you send sms or making call or even messenger ... All do what they want but i wont use it
Click to expand...
Click to collapse
I've been using this method since I had the Poco F3 and I've never noticed that the battery was draining much because of it. I'm used to 120Hz and find it irritating to suddenly switch to 60Hz when scrolling in YouTube or some other app. I am not forcing anyone to force 120Hz on their devices.
Yeah but its most of the time at 120 btw, only you tube and tik tok seems to lower it at 60,
I miss my poco f3... They have all custom rom they want pfff, i sold to my brother ...
root and non root method doesnt work for my poco f3 with xiaomi.eu, i tried global too
HappyTrix said:
root and non root method doesnt work for my poco f3 with xiaomi.eu, i tried global too
Click to expand...
Click to collapse
Can you provide more information? Any errors when executing commands in ADB? Can't find user_refresh_rate in setedit app? It's impossible that it wouldn't work on Poco F3, because I had this device until recently (now I don't have it anymore) and both methods worked perfectly in global ROMs and xiaomi.eu.
is there any way to force it from 120hz to 60hz instantly when i stop swiping? it only works when brightness is above 50%, if below 50% it's always 120hz
nhquocnam said:
is there any way to force it from 120hz to 60hz instantly when i stop swiping? it only works when brightness is above 50%, if below 50% it's always 120hz
Click to expand...
Click to collapse
This is MIUI, nothing can be done about it. You can try Magisk root + LSPosed "MIUI Performance Saver" module and force 120hz, which "maybe" will solve your problem, or you can wait for some custom rom that will hopefully come out for the Xiaomi 12T Pro someday, as long as Xiaomi releases kernel source code for this device.
I cant seem to get my ADB to work u have any guides? and there is no "console" in the platform tools folder please help me
uvzen said:
This is a thread for those who don't want to root their device to force 120Hz on every app.​If you are looking for a root solution, then use the LSPosed module called MIUI Performance Saver - Download here
In this way, you can force 120Hz in applications such as: YouTube, MX Player, Google Maps and many others that run at 60Hz by default in MIUI.
You will notice the changes, but you can check it by turning on the refresh rate counter in developer options and check the changes before and after.
​First method via ADB
1. In your device, in developer options, enable usb debugging and usb debugging (security settings) and connect your phone to the PC.
2. Download platform tools and extract to a folder
3. Open console in the platform tools folder
4. Enter the following command:
For MIUI 13:
Code:
adb shell settings put system user_refresh_rate 1
For MIUI 14:
Code:
adb shell settings put secure user_refresh_rate 1
Second method via SetEdit app
Download this app from Play Store
For MIUI 13:
1. Open Setedit app and scroll down to the end
2. Find "user_refresh_rate" "120"
3. Cick on it to edit the value and replace 120 with 1 and save changes
4. Done
For MIUI 14:
MIUI 14 requires you to grant permissions to the Setedit app via ADB
1. In your device, in developer options, enable usb debugging and usb debugging (security settings) and connect your phone to the PC.
2. Download platform tools and extract to a folder
3. Open console in the platform tools folder
4. Enter the following command:
Code:
adb shell pm grant by4a.setedit22 android.permission.WRITE_SECURE_SETTINGS
5. Open Setedit app
6. In the right corner, change the "System Table" tab to "Secure Table"
7. Scroll down to the end and find "user_refresh_rate" "120"
8. Cick on it to edit the value and replace 120 with 1 and save changes
9. Done
Click to expand...
Click to collapse
Thank you, useful af
I'm getting an error while running the adb command :
Exception occurred while executing 'put':
java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS
at com.android.providers.settings.SettingsProvider.enforceWritePermission(SettingsProvider.java:2331)
at com.android.providers.settings.SettingsProvider.mutateSecureSetting(SettingsProvider.java:1768)
at com.android.providers.settings.SettingsProvider.insertSecureSetting(SettingsProvider.java:1719)
at com.android.providers.settings.SettingsProvider.call(SettingsProvider.java:467)
at android.content.ContentProvider.call(ContentProvider.java:2533)
at android.content.ContentProvider$Transport.call(ContentProvider.java:530)
at com.android.providers.settings.SettingsService$MyShellCommand.putForUser(SettingsService.java:382)
at com.android.providers.settings.SettingsService$MyShellCommand.onCommand(SettingsService.java:278)
at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
at android.os.ShellCommand.exec(ShellCommand.java:38)
at com.android.providers.settings.SettingsService.onShellCommand(SettingsService.java:50)
at android.os.Binder.shellCommand(Binder.java:1054)
at android.os.Binder.onTransact(Binder.java:882)
at android.os.Binder.execTransactInternal(Binder.java:1290)
at android.os.Binder.execTransact(Binder.java:1249)
SooRaj SuResh said:
I'm getting an error while running the adb command :
Exception occurred while executing 'put':
java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS
at com.android.providers.settings.SettingsProvider.enforceWritePermission(SettingsProvider.java:2331)
at com.android.providers.settings.SettingsProvider.mutateSecureSetting(SettingsProvider.java:1768)
at com.android.providers.settings.SettingsProvider.insertSecureSetting(SettingsProvider.java:1719)
at com.android.providers.settings.SettingsProvider.call(SettingsProvider.java:467)
at android.content.ContentProvider.call(ContentProvider.java:2533)
at android.content.ContentProvider$Transport.call(ContentProvider.java:530)
at com.android.providers.settings.SettingsService$MyShellCommand.putForUser(SettingsService.java:382)
at com.android.providers.settings.SettingsService$MyShellCommand.onCommand(SettingsService.java:278)
at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
at android.os.ShellCommand.exec(ShellCommand.java:38)
at com.android.providers.settings.SettingsService.onShellCommand(SettingsService.java:50)
at android.os.Binder.shellCommand(Binder.java:1054)
at android.os.Binder.onTransact(Binder.java:882)
at android.os.Binder.execTransactInternal(Binder.java:1290)
at android.os.Binder.execTransact(Binder.java:1249)
Click to expand...
Click to collapse
Changing refresh rate via ADB doesn't work for me either. Xiaomi changed something in the permissions again during one of the updates. I just updated my thread, so try second method through the Settings Database Editor app, because I checked and it works for me on Xiaomi.eu weekly 23.5.22.
Very good find! I had it working on MIUI 13 but I had been waiting to get it working on MIUI 14 since forever, didn't know we had to modify the secure table for this. Also, do you know any more efficient ways to do this with root? I am always rooted.
SooRaj SuResh said:
I'm getting an error while running the adb command :
Spoiler: Code
Exception occurred while executing 'put':
java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS
at com.android.providers.settings.SettingsProvider.enforceWritePermission(SettingsProvider.java:2331)
at com.android.providers.settings.SettingsProvider.mutateSecureSetting(SettingsProvider.java:1768)
at com.android.providers.settings.SettingsProvider.insertSecureSetting(SettingsProvider.java:1719)
at com.android.providers.settings.SettingsProvider.call(SettingsProvider.java:467)
at android.content.ContentProvider.call(ContentProvider.java:2533)
at android.content.ContentProvider$Transport.call(ContentProvider.java:530)
at com.android.providers.settings.SettingsService$MyShellCommand.putForUser(SettingsService.java:382)
at com.android.providers.settings.SettingsService$MyShellCommand.onCommand(SettingsService.java:278)
at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
at android.os.ShellCommand.exec(ShellCommand.java:38)
at com.android.providers.settings.SettingsService.onShellCommand(SettingsService.java:50)
at android.os.Binder.shellCommand(Binder.java:1054)
at android.os.Binder.onTransact(Binder.java:882)
at android.os.Binder.execTransactInternal(Binder.java:1290)
at android.os.Binder.execTransact(Binder.java:1249)
Click to expand...
Click to collapse
Try with granting permission to the app. Even with that you will get an error which you can solve as follows:
How can I use adb to grant permission without root?
Background I'm trying to create an app that can grant and revoke permissions of other apps. To do this I'm using adb commands: pm grant packageName permissionName This works great if I call it
stackoverflow.com
Unknown.Guy said:
Also, do you know any more efficient ways to do this with root? I am always rooted.
Click to expand...
Click to collapse
If you have root then use LSPosed module MIUI Performance Saver.

Categories

Resources