Waydroid ready to go
终于有时间停下来写一写Android x86 的最新方法。其实我在去年也就是2021年6月份就开始注意到Waydroid, 刚开始的版本还很不稳定,Waydroid也经历各种修复以及Maintainer的更换。差不多在今年Base on Lineageos 18.1 正式推出以来就已经很稳定了,用黑话说就是GA啦。
之前我已经写过一篇在Linux PC 上使用Android 系统的文章,其实这个Waydroid的方法跟那个类似,也是基于容器,区别在于,anbox的图形框架是qemu_pipe 就是跟android studio android emulator上面那个没多少差别,也就是虚拟了支持OES的图形设备,然后按照android x86 那一套渲染到该设备,并且该设备的硬件加速图形映射到主机EGL窗口。而Waydroid 受到新android版本hwcomposer好处,基于之前collabora 的方案,把hwcomposer跟 wayland窗口的协议surface绑定,不再需要经过内存的图形copy啦。
目前各个发行版已经都可以方便的安装Waydroid 这里就不说啦。来说几个FAQ吧
我想安装arm app,怎么弄。
这里,https://github.com/casualsnek/waydroid_script 按步骤安装之后就可以使用
跑分怎么样?
基本跟host android x86 一样,性能是没损失的
显卡兼容?
intel 跟 amd 目前基于mesa框架直接用,最新补上了minigbm,
ro.hardware.gralloc=minigbm_gbm_mesa
ro.hardware.egl=mesa
pulseaudio 声音没啦?
你估计需要把 /run/user/1000/pulse 的权限设置成777,如果只有 -rw-rw---- ,android里面是没权限把声音输出来。
lxc老是自动休眠锁定
把 tools/actions/container_manager.py 里面 helpers.lxc.freeze(args) 注释掉吧。
明日方舟在16核cpu 以上电脑负载过高?
应该是unity3d的问题, Arknights needs additional config for better highend cpu scheduling, I had amd3900x that arknight's Unity graph eat all of the cores, Installing lxcfs and limits to 4 cpus got this issue resolved.
lxc.cgroup2.cpuset.cpus = 0-3
lxc.mount.entry = /var/lib/lxcfs/sys/devices/system/cpu sys/devices/system/cpu none bind 0 0
lxc.mount.entry = /var/lib/lxcfs/sys/devices/system/cpu/online sys/devices/system/cpu/present none bind,ro,create=file,optional 0 0