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

Rotary mode only (no touchscreen) #141

Open
zahitkara opened this issue Nov 1, 2018 · 29 comments
Open

Rotary mode only (no touchscreen) #141

zahitkara opened this issue Nov 1, 2018 · 29 comments

Comments

@zahitkara
Copy link

It would be awesome if we can change the AA mode from touchscreen to controller only. With controller mode you can do everything without touching screen like entering address, zooming in-out, moving maps, cancelling route. This will also helpful to people with touchscreen issues like phantom touches. Here is what i mean:

Touchscreen mode:
https://i.imgur.com/lEngnQx.jpg
https://i.imgur.com/eD3xTpX.jpg

Knob only mode:
https://i.imgur.com/EJFTCNN.jpg
https://i.imgur.com/FfH0nR8.jpg
https://i.imgur.com/L4UtZ8o.jpg

@bnwgraaf
Copy link

bnwgraaf commented Dec 1, 2018

Big +1!

I would like this too! I am a big fan of the rotary commander and of Android Auto, but I hate it that I have to use the touchscreen again and have to wipe the fingerprints regularly!

@mishan
Copy link

mishan commented Dec 1, 2018

The new Mazda OEM Android Auto does not support touchscreen, only supports the commander knob, and it works so well as it allows you to access every part of the UI which we currently can't with this version of AA. +1 for better knob support

@bnwgraaf
Copy link

bnwgraaf commented Dec 1, 2018

Wow, that sounds really great! I would love to be able to only use the rotary!

@lmagder
Copy link
Collaborator

lmagder commented Dec 1, 2018

Yeah this is one of those things that having a CMU based configuration UI would really help with since I think it shouldn't be too hard to switch.

Speaking of the official AA: I haven't got it yet, but to be honest it's kind of putting a damper on my enthusiasm for hacking on this project more. 🤔 Do other people feel similar?

@Trevelopment
Copy link
Collaborator

Trevelopment commented Dec 1, 2018

Luc my brother you should still be excited about this because you know they are not going to improve on the official version to support touchscreen / HUD / whatever else we can hack up to make it better. Plus it costs $200 hardware upgrade so its now similar to hacking the navigation for those won't want to pay the ridiculous price. Is there a good way to de-compile their binary with IDA or some other way to see how they implement certain things to improve on ours? I'm not that great at that hacking aspect probably because of my amateur C++ skills but I think that would be the best idea to hack our version to be better than the official. Maybe that can get you more enthused.

Another thing is I updated my bench-top unit to v70.0021 but without the new hub and I have gotten pretty close to getting our version of AA to run I just cant figure it out because once it gets to "waiting for device to reconnect" it "crashes" with no error or anything signifying what happened. I said "crashes" because the process doesn't actually crash because afterwards headunit is still running but the connection is broken and it kind of keeps trying to reconnect a bunch of times until it gives up so its a puzzler. To get it to run I had to kill both services each for CP and AA like this: killall -9 aap_service carplayd L_jciCARPLAY L_jciAAPA before doing that it tries to connect but crashes before it even gets to register the AA audio streams. So maybe there is another process that needs to be killed as well or something. And if you don't kill those you can see that AA uses 2 MLENT streams jut like we did but CP registers like 6 different streams for some reason.

@zahitkara
Copy link
Author

Thanks for all your effort Trez. I really appreciate it. I can use the AA emulator on my windows 10 computer. The executable file is called 'desktop-head-unit.exe' if i run this the AA screen comes with full touchscreen mode. Not any key from keyboard can be used but if i run the exe file like 'desktop-head-unit.exe -i controller' this time the AA screen work only with keyboard.

I don't know much about AA headunit source code but there must be a variable which indicates the car has touchscreen or not. And the headunit works with either touchscreen enabled mode or commander mode.

@Trevelopment
Copy link
Collaborator

Trevelopment commented Dec 1, 2018

OK so can we get one thing clear, when using official AA in the car does the touchscreen not work at all or just when driving?

@zahitkara
Copy link
Author

It does not work at all.
Check out this video.
HOW TO: Use Android Auto

@Peck07
Copy link

Peck07 commented Dec 1, 2018

Slightly connected to this topic: I am mainly using Waze on AA (unofficial :) ), worked like a charm, but now, I can't select the menu with the joystick where I can choose alternate routes / sound configuration.
So it's not only a headunit thing.

@zahitkara
Copy link
Author

Slightly connected to this topic: I am mainly using Waze on AA (unofficial :) ), worked like a charm, but now, I can't select the menu with the joystick where I can choose alternate routes / sound configuration.
So it's not only a headunit thing.

Because it's working in kind of hybrid mode. Another thing is, after the last update they've redesigned the music player. If you are using the touchscreen everything is fine but if you're trying to navigate only using commender buttons good luck! You can't go back to music players main menu from sub-menus.

And @Trevelopment another thing i've noticed. Our modified AA runs at 60 fps. Don't know about the official Mazda AA but all of the other cars I've used which has AA runs 30 fps. This 60 fps can also be the reason for sound shuttering and video lagging with AA wi-fi.

@Peck07
Copy link

Peck07 commented Dec 1, 2018

@zahitkara probably you are right... but I didn't upgrade the headunit, nor the AA, so the change could be only in the Waze app. Of course, I can reach that menu with the touchscreen, but that's not what I want during driving :)

@zahitkara
Copy link
Author

I feel you :) I hate using touchscreen for any reason. It feels dangerous and leaves nasty marks on the screen.

@Trevelopment
Copy link
Collaborator

Trevelopment commented Dec 2, 2018

And @Trevelopment another thing i've noticed. Our modified AA runs at 60 fps. Don't know about the official Mazda AA but all of the other cars I've used which has AA runs 30 fps. This 60 fps can also be the reason for sound shuttering and video lagging with AA wi-fi.

