Genymobile / Genymobile/scrcpy
Stack corruption detected when using version 1.21
- Dominant language
- C
- Stars
- 150k
- Forks
- 13.7k
- Avg merge
- 4d 13h
- Merged PRs (30d)
- 2
Description
- [x] I have read the [FAQ](https://github.com/Genymobile/scrcpy/blob/master/FAQ.md).
- [x] I have searched in existing [issues](https://github.com/Genymobile/scrcpy/issues).
**Environment**
- OS: MacOS
- scrcpy version: 1.21 (last)
- installation method: Downloaded the last prebuild server (https://github.com/Genymobile/scrcpy/blob/master/BUILD.md#option-2-use-prebuilt-server)
- device model: Samsung Galaxy A40
- Android version: 11
**Describe the bug**
I was using for some time scrcpy 1.17 in order to retrieve frames from the device, and decided today to update to the last version. In the previous version, I was able in Python3, following a code a bit like this one https://github.com/DawningW/swy-bot/blob/main/scrcpy.py to:
- Push the server on my phone
- Launch the server
- Forward server port :
- Then get from the video socket the dummy byte, the device name, and the screen resolution
After that, I was able to receive all my frames from the video socket, and it was working perfectly fine.
In 1.21, I saw that the method to launch the server changed. In 1.17, I was using :
```
subprocess.Popen(
['adb', '-s', device_id, 'shell',
'CLASSPATH=/data/local/tmp/scrcpy-server',
'app_process', '/', 'com.genymobile.scrcpy.Server 1.17 verbose {} {} {} -1 true - false false 0 false false - -'.format(max_width, bitrate, max_fps)],
```
But in 1.21, there are now named parameters, and also new one, based on what I saw in the Server.java src code. I modified my code to something like :
```
['adb', '-s', device_id, 'shell',
'CLASSPATH=/data/local/tmp/scrcpy-server',
'app_process', '/',
'com.genymobile.scrcpy.Server {} log_level=verbose max_size=0 bit_rate=8000000 max_fps=0 lock_video_orientation=-1 tunnel_forward=true send_frame_meta=false control=false display_id=0 show_touches=false stay_awake=false power_off_on_close=false clipboard_autosync=false'],
cwd=SERVER_ROOT)
```
After launching the server, I'm still able to get access to the dummy byte, the device name, and the screen resolution from the socket, but then I don't receive any frame anymore. I have this error happening :
`stack corruption detected (-fstack-protector)
Aborted
`
My question is, is it still possible to retrieve frames this way ? And if it is the case, is there a parameter that is not working like that anymore, and that would explain why I have a problem retrieving the frames from the video socket now ?
Thanks a lot for your time.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by comparing the 1.17 and 1.21 server launch commands with the Server.java source and the linked Python3 scrcpy.py example. Reproduce the connection on the Samsung Galaxy A40, inspect where frame retrieval stops after the dummy byte, device name, and resolution, and confirm whether the video socket protocol still delivers frames or the issue is resolved by updated parameters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, python
- Domain
- mobile-dev, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100