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

screencap not working on waydroid #110

Open
GordonGuenther opened this issue May 2, 2024 · 3 comments
Open

screencap not working on waydroid #110

GordonGuenther opened this issue May 2, 2024 · 3 comments

Comments

@GordonGuenther
Copy link

GordonGuenther commented May 2, 2024

Hi,

when using waydroid with hardware acceleration screencap doesn't create readable files anymore.

The issue with waydroid and hardware acceleration is that, the native screencap in adb shell is writing out an error /vendor/etc/hwdata/amdgpu.ids: No such file or directory but still creates a valid image file. If called via ppadb there is no error thrown, just the file that has been written is not a valid image anymore. The error message is written at the start of the file instead.

I slightly adapted the example code to test this:

client = AdbClient(host='127.0.0.1', port=5037)
devices = client.devices()
device = devices[0]

response = device.shell('wm size')
print(response)

result = device.screencap()
with open("screen.png", "wb") as fp:
    fp.write(result)
@GordonGuenther
Copy link
Author

As a workaround changing the cmd in the screencap method of command/transport/init.py from
cmd = "shell:/system/bin/screencap -p" to cmd = "shell:/system/bin/screencap 2>/dev/null -p"
works for me

@CloCkWeRX
Copy link

Do you feel this will be all devices, or just waydroid?
May be best to fix with a feature toggle?

 2>/dev/null

CloCkWeRX added a commit to CloCkWeRX/pure-python-adb that referenced this issue Feb 9, 2025
CloCkWeRX added a commit to CloCkWeRX/pure-python-adb that referenced this issue Feb 9, 2025
@CloCkWeRX
Copy link

Did you want to trial spm5065#4 and see if passing the extra arguments works, with BC breaks?

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