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

Running Redroid on Raspberry Pi #67

Closed
kebugcheckex opened this issue Dec 10, 2021 · 86 comments
Closed

Running Redroid on Raspberry Pi #67

kebugcheckex opened this issue Dec 10, 2021 · 86 comments
Labels
enhancement New feature or request

Comments

@kebugcheckex
Copy link

I'm running Redroid on Raspberry Pi 4B. The OS is Ubuntu 20.04 (arm64).

Starting the container with default param works but the graphics is pretty laggy. It turns out that the rendering is done on CPU, instead of GPU. RPi has a pretty powerful GPU but I'm wondering how I can make use of it in Redroid.

Additional information:

  • lspci doesn't show and graphics device, probably because ARM device has a different architecture.
  • I have installed mesa driver and vulkan lib. 3D rendering works fine, which means the drivers are installed properly.

If this is not yet supported by Redroid, what is the path towards supporting it? Thanks.

@zhouziyang
Copy link
Member

zhouziyang commented Dec 10, 2021 via email

@mythsman
Copy link

I'm working on Raspberry 4B too , and I'm also tired of the terrible performance without gpu support....

Looking forward to your support 😄

@zhouziyang
Copy link
Member

zhouziyang commented Dec 21, 2021

@mythsman no Raspberry devices by hand. I add more GPU / SoC support in redroid11 , and you can build by yourself (or wait for images get updated by end of this month)

@mythsman
Copy link

@zhouziyang Grateful for your work , I don't have much experience working on Android , but I let me try it 👍

@zhouziyang zhouziyang added the enhancement New feature or request label Dec 21, 2021
@mythsman
Copy link

I saw you just merged that commit into redroid-11.0.0 , so I built that tag. I compiled it with redroid_arm64-userdebug successfully ,but that container cannot run on raspberry pi and just crashed (CrashLoopBackOff) ...

I don't know what I can do to fix ....

@mythsman
Copy link

The only operation I did which was different from your instruction is that I typed

sudo tar --xattrs -c vendor -C system --exclude="vendor" . > redroid.tar

then upload that redroid.tar to my raspberrypi

and then typed cat redroid.tar |docker import -c 'ENTRYPOINT ["/init", "qemu=1", "androidboot.hardware=redroid"]' - redroid

@mythsman
Copy link

mythsman commented Dec 24, 2021

After trying compling it with that commit reverted , I also got an image that always crashes .... I thought maybe I have done sth wrong ....

@zhouziyang
Copy link
Member

my fault, please update /device/redroid repo, and build again.
BTW, can you provide the drm driver name? (cat /sys/kernel/debug/dri/*/name)

@mythsman
Copy link

my fault, please update /device/redroid repo, and build again. BTW, can you provide the drm driver name? (cat /sys/kernel/debug/dri/*/name)

In my raspi ? It doesn't contains that dri directory in /sys/kernel/debug ...

@zhouziyang
Copy link
Member

debugfs mounted? what's the HOST OS? (ubuntu?)

try inside container, debugfs mounted there

@mythsman
Copy link

my HOST OS:
Linux version 4.19.95-19 (root@runner-857a6918-project-16016-concurrent-0) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)) #1 SMP Sun Feb 7 08:55:02 UTC 2021

In my HOST OS , /sys/kernel/debug is an empty dir...

@zhouziyang
Copy link
Member

try mount debugfs in Host: mount -t debugfs none /sys/kernel/debug/

@mythsman
Copy link

cirrus dev=0000:00:02.0 unique=0000:00:02.0

@mythsman
Copy link

BTW , I found that in my redroid.tar (from sudo tar --xattrs -c vendor -C system --exclude="vendor" . > redroid.tar ) , there was no vendor/ directory or system/vendor directory ... I thought maybe there was some problems...

@mythsman
Copy link

mythsman commented Dec 24, 2021

I just try running x86_64 in my HOST OS , and got :

