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

Possibility of expanding the (0;65535) interval, support larger display id? #2009

Closed
gpdeepblue opened this issue Jan 4, 2021 · 5 comments
Closed

Comments

@gpdeepblue
Copy link

  • [✔] I have checked that a similar feature request does not already exist.

Is your feature request related to a problem? Please describe.
My cellphone is Smartisan Pro 3, which is a Chinese brand comes with a desktop mode named TNT(Touch & Talk), so think of it as Samsung DeX. For some time, I was able to use TNT on my PC with '--display' option. After a recent update, they changed the display id of desktop image feeding to adb, starting from 100001:
image
Clearly Scrcpy doesn't support the oversized display id, it gives a out-of-range(0;65535) error:
image
I did some hacking to cli.c, make Scrcpy accept the display id:
image
But nope, the error pointed directly down to Android internal:
image
34468 looks like a variable overflow(=100004-65536), but I don't know where it happened.
All in all, this feels serious... and beyond my capability.

Describe the solution you'd like
Is it possible to enlarge the display id range? Do we have to make some change to Android code?

Describe alternatives you've considered
Nothing at all, if it is not quite possible I understand. We are not even clear if Smartisan's action is a violation of Android guidelines or did they made the change on purpose just to block Scrcpy.

Additional context
TNT is a pretty potential OS. I'm sure there is a group of people hoping to use it on PC again. And maybe, just maybe, Smartisan is making an application like Samsung Dex to support it. Before that, Scrcpy seems to be our only option.

@gpdeepblue gpdeepblue changed the title Possibility of supporting a larger display id, up to 4294967295(0xffffffff)? Possibility of expanding the (0;65535) interval, support larger display id? Jan 4, 2021
rom1v added a commit that referenced this issue Jan 4, 2021
Some devices use big display id values.

Refs #2009 <#2009>
@rom1v
Copy link
Collaborator

rom1v commented Jan 4, 2021

Please test display_id_range.

@gpdeepblue
Copy link
Author

Please test display_id_range.

Wow, that's pretty swift of you! I was wrong about the error tracing.
Scrcpy works fine now, but the result is negative, TNT gives a black screen:
image
There is another way TNT work, I'll test it accordingly. The way I see it, Smartisan did block Scrcpy on purpose. :-(
Either way, thank you, Romain. Good job there.

@rom1v
Copy link
Collaborator

rom1v commented Jan 4, 2021

[server] WARN: Display doesn't have FLAG_SUPPORTS_PROTECTED_BUFFERS

See discussion #1238.

@rom1v
Copy link
Collaborator

rom1v commented Jan 4, 2021

Scrcpy works fine now

OK, cool, merged into dev aa8b571.

@gpdeepblue
Copy link
Author

gpdeepblue commented Jan 4, 2021

[server] WARN: Display doesn't have FLAG_SUPPORTS_PROTECTED_BUFFERS

See discussion #1238.

Actually, I had this warning all along, and I didn't care because if you don't have it, you don't have it, right?
It is not offically supported anyway.
I'll try and solve this warning but with little hope.

@rom1v rom1v closed this as completed Jan 6, 2021
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