New Post: Anbox on the Librem 5

That’s not what I’m saying.
There are versions of the android kernel that integrate driver for the rear camera sensor of the Librem 5:

Anbox, like other virtual machine, doesn’t come with android, you have to had and image.

Ahh, so you are asking if Purism have a working Android camera driver?

Neither do I!
This driver already exists (see previous message). They talk about it in the dedicated git:

I’m wondering if this driver is usable with Anbox via a custom android kernel or if the camera driver needs to be integrated into the Librem 5’s linux kernel before.

1 Like

The Librem5 uses the same camera as the Samsung A20e.

3 Likes

This I did not know.

Suddenly this line of questioning makes a ton of sense.

4 Likes

Android camera drivers use a different camera management system, so the Android driver cannot be used as a base for the mainline Linux driver.

If the question is about passthrough of just the camera device to some emulator and then using a driver in the emulator, then… yeah, no. The camera is not connected over PCI or USB, so any kind of passthrough would require a special driver. I haven’t heard of MIPI-CSI passthrough, so you can be fairly sure that the camera is going to be supported natively before any such solution appears.

12 Likes

Thank you good sir, for shedding some light on this subject. I get that for some the camera is very important, but for me it is the absolute bottom of the pile. Just knowing that the hardware is there and will be implemented one day is more than enough.

3 Likes

I will gladly test it when I have my L5 and camera is implemented

I will also test integration via anyone’s suggestions. It’s the only thing keeping me carrying an Android phone.

Once I can do stable passthrough though qemu, I will be sure to share how I did it, and I will gladly ditch my Android devices :smiley:

AS FAR AS I CAN TELL ON BYZANTIUM… THIS DOESN’T WORK…

The instructions here are for amber-phone

The modules in byzantium are essentially not found. Run sudo modprobe ashem_linux and you’ll get a “cant find the modules” error in the kernel directory.

They are present in the kernel but not probable…

❯ sudo ls -1 /dev/{ashmem,binder}
/dev/ashmem
/dev/binder

So build the dang kernel modules and install them with dkms" you say… that returns an error because the headers are missing… so we sudo apt-install linux headers right and build again… ah progress… wrong… apparently the dkms scripts make a kernel call that has been deprecated and is no longer included in the kernel shipped with byzantium… hell. Pure hell. I would love to know how to redefine it in this script and fix it myself but I am reaching a dead end with this effort.