[Fri Dec 24 14:21:06 2021] init: mkdir("/dev/pts", 0755) failed File exists
[Fri Dec 24 14:21:06 2021] init: mount("proc", "/proc", "proc", 0, "hidepid=2,gid=" MAKE_STR(AID_READPROC)) failed Device or resource busy
[Fri Dec 24 14:21:06 2021] init: mount("sysfs", "/sys", "sysfs", 0, NULL) failed Device or resource busy
[Fri Dec 24 14:21:06 2021] init: mount("selinuxfs", "/sys/fs/selinux", "selinuxfs", 0, NULL) failed No such file or directory
[Fri Dec 24 14:21:06 2021] init: mknod("/dev/kmsg", S_IFCHR | 0600, makedev(1, 11)) failed File exists
[Fri Dec 24 14:21:06 2021] init: mknod("/dev/random", S_IFCHR | 0666, makedev(1, 8)) failed File exists
[Fri Dec 24 14:21:06 2021] init: mknod("/dev/urandom", S_IFCHR | 0666, makedev(1, 9)) failed File exists
[Fri Dec 24 14:21:06 2021] init: mknod("/dev/ptmx", S_IFCHR | 0666, makedev(5, 2)) failed File exists
[Fri Dec 24 14:21:06 2021] init: mknod("/dev/null", S_IFCHR | 0666, makedev(1, 3)) failed File exists
[Fri Dec 24 14:21:06 2021] init: init first stage started!
[Fri Dec 24 14:21:06 2021] init: 8 output lines suppressed due to ratelimiting
[Fri Dec 24 14:21:06 2021] init: init second stage started!
[Fri Dec 24 14:21:06 2021] init: Failed to read /vendor/etc/selinux/plat_sepolicy_vers.txt: No such file or directory
[Fri Dec 24 14:21:06 2021] init: Could not read vendor SELinux version
[Fri Dec 24 14:21:06 2021] init: InitFatalReboot: signal 6
[Fri Dec 24 14:21:06 2021] init: #00 pc 00000000000ee80d  /system/bin/init (android::init::InitFatalReboot(int)+205)
[Fri Dec 24 14:21:06 2021] init: #01 pc 000000000006f490  /system/bin/init (android::init::InitAborter(char const*)+32)
[Fri Dec 24 14:21:06 2021] init: #02 pc 0000000000019cfc  /system/lib64/libbase.so (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_3::__invoke(char const*)+60)
[Fri Dec 24 14:21:06 2021] init: #03 pc 00000000000192a0  /system/lib64/libbase.so (android::base::LogMessage::~LogMessage()+368)
[Fri Dec 24 14:21:06 2021] init: #04 pc 00000000000f18e9  /system/bin/init (android::init::SelinuxGetVendorAndroidVersion()::$_2::operator()() const+601)
[Fri Dec 24 14:21:06 2021] init: #05 pc 00000000000f1677  /system/bin/init (android::init::SelinuxGetVendorAndroidVersion()+39)
[Fri Dec 24 14:21:06 2021] init: 7 output lines suppressed due to ratelimiting
[Fri Dec 24 14:21:06 2021] vetha084c9c: renamed from eth0

which was almost the same with that in my raspi

@zhouziyang
Copy link
Member

cirrus dev=0000:00:02.0 unique=0000:00:02.0

this GPU is not supported.

@mythsman
Copy link

cirrus dev=0000:00:02.0 unique=0000:00:02.0

this GPU is not supported.

Well , I don't think it was the point , because in my HOST OS(redhat) , I can run the online version of redroid-11.0.0 at least ...

@mythsman
Copy link

Sorry for disturbing again , I thought I just found where the bug was ....

In my HOST OS( redhat ) ,the tar version is 1.26 ,which will drop the vendor dir .... while in another OS which has a tar with version 1.30 , it won't drop the vendor ....

@mythsman
Copy link

I have successfully built the newest redroid-11.0.0 , but it seems still laggy in my raspi ... 😭

@zhouziyang
Copy link
Member

cirrus dev=0000:00:02.0 unique=0000:00:02.0

this GPU is not supported.

Well , I don't think it was the point , because in my HOST OS(redhat) , I can run the online version of redroid-11.0.0 at least ...

I means GPU accelerating not work on cirrus. You can try on SW rendering instead.

@mythsman
Copy link

mythsman commented Dec 24, 2021

cirrus dev=0000:00:02.0 unique=0000:00:02.0 was from my redhat machine , not my raspi ...

@mythsman
Copy link

After I change my raspi-config to vc4-fkms-v3d , I successfully found /sys/kernel/debug/dri dir .

The output for cat /sys/kernel/debug/dri/*/name is :

v3d dev=fec00000.v3d unique=fec00000.v3d
v3d dev=fec00000.v3d unique=fec00000.v3d
vc4 dev=gpu unique=gpu

The output for glxinfo -B is :

name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Broadcom (0x14e4)
    Device: V3D 4.2 (0xffffffff)
    Version: 20.3.5
    Accelerated: yes
    Video memory: 7377MB
    Unified memory: yes
    Preferred profile: compat (0x2)
    Max core profile version: 0.0
    Max compat profile version: 2.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
OpenGL vendor string: Broadcom
OpenGL renderer string: V3D 4.2
OpenGL version string: 2.1 Mesa 20.3.5 (git-42a4d76fcc)
OpenGL shading language version string: 1.20

OpenGL ES profile version string: OpenGL ES 3.1 Mesa 20.3.5 (git-42a4d76fcc)
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

Now , the acceleration seems to work ( because the cpu was not so high when I did my operation ) , but the rendering result was corrupted:
Xnip2021-12-26_14-44-21

@zhouziyang
Copy link
Member

make sure gralloc is gbm (getprop ro.hardware.gralloc)
since using software video codec, you can try to add SW usage to buffers allocated by gbm gralloc.
Good Luck~~

@mythsman
Copy link

Well , ro.hardware.gralloc is gbm for sure , but it seems too hard for me to do sth like add SW usage to buffers allocated by gbm gralloc ...

@rsinglaenph
Copy link

@mythsman i followed your steps to create the .tar file and tried to run it on an ubuntu vm. However, the container stops immediately, its not able to find /init. What am i doing wrong?

@mythsman
Copy link

@mythsman i followed your steps to create the .tar file and tried to run it on an ubuntu vm. However, the container stops immediately, its not able to find /init. What am i doing wrong?

Thought you have fixed your problem , while I still could not fix my problem 😭 .

@rsinglaenph
Copy link

yes, luckily it worked for me on ubuntu vm, i am going to try with arm64 build now on raspberry pi3. But my OS is Yocto based linux distribution. Lets see how this goes.

@FallenChromium
Copy link

Just wanted to chime in to report that I have similar issue here. Not sure how to resolve it yet:
image

@FallenChromium
Copy link

since using software video codec

I am not sure this is the case, because Mesa actually supports V3D driver for Videocore IV (RPi 3) and Videocore VI (RPi 4), unless it was explicitly disabled

@kkkkkk812
Copy link

@mythsman Hello, I want to ask you about running redoid on Raspberry Pie 4. Have you set the system for Raspberry Pie? I think you need to set CONFIG_ PSI, but I don't know where to set it. I won't use Gpu to accelerate when running on my raspberry pie. I see your video is very smooth, and I want to know how you do it.

I don't remeber anything special i did to it , but I'd like to show you my configs which may help you.

pi@raspberrypi:~ $ cat /proc/version
Linux version 5.10.103-v8+ (dom@buildbot) (aarch64-linux-gnu-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1529 SMP PREEMPT Tue Mar 8 12:26:46 GMT 2022

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 5.10.103-v8+ #1529 SMP PREEMPT Tue Mar 8 12:26:46 GMT 2022 aarch64 GNU/Linux

pi@raspberrypi:~ $ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 10 (buster)
Release:	10
Codename:	buster

pi@raspberrypi:~ $ cat /boot/config.txt
# For more options and information see
# http://www.raspberrypi.org/documentation/configuration/config-txt.md
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
#dtparam=i2s=on
dtparam=spi=on
enable_uart=1
# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt 1024 600 60 6 0 0 0
dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=3900,ymin=200,ymax=3900
hdmi_drive=2
hdmi_force_hotplug=1
#max_usb_current=1
start_x=1
gpu_mem=512
[all]
dtoverlay=vc4-fkms-v3d

Our CONFIG TXT is different. My version is the following. Are you downloading the raspberry pie system directly from the official website of raspberry pie? How do I modify the config.txt if I want to

@a279437145
Copy link

a279437145 commented Oct 12, 2022

@kkkkkk812 CONFIG_PSI is set at kernel config , follow https://www.raspberrypi.com/documentation/computers/linux_kernel.html , remember to edit the .config and set CONFIG_PSI=y before running make . This is to make lmkd run correctly so redroid will run.
Video is smooth is because GPU acceleration is enabled , it's just discussed here.

@a279437145
Copy link

a279437145 commented Oct 12, 2022

@zhouziyang Sorry that I haven't seen your reply earlier . Thank you for pointing out , but I know nothing about both android and gralloc .
I want to ask
1.Why is minigbm not supported on this platform ? is it due to software reason or hardware defect?And is there a way to make it work?
2.I see in the issue about gbm they have already fixed this problem , why is this still happening here?Is it because I'm not running it with that patch or something else made it encountered another problem? (I tried to run redroid11 on a x86 computer with intel GPU , everything works fine , but on raspberry it's not perfect)
3.Is there a way I can just take a screenshot correctly by running a command (or some commands)?
Thank you again for your great work.

@zhouziyang
Copy link
Member

want to ask
1.Why is minigbm not supported on this platform ? is it due to software reason or hardware defect?And is there a way to make it work?

Seems only vc4 supported in minigbm currently (v3d required for your case).

2.I see in the issue about gbm they have already fixed this problem , why is this still happening here?Is it because I'm not running it with that patch or something else made it encountered another problem? (I tried to run redroid11 on a x86 computer with intel GPU , everything works fine , but on raspberry it's not perfect)

Possible issues in gralloc.gbm or Gallium driver. Not sure. Try report issues in links I provided above.

3.Is there a way I can just take a screenshot correctly by running a command (or some commands)?
You can refine screencap to use GLES to download pixels.

Thank you again for your great work.

@a279437145
Copy link

thank you .
It seems that refining screencap is too hard for me with few knowledge , I'm considering using scrcpy to get frames instead .
Anyways , I'll report my issue there.

@kkkkkk812
Copy link

@kkkkkk812 CONFIG_PSI is set at kernel config , follow https://www.raspberrypi.com/documentation/computers/linux_kernel.html , remember to edit the .config and set CONFIG_PSI=y before running make . This is to make lmkd run correctly so redroid will run. Video is smooth is because GPU acceleration is enabled , it's just discussed here.

thank you .I try it and run redroid-11 in Raspberry Pi4.It looks good.

@a279437145
Copy link

@zhouziyang
thanks to your hint , i reported that problem and i'm trying the fix they provided.
and i now can get screenshots by getting images from the v4l2 device provided by scrcpy , it's working.
but i ran to another problem that the whole container may crash randomly
if it crashed , i can't even stop or kill it using docker kill , it'll say tried to kill container, but did not receive an exit event
debug:
tmp.2NlCV5Pem6.tar.gz

more details:
I was using a modified versing of scrcpy (https://github.com/NetrisTV/ws-scrcpy , based on scrcpy 1.19) , and i was running arknights

this isn't the first time this happens , there were once i was running chrome and it crashed just like this.

@zhouziyang
Copy link
Member

not pretty sure. There are many scrcpy crashes, and some ANR logs.

BTW, the OMX driver provide by redroid is just experimental (not completed yet).

@zhouziyang
Copy link
Member

zhouziyang commented Oct 15, 2022

The patched gralloc.gbm: gbm_gralloc.tgz

try:

docker run ... -v <DIR>/gbm_gralloc/arm64/gralloc.gbm.so:/vendor/lib64/hw/gralloc.gbm.so \
    -v <DIR>/gbm_gralloc/arm/gralloc.gbm.so:/vendor/lib/hw/gralloc.gbm.so ... \
    redroid/redroid-xxx androidboot.use_redroid_omx=1 \

running sha1sum in container to make sure the patched gralloc.gbm is correctly mounted.

@a279437145
Copy link

a279437145 commented Oct 15, 2022 via email

@a279437145
Copy link

tried with that , still get corrupted screenshots

80ac9ec5a1bd4cba8bee55d2dabb8f4d01859c04  /vendor/lib/hw/gralloc.gbm.so
84b51bf424bbadcc302fba60e19c66f7f092629a  /vendor/lib64/hw/gralloc.gbm.so

and i think that the crash problem might be related to OMX for the whole container will crash at once if i open the corrupted screenshots in Gallery .

10-16 07:35:01.819  1767  1790 W OMXUtils: do not know color format 0x7f000789 = 2130708361
10-16 07:35:01.819  1767  1790 I ACodec  : setupAVCEncoderParameters with [profile: Baseline] [level: Level41]
10-16 07:35:01.819   112   478 W RedroidAVCEnc: TODO unsupported settings [OMX_IndexParamVideoAvc]
10-16 07:35:01.819  1767  1790 I ACodec  : [OMX.redroid.h264.encoder] cannot encode color aspects. Ignoring.
10-16 07:35:01.820  1767  1790 I ACodec  : [OMX.redroid.h264.encoder] cannot encode HDR static metadata. Ignoring.
10-16 07:35:01.820  1767  1790 I ACodec  : setupVideoEncoder succeeded
10-16 07:35:01.820  1767  1790 W OMXUtils: do not know color format 0x7f000789 = 2130708361
10-16 07:35:01.820   112   478 E OMXNodeInstance: getConfig(0xe3a50700:redroid.h264.encoder, ConfigLatency(0x6f800005)) ERROR: Undefined(0x80001001)
10-16 07:35:01.820   112   478 E OMXNodeInstance: getConfig(0xe3a50700:redroid.h264.encoder, ConfigAndroidVendorExtension(0x6f100004)) ERROR: Undefined(0x80001001)
10-16 07:35:01.821   112   478 D GraphicBufferSource: setting dataspace: 0x104, acquired=0
10-16 07:35:01.821   112   478 D GraphicBufferSource: requesting color aspects (R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M))
10-16 07:35:05.046   112   187 E OMXNodeInstance: !!! Observer died. Quickly, do something, ... anything...
10-16 07:35:05.047  1784  1784 I scrcpy  : Cleaning up
10-16 07:35:05.048   108   108 E mediaserver: unlinkToDeath: removed reference to death recipient but unlink failed.
10-16 07:35:05.048   108   108 E IPCThreadState: attemptIncStrongHandle(1): Not supported
10-16 07:35:05.058  1784  1784 I scrcpy  : Restoring normal power mode
10-16 07:35:07.043   222   292 W InputDispatcher: Window c9ac6f9 com.android.gallery3d/com.android.gallery3d.app.GalleryActivity (server) is unresponsive: c9ac6f9 com.android.gallery3d/com.android.gallery3d.app.GalleryActivity (server) is not responding. Waited 5002ms for FocusEvent(hasFocus=false)
10-16 07:35:07.043   222   292 W InputDispatcher: Canceling events for c9ac6f9 com.android.gallery3d/com.android.gallery3d.app.GalleryActivity (server) because it is unresponsive
10-16 07:35:07.044   222   292 I WindowManager: ANR in com.android.gallery3d/com.android.gallery3d.app.GalleryActivity. Reason:c9ac6f9 com.android.gallery3d/com.android.gallery3d.app.GalleryActivity (server) is not responding. Waited 5002ms for FocusEvent(hasFocus=false)
10-16 07:35:07.081   222  1813 I ActivityManager: dumpStackTraces pids={358=true, 606=true, 609=true, 747=true, 802=true, 880=true, 923=true, 980=true, 1021=true, 1117=true, 1182=true, 1198=true, 1199=true, 1235=true, 1254=true, 1270=true, 1286=true, 1308=true, 1330=true, 1347=true, 1366=true, 1385=true} nativepids=[24, 35, 89, 92, 102, 106, 107, 108, 109, 112, 114, 115, 358]
10-16 07:35:07.120    92    92 W RenderEngine: fence wait timed out
10-16 07:35:07.120    92    92 E RenderEngine: Failed to flush RenderEngine commands
10-16 07:35:07.124    92    92 D SurfaceFlinger: Setting power mode 2 on display 0
10-16 07:35:07.124  1784  1784 D SurfaceControl: Excessive delay in setPowerMode()
10-16 07:35:07.125  1784  1784 D hw-ProcessState: Binder ioctl to enable oneway spam detection failed: Invalid argument
10-16 07:35:07.125  1784  1784 D AndroidRuntime: Shutting down VM
10-16 07:35:07.128   112   478 W GraphicBufferSource: released unpopulated slots: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63]

@zhouziyang
Copy link
Member

Sad. Need debug and find out the real stride.

@a279437145
Copy link

is there any workarounds (like ignoring bad pixels ?) to avoid crashing?

@zhouziyang
Copy link
Member

The OMX driver provided here is just for experimental. It's not complete and possible buggy.

@a279437145
Copy link

ok , i understand , thank you

@a279437145
Copy link

a279437145 commented Oct 16, 2022

Is it that if OMX crashes then android will reboot , and if android tries to reboot the container will crash?
Do you know how to kill the container correctly if it crahed ?
I tried kill 1(in container) , but nothing happend .
Running sudo docker stop redroid12 did made the device offline , but docker says Error response from daemon: cannot stop container: redroid12: tried to kill container, but did not receive an exit event , and the container still appear in sudo docker ps
I also want to know if the driver will be implemented soon,i'm expecting that.
is cros platform dependent ? I find it working on my intel computer and it's working better than gbm(no glitches at input boxes and webview)

@zhouziyang
Copy link
Member

docker kill <container> not work?

I have plan to enhance the OMX driver (avc decode support etc.), but not sure the ready time.

Both gralloc implementation are platform dependent and minigbm / cros possible more widely used.

@a279437145
Copy link

a279437145 commented Oct 18, 2022 via email

@a279437145
Copy link

@zhouziyang sorry for disturbing,may you explain the way to compile the prebuilt libs?

@a279437145
Copy link

@zhouziyang I tried to build robherring/gbm_gralloc#26 (he said that it worked on v3d+vc4), but the compilation failed

[100% 1/1] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
FAILED: out/soong/build.ninja
cd "$(dirname "out/soong/.bootstrap/bin/soong_build")" && BUILDER="$PWD/$(basena
me "out/soong/.bootstrap/bin/soong_build")" && cd / && env -i "$BUILDER"     --t
op "$TOP"     --out "out/soong"     -n "out"     -d "out/soong/build.ninja.d"   
  -t -l out/.module_paths/Android.bp.list -globFile out/soong/.bootstrap/build-g
lobs.ninja -o out/soong/build.ninja --available_env out/soong/soong.environment.
available --used_env out/soong/soong.environment.used Android.bp
error: external/minigbm/gbm_mesa_driver/Android.bp:11:1: "libminigbm_gralloc_gbm
_mesa" depends on undefined module "minigbm_cros_gralloc_library_defaults"
17:22:28 soong bootstrap failed with: exit status 1

#### failed to build some targets (7 seconds) ####

I ran [redroid/external/minigbm]$ mm
is this the correct way to compile it ?

@zhouziyang
Copy link
Member

I use NDK to build all these blobs. redroid support several versions of Android (both arm64 / x86_64) and want to use the latest version of these libs, it's not easy to integrate into AOSP building process. It's a little complicated to build all those prebuilts, many dependencies and some changes to the libs.

BTW: you are building minigbm, not gralloc.gbm

@a279437145
Copy link

yes , that issue was about a special version of minigbm (I'd like to see if can make cros work on raspberrypi)
directly running make can generate a libminigbm.so.1.0.0 , what does this do ?

@zhouziyang
Copy link
Member

The minigbm gralloc seems support vc4 (not sure about v3d). screencap access pixels always via SW; and possible not work even with minigbm gralloc.
Some suggestions for you:

  • Adjust screencap code to download pixels via GLES
  • fix the stride issue in gralloc.gbm

@a279437145
Copy link

scrcpy v4l2loopback + ffmpeg already met my need.
but I want it too be stable (I don't hope it to crash 😭 )
so I'm thingking about using minigbm (on my x86_64 computer it fixed the rendering problem in WebView and input boxes and video playing)
if minigbm can't solve the screencap problem that's ok

@a279437145
Copy link

a279437145 commented Nov 8, 2022

@mythsman Hi , from your screenrecord I see you are running redroid11 on raspberrypi 4 , did the container ever crash ? (the whole container stops responding and can't be stopped with docker stop)
I see that the redroid11 image is updated 12 days ago , I'll also try redroid11 later.(my raspbebrrypi doesn't have much storage left)

@mythsman
Copy link

mythsman commented Nov 8, 2022

@mythsman Hi , from your screenrecord I see you are running redroid11 on raspberrypi 4 , did the container ever crash ? (the whole container stops responding and can't be stopped with docker stop) I see that the redroid11 image is updated 12 days ago , I'll also try redroid11 later.(my raspbebrrypi doesn't have much storage left)

Everything is ok on my pi 😄 , good luck!

@a279437145
Copy link

a279437145 commented Nov 8, 2022

Thank you for replying , i'll try redroid11 later

UPD: tried , it still crashed
I started it with
docker run --name redroid11 -itd --rm --privileged -v ~/data11:/data -p 5555:5555 redroid/redroid:11.0.0-arm64 androidboot.use_redroid_omx=1
and then take a screenshot using adb screencap and open it in gallery (maybe need to open if for 3-4 times) and it crashed and the container can't be killed

pi@raspberrypi:~ $ sudo docker stop redroid11
Error response from daemon: cannot stop container: redroid11: tried to kill container, but did not receive an exit event
pi@raspberrypi:~ $ sudo docker kill redroid11
Error response from daemon: Cannot kill container: redroid11: tried to kill container, but did not receive an exit event
pi@raspberrypi:~ $ sudo docker ps
CONTAINER ID   IMAGE                          COMMAND                  CREATED         STATUS         PORTS                                       NAMES
4fab72915eec   redroid/redroid:11.0.0-arm64   "/init qemu=1 androi…"   5 minutes ago   Up 4 minutes   0.0.0.0:5555->5555/tcp, :::5555->5555/tcp   redroid11
pi@raspberrypi:~ $ sudo docker exec -it redroid11 sh
OCI runtime exec failed: exec failed: unable to start container process: error executing setns process: exit status 1: unknown

@mythsman may you try the same way?

@brunoaduarte
Copy link
Contributor

Hi, anyone tried Redroid with the new Raspberry Pi 5?

https://www.raspberrypi.com/products/raspberry-pi-5/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants