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

Option to disable hardware accelerated video decoder / switch to image (macOS) #1673

Open
psychowood opened this issue Aug 13, 2020 · 4 comments

Comments

@psychowood
Copy link

psychowood commented Aug 13, 2020

I know this may sound strange, but please hear me out :)

On macOS, if you use hardware acceleration, it switches to the discrete GPU (if you have one). Since the integrate one is more energy efficient and generate less heat, I think it could be useful, if it is not too hard to do. AFAIK there's no way to completely choose the GPU/disable the discrete GPU on macOS on the user side.

Is your feature request related to a problem? Please describe.
Hardware acceleration / video decoding on macOS forces switching to the discrete GPU, generating more heat and eating battery.

Describe the solution you'd like
Option to disable hardware acceleration on (macOS only?) video decoder.

Describe alternatives you've considered
An alternative could be using static images instead of video streaming, perhaps when the fps is set very low (I've noticed It can't be set below 1 fps), but I believe it would be way longer (harder) to develop.
Perhaps #1632 could be some sort of alternative.

@rom1v
Copy link
Collaborator

rom1v commented Aug 13, 2020

Note that there are both hardware decoding and hardware rendering.

You could disable hardware rendering (i.e. not use OpenGL/DirectX/Metal):

scrcpy --render-driver=software

@psychowood
Copy link
Author

psychowood commented Aug 13, 2020

Thanks, I missed that option.

Sadly it does not seems to use integrated GPU :(
Could it be related to the "Created renderer: metal" row below?

$ adb connect 192.168.43.1:5555; scrcpy --render-driver=software -V debug
already connected to 192.168.43.1:5555
2020-08-13 16:35:01.517 scrcpy[27533:1087031] INFO: scrcpy 1.14 https://github.com/Genymobile/scrcpy
2020-08-13 16:35:01.517 scrcpy[27533:1087031] DEBUG: Using server: /usr/local/Cellar/scrcpy/1.14_1/share/scrcpy/scrcpy-server
/usr/local/Cellar/scrcpy/1.14_1/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 40.5 MB/s (33142 bytes in 0.001s)
[server] INFO: Device: samsung SM-G965F (Android 10)
2020-08-13 16:35:02.807 scrcpy[27533:1087031] DEBUG: Starting stream thread
2020-08-13 16:35:02.807 scrcpy[27533:1087031] DEBUG: Starting controller thread
2020-08-13 16:35:02.807 scrcpy[27533:1087031] DEBUG: Starting receiver thread
2020-08-13 16:35:04.691 scrcpy[27533:1087031] INFO: Created renderer: metal
2020-08-13 16:35:04.693 scrcpy[27533:1087031] INFO: Created renderer: software
2020-08-13 16:35:04.693 scrcpy[27533:1087031] INFO: Renderer: software
2020-08-13 16:35:04.693 scrcpy[27533:1087031] DEBUG: Trilinear filtering disabled (not an OpenGL renderer)
2020-08-13 16:35:04.699 scrcpy[27533:1087031] INFO: Initial texture: 1440x2960
2020-08-13 16:35:08.036 scrcpy[27533:1087031] DEBUG: Unknown touch device id -1, cannot reset
2020-08-13 16:35:49.879 scrcpy[27533:1087031] DEBUG: User requested to quit
2020-08-13 16:35:49.879 scrcpy[27533:1087031] DEBUG: quit...
2020-08-13 16:35:49.885 scrcpy[27533:1087171] DEBUG: Receiver stopped
2020-08-13 16:35:49.886 scrcpy[27533:1087169] DEBUG: End of frames
2020-08-13 16:35:49.886 scrcpy[27533:1087085] DEBUG: Server terminated

Btw with the software renderer I only get (regardless of the resolution) the top left quarter of the screen.

EDIT: I just noticed I was on v1.14, updated to v1.16, same report/behaviour.

@rom1v
Copy link
Collaborator

rom1v commented Aug 13, 2020

Sadly it does not seems to use integrated GPU

No, it uses CPU for rendering (but it does not change hardware decoding).

Btw with the software renderer I only get (regardless of the resolution) the top left quarter of the screen.

Oh, that's probably related to #15. Thank you for the report.

@Atemu
Copy link

Atemu commented Oct 12, 2021

For the time being, use https://codyschrank.github.io/gSwitch/.

Also very helpful for other applications.

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

3 participants