Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Version #390

Open
memtech3 opened this issue Dec 4, 2022 · 28 comments
Open

Android Version #390

memtech3 opened this issue Dec 4, 2022 · 28 comments
Labels
enhancement New feature or request help wanted Someone would need to volunteer to address this issue

Comments

@memtech3
Copy link

memtech3 commented Dec 4, 2022

It would be super cool if there was an Android version of the full rnote. In another feature request (#245) , a commenter mentioned compiling to webassembly to bring android support. I think as long as the compiled webassembly version was distributed as a PWA that could be installed and used offline that would satisfy this feature request

Some context: I am a college student and my day to day loadout is a laptop (non touch) and android tablet with stylus (Galaxy Tab S6 Lite) as it is more convenient than carrying my wired Wacom tablet around to classes.

@flxzt flxzt added the enhancement New feature or request label Dec 4, 2022
@flxzt flxzt changed the title Android/IOS Version Android Version Dec 4, 2022
@pktiuk
Copy link

pktiuk commented Dec 4, 2022

As a first step of checking doability of this task it should be checked whether base libraries (like GTK4) can be compiled into webassembly.

To check convergence and web browser compatibility you can run the current application with GTK4 Broadway backend.

The GDK Broadway backend provides support for displaying GTK applications in a web browser, using HTML5 and web sockets.

phoronix news about broadway

@flxzt flxzt added the help wanted Someone would need to volunteer to address this issue label Mar 18, 2023
@Shahin-rmz
Copy link

I can help with Kivy if this is helpful!

@pktiuk
Copy link

pktiuk commented Apr 1, 2023

@Shahin-rmz How using Kivy is supposed to help? Kivy is Python framework, but Rnote is written with Rust and GTK4.
Do I miss something?

@dbrandonjohnson
Copy link

I'm uncertain if this would help: https://github.com/tauri-apps/tauri-mobile

@Beryesa
Copy link

Beryesa commented Aug 22, 2023

I wonder if there can be a file-format compatible side project for android.
I haven't taken a look at the source code yet but if the core logic and gtk bindings are modularly implemented, maybe a rust+flutter branch can be maintained without too much effort. (High likely much easier than trying to get any gtk on android?)

I don't have enough knowledge in either of them but in the case of no interest/time, perhaps I can try to step up and contribute, saving students from searching endlessly for a proper but cross platform foss annotation software, myself included, at some time in the future (next year?), together :3

@AloneAlexandros
Copy link

How is this going? Is there a android/web version in development?

@mistune
Copy link

mistune commented Mar 24, 2024

Trying to build this in version 0.8.2 where most of the dependencies in termux are available without manually building the dependencies. I'm currently stuck with the package gettext-sys. I pasted the logs here, hopefully someone more knowledgeable can help debug this. termux/termux-packages#17655 (comment)

EDIT: Tried compiling in a Fedora environment but seems Termux crashes during the last package to be compiled.

EDIT2: Somebody compiled this for aarch64 and just installed it from there.

EDIT3: Running this on Termux-x11 + Hardware Acceleration through virgl and I am getting close to native performance on my tablet.

@AloneAlexandros
Copy link

Trying to build this in version 0.8.2 where most of the dependencies in termux are available without manually building the dependencies. I'm currently stuck with the package gettext-sys. I pasted the logs here, hopefully someone more knowledgeable can help debug this. termux/termux-packages#17655 (comment)

EDIT: Tried compiling in a Fedora environment but seems Termux crashes during the last package to be compiled.

EDIT2: Somebody compiled this for aarch64 and just installed it from there.

EDIT3: Running this on Termux-x11 + Hardware Acceleration through virgl and I am getting close to native performance on my tablet.

that's great! is there a build somewhere or do i have to build this myself? i would rather not

@mistune
Copy link

mistune commented Apr 2, 2024

@DeltriDev I used the build here https://fedora.pkgs.org/39/terra/rnote-0:0.10.1-1.fc39.aarch64.rpm.html.

@PhilDevProg
Copy link
Contributor

If someone makes a Flutter version in the future, maybe the flutter_rust_bridge could be helpful for reusing code instead of having to rewrite everything.

@PhilDevProg
Copy link
Contributor

Someone's working on an Android backend for Gtk: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/7555

@sound-friend
Copy link

man i would love to see something like this just so i can check my notes on my phone!!

@EDLLT
Copy link

EDLLT commented Sep 20, 2024

termux/termux-packages#21524

I managed to get RNote to work in Android natively(no proot/chroot) through termux with hardware acceleration

@sound-friend
Copy link

could you let us know how you did it? what's the performance like?

@EDLLT
Copy link

EDLLT commented Sep 20, 2024

could you let us know how you did it? what's the performance like?

Performance is much more better than chroot and proot, especially for large rnote files

Also it responds correctly to touch for panning/zooming and pen for writing

I did it by patching rnote and several crates to compile against Android's bionic libc(Check PR above)

Soon enough once the merging with termux packages is done, installing rnote will be as easy as "pkg install rnote"

If you're in the termux discord or rnote dev matrix channel then you'll find that I've sent a short video there demonstrating rnote

@EDLLT
Copy link

EDLLT commented Sep 20, 2024

could you let us know how you did it? what's the performance like?

Performance is much more better than chroot and proot, especially for large rnote files

Also it responds correctly to touch for panning/zooming and pen for writing

I did it by patching rnote and several crates to compile against Android's bionic libc(Check PR above)

Soon enough once the merging with termux packages is done, installing rnote will be as easy as "pkg install rnote"

If you're in the termux discord or rnote dev matrix channel then you'll find that I've sent a short video there demonstrating rnote

If you're interested in how to setup termux then read these in order

https://github.com/EDLLT/Termux-Desktops/blob/main/Documentation/terminology.md

https://github.com/EDLLT/Termux-Desktops/blob/main/Documentation/native/termux_native.md

https://github.com/EDLLT/Termux-Desktops/blob/main/Documentation/HardwareAcceleration.md#hardware-acceleration-in-native-termux--

(When setting up hardware acceleration, use zink instead of kgsl since that's still being developed)

@mistune
Copy link

mistune commented Sep 24, 2024

termux/termux-packages#21524

I managed to get RNote to work in Android natively(no proot/chroot) through termux with hardware acceleration

Is this in the repos now? Doing a pkg search rnote does not show rnote yet

@relma2
Copy link

relma2 commented Sep 25, 2024

The pull request to get rnote onto the termux repos has been merged! I am running pkg install rnote in termux right now

@relma2
Copy link

relma2 commented Sep 25, 2024

Ok, running into several issues. Will go home and resume troubleshooting.

@sound-friend
Copy link

when i run it it says it can't find the package... interesting

@relma2
Copy link

relma2 commented Sep 25, 2024

when i run it it says it can't find the package... interesting

Install the x11 repo first with pkg install x11-repo

@relma2
Copy link

relma2 commented Sep 25, 2024

@sound-friend , @EDLLT , and I were in the termux discord the other night getting EDLLT's packaging of Rnote to work in Termux. It... kind of works, the application loads, but there are several issues. The steps I did to get it """working""" were:

  1. Install Termux from F-Droid (NOT the Google Play store!!)
  2. Install the Termux-X11 Nightly Apk fron Github
  3. In Termux, run pkg install x11-repo to enable the X11 Repo of packages
  4. Run pkg install rnote xfce4 to install Rnote and the XFCE Desktop Environment
  5. Run the XFCE Desktop Environment with termux-x11 :1 -xstartup "dbus-launch --exit-with-session xfce4-session"
  6. Back in Termux, install Hardware acceleration with pkg install mesa-vulkan-icd-freedreno-dri3
  7. Open the Termux X11 App. You should see an XFCE Desktop environment running with a little mouse wallpaper.
  8. In a Terminal WITHIN THE XFCE ENVIRONMENT (not termux), run MESA_LOADER_DRIVER_OVERRIDE=zink rnote
  9. Rnote opens! You can draw on it, but maximizing the window causes the app to segfault. Pen pressure also does not work.

Tl;dr -- this approach is nowhere near a functioning "android version" of Rnote. We should probably look into compiling GTK natively on Android or something; this approach uses too many workarounds and the app doesen't have full functionality and segfaults.

@PhilDevProg
Copy link
Contributor

@sound-friend , @EDLLT , and I were in the termux discord the other night getting EDLLT's packaging of Rnote to work in Termux. It... kind of works, the application loads, but there are several issues. The steps I did to get it """working""" were:

  1. Install Termux from F-Droid (NOT the Google Play store!!)
  2. Install the Termux-X11 Nightly Apk fron Github
  3. In Termux, run pkg install x11-repo to enable the X11 Repo of packages
  4. Run pkg install rnote xfce4 to install Rnote and the XFCE Desktop Environment
  5. Run the XFCE Desktop Environment with termux-x11 :1 -xstartup "dbus-launch --exit-with-session xfce4-session"
  6. Back in Termux, install Hardware acceleration with pkg install mesa-vulkan-icd-freedreno-dri3
  7. Open the Termux X11 App. You should see an XFCE Desktop environment running with a little mouse wallpaper.
  8. In a Terminal WITHIN THE XFCE ENVIRONMENT (not termux), run MESA_LOADER_DRIVER_OVERRIDE=zink rnote
  9. Rnote opens! You can draw on it, but maximizing the window causes the app to segfault. Pen pressure also does not work.

Tl;dr -- this approach is nowhere near a functioning "android version" of Rnote. We should probably look into compiling GTK natively on Android or something; this approach uses too many workarounds and the app doesen't have full functionality and segfaults.

There seems to be a problem with the Zink driver on my device (Pixel 8a):
https://github.com/user-attachments/assets/a22b6b0f-e744-471d-85e9-5129678f909c

When I run Rnote without `MESA_LOADER_DRIVER_OVERRIDE=zink, this doesn't happen.

@relma2
Copy link

relma2 commented Sep 25, 2024

When I run Rnote without `MESA_LOADER_DRIVER_OVERRIDE=zink, this doesn't happen.

Yeah, zink has a lot of issues. When I run without zink, I don't get the segfault on maximizing the window

@EDLLT
Copy link

EDLLT commented Sep 25, 2024

@sound-friend , @EDLLT , and I were in the termux discord the other night getting EDLLT's packaging of Rnote to work in Termux. It... kind of works, the application loads, but there are several issues. The steps I did to get it """working""" were:

  1. Install Termux from F-Droid (NOT the Google Play store!!)
  2. Install the Termux-X11 Nightly Apk fron Github
  3. In Termux, run pkg install x11-repo to enable the X11 Repo of packages
  4. Run pkg install rnote xfce4 to install Rnote and the XFCE Desktop Environment
  5. Run the XFCE Desktop Environment with termux-x11 :1 -xstartup "dbus-launch --exit-with-session xfce4-session"
  6. Back in Termux, install Hardware acceleration with pkg install mesa-vulkan-icd-freedreno-dri3
  7. Open the Termux X11 App. You should see an XFCE Desktop environment running with a little mouse wallpaper.
  8. In a Terminal WITHIN THE XFCE ENVIRONMENT (not termux), run MESA_LOADER_DRIVER_OVERRIDE=zink rnote
  9. Rnote opens! You can draw on it, but maximizing the window causes the app to segfault. Pen pressure also does not work.

Tl;dr -- this approach is nowhere near a functioning "android version" of Rnote. We should probably look into compiling GTK natively on Android or something; this approach uses too many workarounds and the app doesen't have full functionality and segfaults.

There seems to be a problem with the Zink driver on my device (Pixel 8a):
https://github.com/user-attachments/assets/a22b6b0f-e744-471d-85e9-5129678f909c

When I run Rnote without `MESA_LOADER_DRIVER_OVERRIDE=zink, this doesn't happen.

Zink hardware acceleration is for Adreno GPUs, from my Google search, the Pixel 8a has a Mali GPU

In your case, running without zink makes it use llvmpipe which is a software rasterizer to run using the CPU(cpus are not designed for rendering so it's slow)

Instead, you could setup VirGL(Virtual opengl) for termux, it's a bit more complicated than zink so you'd need to ask people in the termux discord server)

@PhilDevProg
Copy link
Contributor

PhilDevProg commented Sep 25, 2024

Zink hardware acceleration is for Adreno GPUs, from my Google search, the Pixel 8a has a Mali GPU

In your case, running without zink makes it use llvmpipe which is a software rasterizer to run using the CPU(cpus are not designed for rendering so it's slow)

Instead, you could setup VirGL(Virtual opengl) for termux, it's a bit more complicated than zink so you'd need to ask people in the termux discord server)

Thanks for that tip. I got it working by using the following commands:
pkg install virglrenderer-android
virgl_test_server_android & and then started Rnote with this: GALLIUM_DRIVER=virpipe MESA_GL_VERSION_OVERRIDE=4.0 rnote

But it does crash when opening the side bar or the open file dialog (but opening files via the file manager works) with this error message:

../src/src/gallium/auxiliary/cso_cache/cso_context.c:407: void cso_unbind_context(struct cso_context *): assertion "maxsam <= PIPE_MAX_SAMPLERS" failed
Aborted

@mistune
Copy link

mistune commented Sep 26, 2024

Tried the following on two devices. You might have to test which one will work for your device. Run glmark2 to verify that hardware acceleration is working

Installation

Zink

pkg update && pkg upgrade -y && pkg install rnote xfce4 glmark2 angle-android mesa-zink-dev virglrenderer-android virglrenderer-mesa-zink vulkan-loader-android xorg-xrandr 

Turnip

pkg update && pkg upgrade -y && pkg install rnote xfce4 glmark2 mesa-vulkan-icd-freedreno-dri3

Start XFCE4

termux-x11 :1 -xstartup "dbus-launch --exit-with-session xfce4-session"

Run program

Zink

GALLIUM_DRIVER=zink MESA_GL_VERSION_OVERRIDE=4.0 rnote

Turnip

MESA_LOADER_DRIVER_OVERRIDE=zink rnote

@GurrenLagann114
Copy link

Any update on this???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Someone would need to volunteer to address this issue
Projects
None yet
Development

No branches or pull requests