headunit icon indicating copy to clipboard operation
headunit copied to clipboard

Rotary mode only (no touchscreen)

Open zahitkara opened this issue 6 years ago • 29 comments

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

zahitkara avatar Nov 01 '18 14:11 zahitkara

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!

bnwgraaf avatar Dec 01 '18 08:12 bnwgraaf

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

mishan avatar Dec 01 '18 19:12 mishan

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

bnwgraaf avatar Dec 01 '18 19:12 bnwgraaf

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?

lmagder avatar Dec 01 '18 19:12 lmagder

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.

Trevelopment avatar Dec 01 '18 21:12 Trevelopment

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.

zahitkara avatar Dec 01 '18 21:12 zahitkara

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?

Trevelopment avatar Dec 01 '18 22:12 Trevelopment

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

zahitkara avatar Dec 01 '18 22:12 zahitkara

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.

Peck07 avatar Dec 01 '18 22:12 Peck07

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.

zahitkara avatar Dec 01 '18 22:12 zahitkara

@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 :)

Peck07 avatar Dec 01 '18 22:12 Peck07

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

zahitkara avatar Dec 01 '18 22:12 zahitkara

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?

Trevelopment avatar Dec 02 '18 00:12 Trevelopment

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 avatar Dec 02 '18 08:12 bnwgraaf

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

bnwgraaf avatar Dec 02 '18 22:12 bnwgraaf

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

Trevelopment avatar Dec 08 '18 07:12 Trevelopment

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

mishan avatar Dec 08 '18 08:12 mishan

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 avatar Dec 08 '18 08:12 Trevelopment

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 avatar Dec 08 '18 08:12 Trevelopment

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.

Trevelopment avatar Dec 08 '18 13:12 Trevelopment

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?

bnwgraaf avatar Dec 08 '18 18:12 bnwgraaf

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?

orvilleladner avatar Dec 16 '18 18:12 orvilleladner

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.

Trevelopment avatar Dec 18 '18 08:12 Trevelopment

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?

bnwgraaf avatar Dec 18 '18 13:12 bnwgraaf

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.

zahitkara avatar Dec 18 '18 13:12 zahitkara

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

bnwgraaf avatar Dec 18 '18 13:12 bnwgraaf

Is someone still busy with this?

bnwgraaf avatar Jan 14 '19 00:01 bnwgraaf

Nope probably not.

Trevelopment avatar Jan 14 '19 08:01 Trevelopment

Check this out https://www.mazda3revolution.com/threads/aa-v1-14b-tru_go-fw55-59-fw70-abarth124-spider-sound-touch-usb-s-beta.239375/

Trevelopment avatar Jun 10 '20 02:06 Trevelopment