Well in hu_aap.cpp line 468 we have

videoConfig->set_frame_rate(HU::ChannelDescriptor::OutputStreamChannel::VideoConfig::VIDEO_FPS_30);

is that protocol buffer wrong or something?

@bnwgraaf
Copy link

bnwgraaf commented Dec 2, 2018

Hey guys, I am very excited to see you looking into "our" AA!
I myself are not planning to upgrade to the OEM AA, mainly because of the price. And even if I am enjoying AA every day, thanks to your efforts, I would like to see some things improved.

One of those things is that I hate the fingerprints when touching the screen, not only because they don't look nice, but also because they made everything less visible if the sun is shining directly on the screen.

Unfortunately I can't help you with changing the code, because my knowledge is not appropriate. But I can help you thinking about the things and share my experience when using AA.

I also have updated the phone app to version 3.8 and for the first time I have noticed some changes.
When receiving a message while not driving the car, the first sentence of the message is visible on screen.

The other changes are, as said above, some changes in the music player.

But I also noticed that navigation with the rotary commander has been changed and it doesn't work that good anymore, so I am forced to use the touchscreen more than I used to....

@bnwgraaf
Copy link

bnwgraaf commented Dec 2, 2018

The downloads are available from the Mazda firmware V70. Isn't it possible to get some clues by reverse engineering?

@Trevelopment
Copy link
Collaborator

I figured out the exact opposite of this which is to enable the touchscreen in the official AA but it doesn't help me figure this out at all

@mishan
Copy link

mishan commented Dec 8, 2018

@Trevelopment Hey would you care to share how to do that?

@Trevelopment
Copy link
Collaborator

Trevelopment commented Dec 8, 2018

well I can't test it because I dont have the official AA but I am pretty sure this is how you do it:
https://mazda3revolution.com/forums/2014-2018-mazda-3-skyactiv-audio-electronics/231483-official-aa-vs-aio.html#post2424205
add the touchscreen path to /aap_attributes/head_unit/input_devices/touch_screen/path in the xml

@Trevelopment
Copy link
Collaborator

Trevelopment commented Dec 8, 2018

most likely like this:

<touch_screen>
          <use_internally>TRUE</use_internally>
          <path>/dev/input/filtered-touchscreen0</path>
          <type>AAP_TOUCH_SCREEN_TYPE_CAPACITIVE</type>
</touch_screen>

that's definitely the path, I found it in mazda/outputs.cpp the other 2 im not 100% sure about but if they dont work you can always try FALSE and AAP_TOUCH_SCREEN_TYPE_RESISTIVE

@Trevelopment
Copy link
Collaborator

Trevelopment commented Dec 8, 2018

To get back on topic we should take note that the official AA maps every single android standard keycode from 0 - 271 and then some special AA keycodes that I just found out about from 65536-65543 (Includes the Navigation button finally found that sucker) in its code and I think in order to use the control knob to select from the keyboard we may have to do that as well. Although I could be wrong its just a thought.

@bnwgraaf
Copy link

bnwgraaf commented Dec 8, 2018

But might this doable?

Version 70 of the firmware can be downloaded. Isn't it possible to dig onto that code, or do we first have to install it on a headunit?

@orvilleladner
Copy link

well I can't test it because I dont have the official AA but I am pretty sure this is how you do it:
https://mazda3revolution.com/forums/2014-2018-mazda-3-skyactiv-audio-electronics/231483-official-aa-vs-aio.html#post2424205
add the touchscreen path to /aap_attributes/head_unit/input_devices/touch_screen/path in the xml

Trevelopment, I tried this change (FALSE and TRUE variables) this morning, details on the Mazda3Revolution forum, but it didn't work. I just noticed your other suggestion of changing capacitive to resistive, but haven't tried that. Do you have any other ideas while I'm in there again?

@Trevelopment
Copy link
Collaborator

OK thats a bummer but if that doesnt work I think they either did not even write touch screen support into the code or disabled it completely in the code to where we cant even turn it back on this way. this is a long shot but you could also try for the path: /devices/virtual/input/input0
but that is just grasping for straws. There is one strange thing I noticed in the aap_service binary when you open it with notepad++ you can only see some of the plain text in the binary but enough to get some clues and this is the part that made me wonder:

 /aap_attributes/head_unit/input_devices/touch_screen/use_internally Failed to allocate memory for new input device
TRUE    Not using internal thread for touch input
 Exceeded max no of touch input device %d
  Maximum input device reached %d.
 /aap_attributes/head_unit/input_devices/touch_screen/path   Memory not allocated for device path
  Memory not allocated to store touch device %d

you can see the paths to the variables followed by the associated errors to catch but look after the use_internally line there seems to be a hard coded TRUE folowed by Not using internal thread for touch input so that hardcoded value may be preventing any other value from reaching that conditional so that touchscreen support with official AA would be impossible with the provided binary.

@bnwgraaf
Copy link

Are you guys trying to get touchscreen working in the original version, or getting the AIO AA working like the OEM version (completely with buttons and rotary commander) and getting the OEM layout of Maps?

@zahitkara
Copy link
Author

Are you guys trying to get touchscreen working in the original version, or getting the AIO AA working like the OEM version (completely with buttons and rotary commander) and getting the OEM layout of Maps?

Both actually. People using the OEM version wants to use touchscreen while AIO AA people including me wants to use full rotary commander version which show additional buttons on the map and allowing to enter letters using the commander knob.

@bnwgraaf
Copy link

Great!
Unfortunately I can't help you much but I hope you succeed!

@bnwgraaf
Copy link

Is someone still busy with this?

@Trevelopment
Copy link
Collaborator

Nope probably not.

@Trevelopment
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants