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

click button does not work on chromecast 4k control- Android 12 #55

Open
Litorti opened this issue Oct 17, 2022 · 86 comments
Open

click button does not work on chromecast 4k control- Android 12 #55

Litorti opened this issue Oct 17, 2022 · 86 comments

Comments

@Litorti
Copy link

Litorti commented Oct 17, 2022

Hello this issue is for Android 12 update

@Jooose25
Copy link

Tengo el mismo problema con la última actualización a Android 12

@andresflorentin
Copy link

Yo también tengo el mismo problema, no funciona el mouse matvt en el chromecast 4 Google tv con Android 12

@Nardokrazy2x
Copy link

I am also having this issue

@virresh
Copy link
Owner

virresh commented Oct 24, 2022

Hi,
Thanks for reporting.
Can someone send a log report for me to look at?
I don't have a chromecast and can't deduce what the issue is by the above comments.

@Nardokrazy2x
Copy link

How do it send a log I am on mine

@Tbo29
Copy link

Tbo29 commented Oct 24, 2022

Yes, click only works if the item you want to click has focus.

@andresflorentin
Copy link

Button click and scroll mode don't work

@RNavarro3000
Copy link

I have an Onn 4k device running Android 12 with the same problem as OP. Here is logcat output with just the MATVT info.
logcat.txt

@virresh
Copy link
Owner

virresh commented Nov 5, 2022

Thanks @RNavarro3000 for the log. I can see events being read just fine. I suppose this is a problem at kernel level of discarding click events that did not come from system itself.

Can you try looking at the other logs and see if you see any warnings from the kernel about rejecting input or something.
Also, I have a beta version that uses ADB instead of accessibility service - https://github.com/virresh/matvt/releases/tag/v1.06-pre-release

It's not pretty, but it should work as a stop-gap. I don't see how it can be improved in user experience though. Let me know if it works, that'll confirm that we have a fix for this new issue (whatever it is).

@Tbo29
Copy link

Tbo29 commented Nov 6, 2022

Sorry to say, the beta adb release also does not work. Tried with a bluetooth mouse connected. Also does not click. Doesn't look too good.

@RNavarro3000
Copy link

@virresh Attached is unfiltered logcat output from another event. If this doesn't help, let me know specifically what files or output you need captured as I'm not too familiar where Android keeps things.
logcat2.txt

@virresh
Copy link
Owner

virresh commented Nov 12, 2022

Thanks @RNavarro3000
I see the logs are for official release version. They show similar symptoms to what I saw when Android 11 was released, although @Tbo29 mentioned that that the ADB version isn't working either. In the logs, MATVT is able to read views from the screen just fine, but the input events fail and get eaten up (as if the gesture dispatch api didn't exist at all).

Can one of you also give logs for the adb version if possible?

@st-ivan
Copy link

st-ivan commented Nov 13, 2022

Thanks @RNavarro3000 I see the logs are for official release version. They show similar symptoms to what I saw when Android 11 was released, although @Tbo29 mentioned that that the ADB version isn't working either. In the logs, MATVT is able to read views from the screen just fine, but the input events fail and get eaten up (as if the gesture dispatch api didn't exist at all).

Can one of you also give logs for the adb version if possible?

Hi, just tried the adb version and its not working. Id be happy to provide logs if you tell me how to export them.

@RNavarro3000
Copy link

@virresh Installed the ADB version and click button is working OK for me now on LineageOS Android TV 12. Attached is logs for the session, maybe it will help with diagnosing the official release version.

logcat3.txt

file.mp4

@titti2000
Copy link

Hi all, I have the same problem on the new Chromecast hd, even with the ADB version; the click works only on what is already selected. I'd like to help you with the log, but I don't know how to do it; No debug app appears in developer options.

@Tbo29
Copy link

Tbo29 commented Nov 16, 2022

Seems that ADB is the way to go. The dev from tvQuickActions released an update (2.9.2) which uses ADB to fix the mouse toggle on Android TV 12. Regretfully I don't have it, but users confirmed that the mouse toggle from tvQuickActions is working now on the Chromecast with Google TV and the latest update. Let's see if the dev from Zank Remote will release an update soon, as he said he found the solution.

@st-ivan
Copy link

st-ivan commented Nov 16, 2022

Seems that ADB is the way to go. The dev from tvQuickActions released an update (2.9.2) which uses ADB to fix the mouse toggle on Android TV 12. Regretfully I don't have it, but users confirmed that the mouse toggle from tvQuickActions is working now on the Chromecast with Google TV and the latest update. Let's see if the dev from Zank Remote will release an update soon, as he said he found the solution.

thanks for the info. Link to the 2.9.2 version pleae? i just found out about this app and seems very helpful, if it works fine i may even buy it.

@Tbo29
Copy link

Tbo29 commented Nov 16, 2022

It's on the Playstore. Thinking of buying it too. Only $2.0. I have an older version. Works better than Button Mapper.

@st-ivan
Copy link

st-ivan commented Nov 16, 2022

It's on the Playstore. Thinking of buying it too. Only $2.0. I have an older version. Works better than Button Mapper.

thanks.. yeah talked to the developer via telegram, he says it works 100% confirmed. So im buying it. Not only bc of the mouse toggle feature but the 1 button (5 functions) mann thats a game changer for ccwgtv

@laopewastaken
Copy link

adb version doesnt work.

any news on a fix for ccwgtv/android 12?

@st-ivan
Copy link

st-ivan commented Nov 23, 2022

ended up buying tvQuickActions which has lots of more features and mouse toggle works .

@Tbo29
Copy link

Tbo29 commented Nov 24, 2022

ended up buying tvQuickActions which has lots of more features and mouse toggle works .

Bluetooth Keyboard and Mouse from phone also does work latest version. Means that devs are finding the solution.

@virresh
Copy link
Owner

virresh commented Nov 27, 2022

Thanks for the logs folks!

I got time today to test out the official Google TV emulator image for Android 12, and I found the issue.

The problem is caused because of a fancy new security feature on Android 12+. Explained in detail - https://medium.com/androiddevelopers/untrusted-touch-events-2c0e0b9c374c

I will be updating the official version with a fix for the same and this should work without the ADB. Thanks for your patience, will update here to test out the fix.

@virresh
Copy link
Owner

virresh commented Nov 27, 2022

Please test https://github.com/virresh/matvt/releases/tag/v1.0.7-pre and let me know if this solves problems on Android 12 (click and scroll should now be working).

Based on feedback, I'll add this along with a couple other planned features and release v1.0.7.

@dikodahan
Copy link

dikodahan commented Nov 27, 2022

Hey @virresh
I just tested it on an android 11 TV box and I am still having the same issue.
No problem with getting it to work and show the mouse on screen, however, the "Select" button does not seem to take effect...
I also noticed that when switching to scroll mode it did not scroll the screen for me.

For context: I am running on a Mecool KM7 device with Android TV 11 on it.

@virresh
Copy link
Owner

virresh commented Nov 27, 2022

@dikodahan pls note this is only for Android 12
For Android 11, you'll have to use the adb version. There is a known issue (only in Android 11) which has been fixed in subsequent versions.

@Litorti
Copy link
Author

Litorti commented Nov 27, 2022

Click only works if focused. Scroll doesn't work

@dikodahan
Copy link

dikodahan commented Nov 27, 2022

@dikodahan pls note this is only for Android 12
For Android 11, you'll have to use the adb version. There is a known issue (only in Android 11) which has been fixed in subsequent versions.

Hey @virresh
Thanks for the reply. As stated in your notes for that release, it is EXTREMELY buggy. Once the ADB permission is enabled, even with the mouse functionality not enabled (D-Pad mode), the system is jumping all around in the menu with the remote and is almost unusable. The only option to bring the system back to normal operation is to uninstall that version. If you're planning to release an updated 1.07 version, I am happy to test an ADB version of it on Android 11. The current one is not usable.

Again, thanks for all the effort into this project!

@virresh
Copy link
Owner

virresh commented Dec 19, 2022

Great news.

Sadly cannot lower the latency of ADB by a large margin because it waits to receive the full input before executing it. This is so that we don't keep pressing the down button when we want continuous scroll. So I have to cut off the full swipe in chunks and cancel it when button is released, but by that time some scroll events have already been issued.

I'll try to find some time and see if a workaround is available. The worst case would require writing a custom ADB lib and seeing how much latency gain that gets, but it's a lot of code (involves rewriting lots of parts of adb, and I haven't worked with native libs in a long while). This could take a while though, no promises on when it'll be ready.

@kokotas89
Copy link

@virresh Hmm, maybe you could replace the scrolling mode with a different method then? For example, tvquickactions uses double click for a single swipe step. Not so much precision for small swipes but at least it feels smoother.

Also I noticed that on the twitch app, click still doesn't register except for highlighted items. I captured a log maybe it can help finetune something.

logcat.txt

@virresh
Copy link
Owner

virresh commented Dec 19, 2022

Interesting,
I'm not sure exactly what the issue is with twitch, not clear in current logs. I'll try the twitch app with emulator once though to see if this is replicable.

For the scroll, good idea, though it'll be very hard to scroll a very long list of items as it'd require much more button presses. I'll try to implement something similar as an alternate and provide a checkbox so users can choose what scroll behavior they want. Thanks!

@dikodahan
Copy link

I can also confirm a similar type of behavior on the Google Chromecast with ATV 12.
Unfortunately, on ATV 11 devices it is still not usable.

@kokotas89
Copy link

Interesting, I'm not sure exactly what the issue is with twitch, not clear in current logs. I'll try the twitch app with emulator once though to see if this is replicable.

For the scroll, good idea, though it'll be very hard to scroll a very long list of items as it'd require much more button presses. I'll try to implement something similar as an alternate and provide a checkbox so users can choose what scroll behavior they want. Thanks!

Yeah it's interesting. Not that it really matters for twitch since it's an Android TV native app so matvt is not required at all... But I wonder why it behaves differently. BTW scroll is working, it's only the click that doesn't register when selecting games or streams to watch. Menu items can be clicked fine.

As for scrolling through long lists of items, yeah that's a good point. It's just that I never had to scroll so much that I would need infinite scrolling but different users different needs. It would certainly be useful to keep it as an option.

@TaniaAli268
Copy link

Tysm for this fix @virresh
I got an easy fix to this scroll issue ...

(Not sure how it works on other devices)
Remove the scroll feature completely, that way its easier to switch between mouse & D-pad mode which offers a much better scrolling experience. 😃

@Moksh99
Copy link

Moksh99 commented Dec 24, 2022

Hi @virresh, how do I install this app with instructions mentioned above on Google chromecast 4k ? Specifically this part is not clear with both the untrusted touch enabled and untrusted not sure how can I do this on Google chromecast device. Can you please provide more detailed instructions for people who doesn’t know much about command line and how to execute them ? Is there any other way from UI to enable/disable untrusted touch rather than executing commands.

@kokotas89
Copy link

@Moksh99 That adb command is not required. It was for testing purposes and at least to my experience it didn't make any difference. You should ignore that part for now.

To send adb commands to Chromecast you will need to setup adb wireless debugging. Sorry I can't provide details here, but it should be easy enough if you look up videos on YouTube.

@Moksh99
Copy link

Moksh99 commented Dec 24, 2022

Thanks @kokotas89 for reply. I installed v1.0.7 pre apk but it’s still the same issue. It’s not able to click an item which doesn’t have focus selected. Is this something that should have worked with pre version ?

@kokotas89
Copy link

@Moksh99 Did you do a clean installation?

@Moksh99
Copy link

Moksh99 commented Dec 24, 2022

@Moksh99 Did you do a clean installation?

Yes, I did uninstall previous version and then install this new pre.apk and configured key 3 as mouse and tried scenario using chromecast 4k remote. This is latest chromecast 4k tv with Android 12.

@kokotas89
Copy link

@Moksh99 I see... I and two other users confirmed that the latest pre has scrolling and clicking working. But in my case when I tried matvt on twitch tv app, I could only click on highlighted streams. In every other app and Chromecast menu clicking worked as expected though.

Try setting up wireless adb debugging and provide a log.

@virresh
Copy link
Owner

virresh commented Dec 25, 2022

+1 to everything @kokotas89 said.

@Moksh99 Just wanted to check if you're using the adb pre release version ?

There were three variants in the pre-release post of which two don't work
I've removed the two that don't work to avoid confusion now.

@virresh
Copy link
Owner

virresh commented Dec 25, 2022

Also on the scroll issue, I remember there was a community contribution which enabled bordered window and scroll on hitting border sides. Maybe that offers a better experience?

In case you try that, let me know the experience / improvements you think in a separate issue. Let's limit future discussions here to Android 12 issues :D

@sujhran
Copy link

sujhran commented Dec 26, 2022

+1 to everything @kokotas89 said.

@Moksh99 Just wanted to check if you're using the adb pre release version ?

There were three variants in the pre-release post of which two don't work I've removed the two that don't work to avoid confusion now.
@Moksh99 uninstall previous version and install adb version. Mouse Click will work.

https://github.com/virresh/matvt/releases/download/v1.0.7-pre/matvt-app-release-1.0.7-adb-pre.apk

@Moksh99
Copy link

Moksh99 commented Dec 29, 2022

Hi all,

I did uninstall previous version and again installed adb pre version using above link, but still same issue. It doesn’t click on the screen if the item doesn’t have focus selected. Not sure if I have to enable any other setting here. I did give special app permissions to display over other app and also enabled mouse toggle service as soon as I installed adb pre version. I did restart google tv once to see if it fixes the issue but still same behavior.

@MailYouLater
Copy link

Did you enable wireless adb debugging in Developer Options?
While the adb commands that were being discussed earlier may or may not be required, I'm fairly certain that the 'adb' test version of the app uses the loopback interface to send adb commands to the device for some functions.

@Moksh99
Copy link

Moksh99 commented Dec 30, 2022

Hi All,

I did enable ADB debugging by following this article here - https://www.reddit.com/r/Chromecast/comments/s96moi/how_to_connect_to_ccwgtv_via_adb_using_only_wifi/

After I allowed debugging prompt and always allow first time, it didn’t work. Then I fired command - adb shell settings put global block_untrusted_touches 0 and adb shell settings put global block_untrusted_touches 1 one after another.

After this, mouse started clicking items, even if it’s not selected, woo hoo …. Scroll is however not working as expected, once scroll is enabled, it randomly scrolls and very weird behavior, so had to come out of it to use CCwGTv properly again.

Just for my own satisfaction, After all this, I disabled usb debugging option again and tried mouse operations but it didn’t work, same problem as before. Once I enabled usb debugging again, it started working. Once you enable, it will again ask for allow and check box as well which one has to allow and check the box.

Summary - use the adb-pre.apk shared by virresh but also make sure that usb debugging is enabled following the link below - https://www.reddit.com/r/Chromecast/comments/s96moi/how_to_connect_to_ccwgtv_via_adb_using_only_wifi/ and make sure you check the box and always allow, when it asks first time.

Thank you @virresh , @sujhran, @kokotas89 and @MailYouLater for guiding throughout this and special thanks to @virresh for enabling this app to users like me. Liked working with you all, cheers 👍🏻 Happy new year in advance !!!

@hellemmm
Copy link

hellemmm commented Feb 3, 2023

Hi, i have same issue! I press left-click but nothing happens... But it is clickable with hardware mouse...
I use philips 65PUS8506/60 tv, android TV 11
I use MATVT 1.0.6
Any help?

@virresh
Copy link
Owner

virresh commented Feb 4, 2023

@hellemmm
Try MATVT v1.0.7-pre release - https://github.com/virresh/matvt/releases/download/v1.0.7-pre/matvt-app-release-1.0.7-adb-pre.apk

There are known issues on Android 11. See #28 for details.

@hellemmm
Copy link

hellemmm commented Feb 4, 2023 via email

@hellemmm
Copy link

hellemmm commented Feb 4, 2023 via email

@hellemmm
Copy link

hellemmm commented Feb 4, 2023 via email

@jtc1953
Copy link

jtc1953 commented Mar 13, 2023

Hi. After I got the MA VT v1.0.7-pre release installed I finally able to click with center button. (Google TV Android12). I have a suggestion.: It would be nice with an option when the mouse pointer reach a side (border mode enabled) automatically turns into scroll mode.
Btw. Sometimes I get a promt to allow a RSA-key ???

@virresh
Copy link
Owner

virresh commented Mar 13, 2023

Btw. Sometimes I get a promt to allow a RSA-key ???

Yup, the RSA key prompt is because we use ADB under the hood.
aquirozc have contributed some improvements in how adb engine works, that should automatically save the RSA key.
If you're interested in trying that out, check out the interim release they created at
https://github.com/aquirozc/matvt/releases/download/v1.0.7-internal-pre-release05/MATVT.1.0.7-rs_adbserver_testbranch-main_lab-test25.apk

It would be nice with an option when the mouse pointer reach a side

Noted.

@ferengialliance
Copy link

I'm a bit late to this party! Firstly thank you Virresh for your efforts!
I have been unable to get the 4k CCWGTV remote centre button to mouse click since the V12 upgrade.
I have read through the above and think I understand the issue, but am struggling with implementing the fix.
I have installed MATVT 1.07 3 times now (by creating a tinyurl and sticking it in downloader app)
First I uninstalled v1.0.6
then tried : matvt-app-release-1.0.7-pre2.apk this is the Android 12 version?
I enabled both permissions - didn't work - enabled USB debugging in developer options (i don't see any mention of ADB in there) - restarted - no joy. So I started again...
Same process with the ADB version and finally the lab test version above.

Is there something daft I am doing/not doing? Happy to be told I am :)

@virresh
Copy link
Owner

virresh commented Mar 22, 2023

Hey @ferengialliance
Sorry for the confusion, I haven't really got around to finishing refactoring of code which will remove two different versions unite them in one apk.

The pre2 apk is for devices that still support faketouch (e.g #61). It offers better precision and latency, but there are many devices that do not work with the gesture api because of faketouch.

As a workaround, there is an adb pre-release which should work in this case - https://github.com/virresh/matvt/releases/download/v1.0.7-pre/matvt-app-release-1.0.7-adb-pre.apk

Let us know if this works for you. This has latency issues though. Also feel free to try https://github.com/aquirozc/matvt/releases/download/v1.0.7-internal-pre-release05/MATVT.1.0.7-rs_adbserver_testbranch-main_lab-test25.apk
This is community contributed adb version by aquirozc, has a lot of improvements, like fixes in scrolling behaviour and automatically saving the rsa key so you don't have to deal with RSA checkboxes everytime.
It'll make it's way into the next release, dependent on whenever I get time to finish combining different engines 😅.

@ferengialliance
Copy link

Thanks @virresh I got around to installing the aquirozc version and all is good now , I may have missed the supplemental pop up for allowing usb debugging the first time I installed??, although I did it in developer settings manually 🤷🏽 - in any case it works! Good stuff!

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