sudo dkms install anbox-ashmem/1

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j4 KERNELRELEASE=5.13.0-1-librem5 all KERNEL_SRC=/lib/modules/5.13.0-1-librem5/build..........(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.13.0-1-librem5 (aarch64)
Consult /var/lib/dkms/anbox-ashmem/1/build/make.log for more information.

Logs

ERROR: modpost: "kallsyms_lookup_name" [/var/lib/dkms/anbox- 
ashmem/1/build/ashmem_linux.ko] undefined!

Additionally the binaries in the CI pipeline appear to also be for amber singularly. In order to install it on byzantine you have to pull the boost libraries from the amber deb repos.

Finally there hasn’t been a new binary for the librem5 on that repo for 11 months. Unless this post is using an unreleased binary or they built it just for the video and are running a kernel that is also unavailable… I don’t see how this would work on Byzantium at all at this point. They’d have to be using amber and doing something I haven’t thought of at this point… After being on byzantine for a couple weeks, I can’t understand how they’d be building for amber at this point either because byzantine is much more stable and further along.

If i’m missing something please reply, otherwise I’m pretty sure this entire blog post about Anbox on librem 5 is invalid. I haven’t been able to reproduce a working version on byzantine or amber.

For those who are curious here is some more information.

> ❯ sudo systemctl status anbox-container-manager.service
> ● anbox-container-manager.service - Anbox Container Manager
>      Loaded: loaded (/lib/systemd/system/anbox-container-manager.service; enabled; vendor preset: ena>
>      Active: failed (Result: exit-code) since Tue 2021-10-05 10:10:53 CDT; 21min ago
>        Docs: man:anbox(1)
>     Process: 629 ExecStartPre=/sbin/modprobe ashmem_linux (code=exited, status=1/FAILURE)
>     Process: 635 ExecStopPost=/usr/share/anbox/anbox-bridge.sh stop (code=exited, status=1/FAILURE)
>         CPU: 21ms
> 
> Oct 05 10:10:53 librem-5-usa systemd[1]: Starting Anbox Container Manager...
> Oct 05 10:10:53 librem-5-usa modprobe[629]: modprobe: FATAL: Module ashmem_linux not found in directo>
> Oct 05 10:10:53 librem-5-usa systemd[1]: anbox-container-manager.service: Control process exited, cod>
> Oct 05 10:10:53 librem-5-usa anbox-bridge.sh[635]: anbox-bridge isn't running
> Oct 05 10:10:53 librem-5-usa systemd[1]: anbox-container-manager.service: Control process exited, cod>
> Oct 05 10:10:53 librem-5-usa systemd[1]: anbox-container-manager.service: Failed with result 'exit-co>
> Oct 05 10:10:53 librem-5-usa systemd[1]: Failed to start Anbox Container Manager.

❯ anbox system-info
version: 0.0~git20210625-1-Debian
cpu:
  arch:  
  brand: 
  features: 
os:
  name: PureOS
  version: 
  snap-based: false
kernel:
  version: Linux version 5.13.0-1-librem5 (builder@cumin-landing-arm64-1wvv) (aarch64-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP PREEMPT Tue Sep 28 14:24:49 PDT 2021
  binder: true
  binderfs: false
  ashmem: true
graphics:
  egl:
    vendor: n/a
    version: n/a
    extensions:
      - n/a
  gles2:
    vendor: n/a
    vendor: n/a
    extensions: []

What android.img and I using? this one

I am chasing down one last lead which says the librem devs helped get it working on pinephone 64 back in April but afterwards I’m probably going to quit this and focus on getting the apps I need natively in linux arm64 and keep carrying around the iphone like a swiss army knife…

You’re not expected to install the kernel modules. README in the repository is upstream readme, not related specifically to Librem 5.

On byzantium, you need to use pureos/byzantium branch (which is now the default): https://source.puri.sm/Librem5/debs/anbox/-/tree/pureos/byzantium/ - take the deb artifacts from there.

Additionally the binaries in the CI pipeline appear to also be for amber singularly.

That’s not true, artifacts for byzantium are there as well: https://source.puri.sm/Librem5/debs/anbox/-/jobs/364593/artifacts/browse/debian/output/

Not sure why they’re not shown on the pipelines page, but once you select the job they’re available to download.

BTW. Anbox isn’t currently officially supported, this is just an experimental thing I’ve made working on the side. There are lots of rough edges there - it may work fine for your needs (it works fine for me with my banking app for example), but generally don’t expect a smooth experience.

7 Likes

Okay I will give this a shot. I couldn’t find those binaries for byzantium to save my life. Also, I’m under no impression that its going to be smooth. I just need a couple of things (like a banking app or signal) to emulate. If I get a working how to I’ll post it back here.

@dos Looks like there is a piece missing from this setup.

❯ anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity

[ 2021-10-05 16:36:16] [daemon.cpp:61@Run] [org.freedesktop.DBus.Error.ServiceUnknown] The name org.anbox was not provided by any .service files

❯ dbus-send --session --dest=org.anbox --type=method_call --print-reply /org/anbox org.freedesktop.DBus.Introspectable.Introspect

Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.anbox was not provided by any .service files

Maybe if you have sometime soon you could update the instructions for a fresh install because there seems to be something missing from the current instructions?

Also, thank you for working on this. I know this isn’t officially supported but I appreciate you working on it. Got a place ($$) to support the work?

There is the fund-your-app initiative from Purism: https://puri.sm/fund-your-app/ It’s for apps and OS / driver optimizations so I think Anbox could fit there. However, it isn’t listed there (thought I have seen it there in the past…) but you could suggest it in the bottom form and donate. :slight_smile:

He may have posted this on purism site but I’ve been told by no less than 3 different people at the company that this is not officially supported. If they aren’t officially supporting it, I’d prefer to contribute directly.

1 Like

I just tried this, and managed to get the artifacts.zip. Following the wiki, I run into problems with the anbox-image-builder. Running ./build.sh --sudo fails with the message that gcc-multilib has no install candidate.

Any ideas?

Did you try to follow this guide? It’s probably more recent: https://source.puri.sm/Librem5/community-wiki/-/wikis/Frequently-Asked-Questions#314-how-are-android-apps-installed-in-the-librem-5.

Yes, I did. In the step where I need to make an image, by running the script:

cd anbox-image-builder
./build.sh --sudo
./assemble.sh

The build.sh fails with the message:

Package gcc-multilib is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package ‘gcc-multilib’ has no installation candidate

2 Likes

I hope it is not an empty post, when I confirm the problem of @soemraws on my Librem 5 Evergreen. I already tried to install anbox once two weeks ago and deinstalled all that day installed packages due to failure and the message that the system is unable to locate the following libraries:

  • g++-multilib
  • libc6-dev-i386
  • lib32ncurses5-dev
  • lib32z-dev

Trying to install gcc-multilib results in the same error as reported by @soemraws. I must also confess that I don’t understand why an i386 and 32bit libraries are required to build an application for an arm64 processor. The system has already libc6-dev installed, so does anybody know why this library is not used to build anbox?