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

After android upgrading, scrcpy stops working #342

Closed
amosbird opened this issue Nov 17, 2018 · 20 comments
Closed

After android upgrading, scrcpy stops working #342

amosbird opened this issue Nov 17, 2018 · 20 comments

Comments

@amosbird
Copy link

it never pops out the phone screen, only showing

/usr/share/scrcpy/scrcpy-server.jar: 1 file pushed. 1.2 MB/s (18802 bytes in 0.015s)
INFO: Initial texture: 2160x1080

on the terminal.

Is there anything I can do to debug this?

@rom1v
Copy link
Collaborator

rom1v commented Nov 17, 2018

adb logcat

And you could try a lower definition:

scrcpy -m1024

@amosbird
Copy link
Author

adb logcat doesn't generate anything and scrcpy -m1024 or lower doesn't work either

@amosbird
Copy link
Author

using the master commit, I saw ^CERROR: Could not open video stream after hitting ctrl-c . Is this related? #291

@rom1v
Copy link
Collaborator

rom1v commented Nov 17, 2018

adb logcat doesn't generate anything

At all? Then your device has a problem.

What about adb shell or adb devices?

@amosbird
Copy link
Author

adb shell and adb devices work fine.

At all?

It has some outputs but doesn't generate anything new after running scrcpy

@amosbird
Copy link
Author

Hmm, found something suspious. /data/local/tmp/scrcpy-server.jar gets removed after I saw INFO: Initial texture: 2160x1080

@amosbird
Copy link
Author

amosbird commented Nov 17, 2018

manually running the server

 ❯ adb shell
134|MeizuE3:/ $ CLASSPATH=/data/local/tmp/scrcpy-server.jar app_process / com.genymobile.scrcpy.Server 0 8000000 false '' false
ERROR: Exception on thread Thread[main,5,main]
java.io.IOException: Connection refused
        at android.net.LocalSocketImpl.connectLocal(Native Method)
        at android.net.LocalSocketImpl.connect(LocalSocketImpl.java:292)
        at android.net.LocalSocket.connect(LocalSocket.java:131)
        at com.genymobile.scrcpy.DesktopConnection.connect(DesktopConnection.java:33)
        at com.genymobile.scrcpy.DesktopConnection.open(DesktopConnection.java:53)
        at com.genymobile.scrcpy.Server.scrcpy(Server.java:17)
        at com.genymobile.scrcpy.Server.main(Server.java:109)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:277)

@rom1v
Copy link
Collaborator

rom1v commented Nov 17, 2018

Hmm, found something suspious. /data/local/tmp/scrcpy-server.jar gets removed

That's expected: https://blog.rom1v.com/2018/03/introducing-scrcpy/#clean-up-the-device

@amosbird
Copy link
Author

this adb exec-out screenrecord --output-format=h264 - | vlc - --demux h264 works as expected

@amosbird
Copy link
Author

@rom1v I've made some progress.

  1. using Uint32 window_flags = SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE; I found that the input events work just fine

  2. dumping the error message of avformat_open_input via LOGE(av_err2str(rc)); I get Invalid data found when processing input

@rom1v
Copy link
Collaborator

rom1v commented Nov 18, 2018

Is there anything I can do to debug this?

You can use gdb:

export SCRCPY_SERVER_PATH=x/server/scrcpy-server.jar
gdb x/app/scrcpy

(if x is your builddir)

Put a breakpoint on scrcpy():

(gdb) b scrcpy

and run:

(gdb) r

Then run line-by-line to know where the client "waits":

(gdb) n

EDIT:

using Uint32 window_flags = SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE; I found that the input events work just fine

Ah, so now it starts again?

@amosbird
Copy link
Author

Ah, so now it starts again?

Nope, only the input events work, no video stream

@amosbird
Copy link
Author

amosbird commented Nov 18, 2018

Then run line-by-line to know where the client "waits":

The error obviously comes from avformat_open_input call which returns : Invalid data found when processing input

@amosbird
Copy link
Author

amosbird commented Nov 18, 2018

@rom1v the client actually waits at avformat_open_input and the syscall is recv

backtrace

#0  0x00007f3cba266406 in recv () from /usr/lib/libpthread.so.0
#1  0x000055f9a3b7b576 in net_recv (socket=8, buf=0x7f3c9c01e140, len=65536) at ../app/src/net.c:78
#2  0x000055f9a3b78e15 in read_raw_packet (opaque=0x55f9a3b85cc0 <decoder>, buf=0x7f3c9c01e140 "", buf_siz
e=65536) at ../app/src/decoder.c:125
#3  0x00007f3cbbb34ea5 in avio_read () from /usr/lib/libavformat.so.58
#4  0x00007f3cbbb60143 in av_probe_input_buffer2 () from /usr/lib/libavformat.so.58
#5  0x00007f3cbbc6dd76 in avformat_open_input () from /usr/lib/libavformat.so.58
#6  0x000055f9a3b790ec in run_decoder (data=0x55f9a3b85cc0 <decoder>) at ../app/src/decoder.c:205
#7  0x00007f3cba2d64af in ?? () from /usr/lib/libSDL2-2.0.so.0
#8  0x00007f3cba35662a in ?? () from /usr/lib/libSDL2-2.0.so.0
#9  0x00007f3cba25ca9d in start_thread () from /usr/lib/libpthread.so.0
#10 0x00007f3cba18ca43 in clone () from /usr/lib/libc.so.6

@amosbird
Copy link
Author

amosbird commented Nov 18, 2018

@amosbird
Copy link
Author

It seems there is no input for codec after setDisplaySurface(display, surface, contentRect, videoRect);

@rom1v
Copy link
Collaborator

rom1v commented Nov 18, 2018

After android upgrading

You upgraded from which version to which version, on which device?

@amosbird
Copy link
Author

I just noticed that the Android version doesn't change. I've updated the flyme rom from 6.3.2.2A to 7.1.0.0A. The device is Meizu Meilan-E3. There are related issues #151 and #240

However it used to work. And it never throws any exceptions after upgrading.

@amosbird
Copy link
Author

The only log entry after doing CLASSPATH=/data/local/tmp/scrcpy-server.jar app_process / com.genymobile.scrcpy.Server 0 8000000 false '' false is

11-25 18:28:51.064  3330  3330 I Radio-JNI: register_android_hardware_Radio DONE
11-25 18:28:51.085  3330  3348 E SchedPolicy: open of /dev/cpuctl/bg_non_interactive/tasks failed: No such file or directory

Is there anything I can do to debug the issue of setDisplaySurface?

@amosbird
Copy link
Author

amosbird commented Apr 6, 2019

#434

@amosbird amosbird closed this as completed Apr 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants