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

scrcpy from commandline works but scrcpy-client-0.3.5 doesn't #11

Closed
wildsheepz opened this issue Nov 22, 2021 · 9 comments
Closed

scrcpy from commandline works but scrcpy-client-0.3.5 doesn't #11

wildsheepz opened this issue Nov 22, 2021 · 9 comments
Labels
bug Something isn't working

Comments

@wildsheepz
Copy link

wildsheepz commented Nov 22, 2021

Hi, I am encountering an issue with scrpy-client-0.3.5 (and scrpy-client-0.3.6) and I am not sure how to get it to work. Running scrcpy directly works as expected but using python didn't work for me. Any idea how to solve this?
screencapture video

ADB Logcat
11-22 18:57:56.778 1411 1411 E adbd : failed to connect to socket 'localabstract:scrcpy': could not connect to localabstract address 'localabstract:scrcpy'

@wildsheepz
Copy link
Author

If I set a breakpoint to at core.py and wait a little before continuing code execution, it will work:
screencapture video

@leng-yue
Copy link
Owner

Seems like pushing the ADB server exceeds 3 seconds and causes a timeout. And in the official scrcpy, it takes more than 3 seconds too.
I will release a fix to allow you to set a custom timeout.

@leng-yue leng-yue added the bug Something isn't working label Nov 22, 2021
@leng-yue
Copy link
Owner

I will also add something to wait for the server to start.

@leng-yue
Copy link
Owner

It should be fixed now, can you try the newest version from GitHub? (NOT PYPI)

@leng-yue
Copy link
Owner

Or you can update the core.py manually

@wildsheepz
Copy link
Author

There is still has an error but you are right about waiting for the server.

kuanyong@kuanyong-GP66:~/Desktop/MyProjects/pq3$ python3 client.py 
[AdbDevice(serial=8AFX0RRXU)]
Traceback (most recent call last):
  File "client.py", line 22, in <module>
    client.start(threaded=True)
  File "/home/kuanyong/.local/lib/python3.8/site-packages/scrcpy/core.py", line 153, in start
    self.__deploy_server()
  File "/home/kuanyong/.local/lib/python3.8/site-packages/scrcpy/core.py", line 142, in __deploy_server
    self.__server_stream.check_okay()
  File "/home/kuanyong/.local/lib/python3.8/site-packages/adbutils/__init__.py", line 171, in check_okay
    raise AdbError("Unknown data: %s" % data)
adbutils.errors.AdbError: Unknown data: [ser
kuanyong@kuanyong-GP66:~/Desktop/MyProjects/pq3$ 

@wildsheepz
Copy link
Author

wildsheepz commented Nov 23, 2021

When the server is started it prints the device name after a pause:

kuanyong@kuanyong-GP66:~/Desktop/MyProjects/pq3$ adb push /usr/local/share/scrcpy/scrcpy-server /data/local/tmp/scrcpy-server.jar && adb shell CLASSPATH=/data/local/tmp/scrcpy-server.jar app_process / com.genymobile.scrcpy.Server 1.20 info 0 100000 1 -1 true - false true 0 false false - - false
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 3.9 MB/s (37139 bytes in 0.009s)
[server] INFO: Device: Google Pixel 3 (Android 12)

@leng-yue
Copy link
Owner

V0.3.7 is publishing, and the problem should be solved. Can you try it 10 minutes later?

@wildsheepz
Copy link
Author

It works now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants