Cannot connect with scrcpy: List of video encoders: (none) on Ubuntu 20.04 VM
monspi opened this issue · 5 comments
Describe the bug
请详细描述问题(ZH_CN)
使用VMWare搭建的Ubuntu 20.04虚拟机运行redroid/redroid:14.0.0_64only-latest
docker run -itd --rm --privileged --pull always -v ~/android_1:/data -p 5556:5555 redroid/redroid:14.0.0_64only-latest androidboot.redroid_gpu_mode=auto
可以通过ADB连接但无法scrcpy连接
Collect debug logs
收集调试日志(ZH_CN)
redroid-debug.RuOjT3uk.tgz
Screenshots
截图(ZH_CN)
[server] INFO: Device: [redroid] redroid redroid14_x86_64_only (Android 14)
[server] ERROR: Could not create default audio encoder for opus
List of audio encoders:
(none)
[server] ERROR: Could not create default video encoder for h264
List of video encoders:
(none)
[server] ERROR: Exception on thread Thread[audio-encoder,5,main]
java.lang.IllegalArgumentException: Failed to initialize audio/opus, error 0xfffffffe (NAME_NOT_FOUND)
at android.media.MediaCodec.native_setup(Native Method)
at android.media.MediaCodec.<init>(MediaCodec.java:2094)
at android.media.MediaCodec.<init>(MediaCodec.java:2072)
at android.media.MediaCodec.createEncoderByType(MediaCodec.java:2027)
at com.genymobile.scrcpy.audio.AudioEncoder.createMediaCodec(AudioEncoder.java:301)
at com.genymobile.scrcpy.audio.AudioEncoder.encode(AudioEncoder.java:193)
at com.genymobile.scrcpy.audio.AudioEncoder.lambda$start$0$com-genymobile-scrcpy-audio-AudioEncoder(AudioEncoder.java:131)
at com.genymobile.scrcpy.audio.AudioEncoder$$ExternalSyntheticLambda3.run(D8$$SyntheticClass:0)
at java.lang.Thread.run(Thread.java:1012)
[server] ERROR: Exception on thread Thread[video,5,main]
java.lang.IllegalArgumentException: Failed to initialize video/avc, error 0xfffffffe (NAME_NOT_FOUND)
at android.media.MediaCodec.native_setup(Native Method)
at android.media.MediaCodec.<init>(MediaCodec.java:2094)
at android.media.MediaCodec.<init>(MediaCodec.java:2072)
at android.media.MediaCodec.createEncoderByType(MediaCodec.java:2027)
at com.genymobile.scrcpy.video.SurfaceEncoder.createMediaCodec(SurfaceEncoder.java:219)
at com.genymobile.scrcpy.video.SurfaceEncoder.streamCapture(SurfaceEncoder.java:64)
at com.genymobile.scrcpy.video.SurfaceEncoder.lambda$start$0$com-genymobile-scrcpy-video-SurfaceEncoder(SurfaceEncoder.java:268)
at com.genymobile.scrcpy.video.SurfaceEncoder$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
at java.lang.Thread.run(Thread.java:1012)
ERROR: "adb reverse --remove" returned with value 1
ERROR: Could not retrieve device information
ERROR: Server connection failed
Try upgrade ubuntu kernel to 5.15 series.
try install ubuntu 24.04 and problem dont appear.
Issue can be closed
I too am running into this problem (i.e., the device has no video encoders). See full logs below.
I've already got my server set up with Debian 12 (with the 6.1.0-26-amd64 kernel), so I would like to avoid reinstalling everything with Ubuntu 24.04.
Could you please give me some insight into what requirements need to be met (e.g., package/modules) to fulfill the scrcpy video encoder requirements?
Thanks
admin@server:~/redroid$ sudo docker run -itd --rm --privileged --pull always -v /dev/binder1:/dev/binder -v /dev/binder2:/dev/hwbinder -v /dev/binder3:/dev/vndbinder -v ~/redroid/data00:/data -p 5555:5555 --name redroid00 redroid/redroid:13.0.0_64only-latest redroid.gpu.mode=guest androidboot.redroid_gpu_mode=guest
[sudo] password for admin:
13.0.0_64only-latest: Pulling from redroid/redroid
Digest: sha256:5a42a569ee1d7c71796c0385e906cbaa4c3e0a162a56d9f26b29bdb1befac13b
Status: Image is up to date for redroid/redroid:13.0.0_64only-latest
316fd779862065b275b0198b105035dd3f69487d13a3689218c3b2cfdaf7314e
admin@server:~/redroid$ adb devices
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached
emulator-5554 device
admin@server:~/redroid$ scrcpy --no-audio --keyboard=uhid --lock-video-orientation --render-driver=software --kill-adb-on-close
scrcpy 2.7 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO: --> (tcpip) emulator-5554 device redroid13_x86_64_only
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 32.3 MB/s (71200 bytes in 0.002s)
[server] INFO: Device: [redroid] redroid redroid13_x86_64_only (Android 13)
[server] ERROR: Controller error
java.io.IOException: android.system.ErrnoException: open failed: EACCES (Permission denied)
at com.genymobile.scrcpy.control.UhidManager.open(UhidManager.java:69)
at com.genymobile.scrcpy.control.Controller.handleEvent(Controller.java:213)
at com.genymobile.scrcpy.control.Controller.control(Controller.java:102)
at com.genymobile.scrcpy.control.Controller.lambda$start$0$com-genymobile-scrcpy-control-Controller(Controller.java:110)
at com.genymobile.scrcpy.control.Controller$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
at java.lang.Thread.run(Thread.java:1012)
Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
at libcore.io.Linux.open(Native Method)
at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
at android.system.Os.open(Os.java:494)
at com.genymobile.scrcpy.control.UhidManager.open(UhidManager.java:52)
... 5 more
[server] ERROR: Could not create default video encoder for h264
List of video encoders:
(none)
[server] ERROR: Exception on thread Thread[video,5,main]
java.lang.IllegalArgumentException: Failed to initialize video/avc, error 0xfffffffe (NAME_NOT_FOUND)
at android.media.MediaCodec.native_setup(Native Method)
at android.media.MediaCodec.<init>(MediaCodec.java:2000)
at android.media.MediaCodec.<init>(MediaCodec.java:1978)
at android.media.MediaCodec.createEncoderByType(MediaCodec.java:1933)
at com.genymobile.scrcpy.video.SurfaceEncoder.createMediaCodec(SurfaceEncoder.java:219)
at com.genymobile.scrcpy.video.SurfaceEncoder.streamCapture(SurfaceEncoder.java:64)
at com.genymobile.scrcpy.video.SurfaceEncoder.lambda$start$0$com-genymobile-scrcpy-video-SurfaceEncoder(SurfaceEncoder.java:268)
at com.genymobile.scrcpy.video.SurfaceEncoder$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
at java.lang.Thread.run(Thread.java:1012)
INFO: Renderer: software
WARN: Device disconnected
ERROR: Demuxer 'video': stream disabled due to connection error
INFO: Killing adb server...
admin@server:~/redroid$
admin@server:~/redroid$ scrcpy --list-encoders
scrcpy 2.7 <https://github.com/Genymobile/scrcpy>
* daemon not running; starting now at tcp:5037
* daemon started successfully
INFO: ADB device found:
INFO: --> (tcpip) emulator-5554 device redroid13_x86_64_only
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 28.5 MB/s (71200 bytes in 0.002s)
[server] INFO: Device: [redroid] redroid redroid13_x86_64_only (Android 13)
[server] INFO: List of video encoders:
(none)
[server] INFO: List of audio encoders:
(none)
admin@server:~/redroid$ uname -a
Linux P3 6.1.0-26-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.112-1 (2024-09-30) x86_64 GNU/Linux
P.S. I did try to configure redroid/scrcpy for SW rendering, but that didn't seem to work either
@ndjankov /dev/dma_heap/system
present?
I will try close this issue since the original issue already fixed, and please file an new one if still cannot be resolved.
No, /dev/dma_heap/system is not currently present on my system. Let me enable that and try again. Thanks for the pointer! (I'll file a new issue if I still run into problems)