MZD-AIO icon indicating copy to clipboard operation
MZD-AIO copied to clipboard

Android Auto with FW 70 not working properly

Open mellda opened this issue 6 years ago • 27 comments

I love the AIO Tweaks. Great work! The best feature I was looking forward is wireless AA with navigation instructions in HUD. I have FW version 70 and when I installed the AIO with AA, it is automatically started over wifi but it is unstable. Sometimes I can see black screen. It was frozen once and even the restart (NAV + MUTE) did not worked. The sound from navigation or from spotify was not working as well. The system is slower. I cannot see the navigation instructions in HUD. The other tweaks are really good. When I uninstall the AA everything work very good and I am really glad I have it. But the AIO version of AA is not working with FW 70. Is it possible to fix it? If not I consider to downgrade the FW if possible.

mellda avatar Dec 10 '18 18:12 mellda

can you try adding this to headunit-wrapper? killall -9 aap_service carplayd L_jciCARPLAY L_jciAAPA that will kill both the service and the running instances of AA and CP so that might help

Trevelopment avatar Dec 14 '18 07:12 Trevelopment

What is headunit-wrapper? Should I connect to cmu over ssh using putty and run that command?

mellda avatar Dec 15 '18 04:12 mellda

https://github.com/Trevelopment/MZD-AIO/blob/master/app/files/tweaks/config/androidauto/data_persist/dev/bin/headunit-wrapper It will be in the config/androidauto/data_persist/dev/bin/ folder after you compile the installer replace line 40 pkill -f 'aap_service' with the aforementioned line. If you choose HUD then edit the headunit-wrapper in config/androidautohud/

Trevelopment avatar Dec 15 '18 08:12 Trevelopment

I have just tried that (I checked HUD so I editted androidautohud) and it didn't help. Still no audio. No navigation sound,no music and even when I say ok google, no sound at all. When I call someone,I can hear them. The volume/mute knob does not work.

mellda avatar Dec 15 '18 18:12 mellda

There are some errors. I tried to start "Android Auto Headunit" from "AIO Tweaks" app. The cmd content:

$ headunit-wrapper 2>&1 & ERROR: {"readyState":4,"responseText":"","status":404,"statusText":"error"}

img_20181215_191539746

I noticed that the cpu is running almost 50% so I wanted to connect using ssh but withnout success. My CMU was connected to my phone hotspot. I connected my laptop as well and tried to connect using putty. I tried to connect to 192.168.53.1 and port 2222. Not successful. Then I tried to open "Wifi AP" menu from "AIO Tweaks" app and same error:

$ start_wifi.sh && jci-wifiap.sh start ERROR: {"readyState":4,"responseText":"","status":404,"statusText":"error"}

imgx_20181215_193427774

Do you think it can be related to the problem with AA?

mellda avatar Dec 15 '18 19:12 mellda

That error is related to the file where stdout is written to not the shell commands themselves (404 is page not found that is a web error not a shell error) you are using the wrong port if you were using the adb method you would use 2222 but with wifi use port 36000, 24000, or just straight up 22

Trevelopment avatar Dec 16 '18 01:12 Trevelopment

Cannot connect to the ip with port 22, 36000 or 24000.

mellda avatar Dec 16 '18 15:12 mellda

I installed "Autorun & Recovery" with ID7, WiFi AP and Dryrun. Then I could see the network but when I connect, the CMU stopped the AP. I couldn't see the network any more and had to reboot it. I tried it second and third time. All the time the same. I tried my android phone and my Win 10 laptop. So I decided to uninstall the WiFi AP. I ran The "Autorun & Recovery" again but only with WiFi AP. I inserted the flash disk to the CMU and chose the Uninstall option. It seems that not only the WiFi AP was unistalled. When I ran "Autorun & Recovery" again but only with the ID7 and Dryrun, there were no prompt to install it. It cannot read the flash disk any more? What happened? Was it uninstalled at all? I can see the AIO Tweaks applications (like speedometer) but I cannot install/uninstall Autorun and probably the tweaks at all. I have FW v70. I don't want to open the car again and do the serial hack again. It was nightmare for me.

mellda avatar Dec 16 '18 16:12 mellda

OH Shit dammit you should not have done that you should have used the uninstall wifi AP script, shit I need to change that or add a warning or something but honestly this is the first time I have heard of this happening. You must not have seen this in the instructions. image sorry...

Trevelopment avatar Dec 18 '18 08:12 Trevelopment

No, there is still a way to get into this because you still have taken away all the protections from the firewall so there has to be a way to get in or maybe something was not right since you couldn't get in through those 3 ports then maybe the firewall file wasn't fixed. also your SSH root user/pass is still cmu/jci so you have the root user still if you can just connect to wifi and get in through one of those ports you can fix it the SSH bringback and wifi together are all you need and those both cannot be uninstalled for this very reason.

Trevelopment avatar Dec 18 '18 08:12 Trevelopment

But I cannot connect to the car. I could see the AP but when I tried to connect, I connected for a second or two and then it disconnected and I couldn't see the network any more until restart. I cannot access it using Wifi and USB. Is there still a way to get access at least by USB for installing/uninstalling tweaks?

mellda avatar Dec 20 '18 11:12 mellda

The reason you cant connect to the Wifi AP is because of a defective wifi adapter https://github.com/Trevelopment/MZD-AIO/issues/19. If you can connect the car wifi to your phone hotspot for long enough to transfer another autorun file then you can use a USB but when you uninstalled autorun you uninstalled the mechanism to install tweaks with USB.

Trevelopment avatar Dec 21 '18 00:12 Trevelopment

I have the same sound issue with FW 70. @mellda have you tried connecting your CMU to a different AP? I was able to log in through SSH using a portable modem and copied the .autorun file as @Trevelopment mentioned (did it before reading this thread). BTW I had some issues with the libgsth264parse which caused the black screen. Modifying the headunit-wrapper file adding export GST_DEBUG=4 at the beginning can help you to find out the cause of the issue.

puma3 avatar Dec 31 '18 19:12 puma3

I have the same issue: No audio when using android auto.

Before I installed AIO tweaks I have retro fitted the OEM AA/CP usb hub+cable on my 2018 CX-9. After installation of AIO tweaks using serial access, everything works flawlessly, but AA headunit app does not output sound. Bluetooth audio works, but stops when AA takes over audio source.

I love the AA headunit in the AIO tweaks simply because it allows touch screen, while the official AA does not allow touch screen at all even at full stop. I had tried uninstall the AA headunit app, and then the official Android Auto works fine.

Is there any way to fix? Please let me know how I can help.

szsong avatar Feb 12 '19 04:02 szsong

Hey @szsong are you connecting to AA with a USB cable or over Wifi? I have been working on this by connecting over USB but without the upgraded USB hub and ran into a libusb issue that I can't figure out https://github.com/gartnera/headunit/issues/147 so if you have some C++ skillz or libusb knowledge you could help a lot. I also know that you can connect to AA on v70 via wifi but some people have defective wifi receivers so they have to use USB and I think that there is also an issue with sound if you connect that way.

Trevelopment avatar Feb 12 '19 11:02 Trevelopment

@Trevelopment Thanks Trez. I was connecting using USB. Unfortunately I only have very limited experiences with C++. However thank you for all your hard work on all those project, it really means a lot! Thank you for pointing out the direction and I'll follow your work.

szsong avatar Feb 12 '19 20:02 szsong

@szsong that is very interesting so AA does work over USB with the upgraded hub? are you building headunit from source? Maybe it is a USB driver issue that is preventing AA from working with the old USB hub but I would think v70 would need to have both drivers to support the old and new USB hubs depending on which one you have. The updated libusb version (libusbx) must have some conflict with the old USB drivers and the developers probably decided that the best way to solve that is to use new drivers and upgrade the USB hub. @lmagder you said that headunit will use whatever libusb version the system is running but is there a way to maybe bundle the older version of libusb into the binary and force headunit to use it if the USB hub is stock?

Trevelopment avatar Feb 13 '19 09:02 Trevelopment

Also I want to add while exploring the official AA binaries I saw that they just use another gstreamer pipeline for audio instead of using alsa directly like we do. their pipeline looks something like this: appsrc ! aacparse parser ! audioresample resample ! capsfilter resample-filter audio/x-raw-int rate width channels caps ! beepdec decoder ! alsasink device

Trevelopment avatar Feb 13 '19 10:02 Trevelopment

@Trevelopment Yes. AA headunit app does indeed work over USB with upgraded hub. I am not building from source. Just used MZD-AIO-TI v2.8.3 to install AA headunit app (with serial access of course).

After installation, with my android phone connected, I can see two AA app, the official one is grayed-out, and the custom one runs just fine, with touch screen working properly (the official one does not support touchscreen). No audio output.

szsong avatar Feb 13 '19 18:02 szsong

@szsong, It seems to me that you may have a driver or software conflict between the 2 apps on your phone and the one installed on your MZD unit.. i doubt its a USB driver issue or even a cable issue.. the issue is with the AUDIO source not being handed over to the external source (the MZD).. are you aware that android auto has built in settings within the google settings of your phone?? as a suggestion, i recommend clearing the cache and clearing the data of both AA apps on your Android device. this will reset all settings and will help in narrowing down the cause of the problem..

in all honesty it basically just seems like a software conflict / issue.. or just simply wrong settngs

EDIT possible solution to fix your issue permanently is as follows..

  1. unpair your Android BT with your MZD unit.
  2. uninstall AIO AA app from Android device.. Be sure to clear all traces of the app (clear app data and app cache).
  3. Reboot Android device. 4a. Make sure USB debugging is enabled on your Android device. 4b. Connect Android device to Cars USB hub (with phone icon).
  4. Set USB mode to MTP when prompted on your Android device.

try that and let me know how you go

Davo86 avatar Feb 17 '19 01:02 Davo86

OK so I was wrong... it is not a libusb issue it is something deeper. I know this because I got headunit to use the older version of libusb and the same issue is still happening. I am guessing it has something to do with the drivers but here is what I get now when using libusb_get_version: version: 1.0.9.0

W: /home/mazda/headunit/hu/hu_usb.cpp:478: Start : Found OAP Device
W: /home/mazda/headunit/hu/hu_usb.cpp:486: Start : OK libusb_claim_interface usb_err: 0 (Success)
W: /home/mazda/headunit/hu/hu_usb.cpp:500: Start : Done get_config_descriptor config: 0x6b0b70  num_int: 2
W: /home/mazda/headunit/hu/hu_usb.cpp:526: Start : iusb_ep_in: 0x81
W: /home/mazda/headunit/hu/hu_usb.cpp:533: Start : iusb_ep_out: 0x01
W: /home/mazda/headunit/hu/hu_usb.cpp:603: Start :   SET: iusb_state: 2 (hu_STATE_STARTED)
W: /home/mazda/headunit/hu/hu_usb.cpp:114: Write :  libusb_submit_transfer for 10 bytes
W: /home/mazda/headunit/hu/hu_usb.cpp:305: libusb_callback_send : libusb_callback_send Status: 0 | 0 6
W: /home/mazda/headunit/hu/hu_usb.cpp:252: libusb_callback : libusb_callback 0 | 0 6
W: /home/mazda/headunit/hu/hu_ssl.cpp:209: hu_ssl_begin_handshake : SSL_do_handshake() ret: -1
W: /home/mazda/headunit/hu/hu_ssl.cpp:65: send_ssl_handshake_packet : BIO_read() HS client req ret: 307
W: /home/mazda/headunit/hu/hu_usb.cpp:114: Write :  libusb_submit_transfer for 313 bytes
W: /home/mazda/headunit/hu/hu_usb.cpp:305: libusb_callback_send : libusb_callback_send Status: 0 | 0 6
W: /home/mazda/headunit/hu/hu_usb.cpp:252: libusb_callback : libusb_callback 1 | 0 6
E: /home/mazda/headunit/hu/hu_usb.cpp:291: libusb_callback : libusb_callback: abort
W: /home/mazda/headunit/hu/hu_usb.cpp:231: usb_recv_thread_main : Requested to exit
W: /home/mazda/headunit/hu/hu_usb.cpp:240: usb_recv_thread_main : libusb_handle_events_completed: 2 (hu_STATE_STARTED)
W: /home/mazda/headunit/hu/hu_usb.cpp:242: usb_recv_thread_main : USB thread exit
E: /home/mazda/headunit/hu/hu_aap.cpp:99: hu_aap_tra_recv : errorf was signaled
E: /home/mazda/headunit/hu/hu_aap.cpp:1395: hu_aap_recv_process : Recv have_len: -1
W: /home/mazda/headunit/hu/hu_usb.cpp:624: libusb_callback_pollfd_removed : fd: 172
W: /home/mazda/headunit/hu/hu_usb.cpp:624: libusb_callback_pollfd_removed : fd: 166
W: /home/mazda/headunit/hu/hu_usb.cpp:624: libusb_callback_pollfd_removed : fd: 170
E: main.cpp:236: main : Something bad happened

I don't understand how the endpoint comes out to 0x01 instead of 0x02 I can't figure that out either then it is followed by this a few times then it will almost work again

W: /home/mazda/headunit/hu/hu_usb.cpp:478: Start : Found OAP Device
E: /home/mazda/headunit/hu/hu_usb.cpp:482: Start : Error libusb_claim_interface usb_err: -5 (Entity not found)
E: /home/mazda/headunit/hu/hu_usb.cpp:196: Stop : Done libusb_release_interface usb_err: -5 (Entity not found)
E: main.cpp:236: main : Something bad happened

for the sound issue I am guessing it is how we register the audio streams that is the problem.

openSession({"busName":"com.jci.usbm_am_client","destination":"Cabin","objectPath":"/com/jci/usbm_am_client"})
registerAudioStream({"focusType":"permanent","sessionId":21,"streamName":"MLENT","streamType":"Media"})

Trevelopment avatar Feb 18 '19 20:02 Trevelopment

@szsong, It seems to me that you may have a driver or software conflict between the 2 apps on your phone and the one installed on your MZD unit.. i doubt its a USB driver issue or even a cable issue.. the issue is with the AUDIO source not being handed over to the external source (the MZD).. are you aware that android auto has built in settings within the google settings of your phone?? as a suggestion, i recommend clearing the cache and clearing the data of both AA apps on your Android device. this will reset all settings and will help in narrowing down the cause of the problem..

in all honesty it basically just seems like a software conflict / issue.. or just simply wrong settngs

EDIT possible solution to fix your issue permanently is as follows..

  1. unpair your Android BT with your MZD unit.
  2. uninstall AIO AA app from Android device.. Be sure to clear all traces of the app (clear app data and app cache).
  3. Reboot Android device. 4a. Make sure USB debugging is enabled on your Android device. 4b. Connect Android device to Cars USB hub (with phone icon).
  4. Set USB mode to MTP when prompted on your Android device.

try that and let me know how you go

I have tried everything as you suggested, unfortunately they did not fix the missing audio. So I have unpaired my phone from MZD connect, removed bluetooth device "mazda" from phone, cleared cache an storage of AndroidAuto and deleted app. Re-installed AA app 1.10 with HUD support, then connected phone to car.

To my surprise, besides the missing audio issue, everything else is working almost perfectly, even the HUD shows correct directions when I use google maps navigation-AMAZING! The HUD shows distance units in km and meter instead of miles and ft, but it's trivial.

Audio still does not work. One thing I noticed is that, the mute/unmute button stopped working while AA is connected. even if I exit the AA headunit app and go to "music", the mute knob/button stopped working. Hope this helps.

Another finding is that, if I click "home" button inside AA app, it goes to black screen, unless I press "home" again. I hope there is some quick switch shortcut to go back-and-forth between AA and MZD screen, but I found the quickest way is to shout "hey google", and the AA headunit app will come to foreground.

szsong avatar Feb 20 '19 20:02 szsong

So I am reviewing the firmware files in the *.up files for differences between the base linux systems and curiously, sometime around the 59.00.441A transition to 59.00.546A(may have occured earlier in between), /etc/udev/rules.d/10local.rules were added and then updated in the transition to v70. Given that v70 is intended to use the new Hub it makes sense that there would be a difference. One thing to note is there is a physical port difference as well between the two hubs with the newer android auto/carplay hub having two USB connection lines and the older ones only have one. This may affect the naming convention and locations reported, I don't have the newer hub yet, but I am curious to see if I can create a rule that would allow the older hubs to be linked into the correct group and thereby enable the official android auto on them. I also wonder if this project has had the ability to see the difference usb systemwise between the older(texas instrument hub) and the newer panasonic hub.

onlyoneskwalla avatar Jan 03 '20 05:01 onlyoneskwalla

I have a Fiat Abarth 124 spider. I upgraded from fw 56 to fw 70.00.100 using this guide [ https://www.124spider.org/threads/carplay-android-auto-upgrade-howto.32286/ ], so I installed ID7 Tweak Package, then the new firmware, then Ameridan’s Version 70 NNG fix tweak, after that I upgraded the usb cable and hub. All worked fine, Android Auto working well and no problem. After that I installed AIO and selected also Android Auto HeadUnit App (by the way there is no alert this option is not compatible with fw >= 70, maybe you should add it). Now I have sometimes blank screens, sometimes can't play spotify and so on. I would like to use your Android Auto instead of FW70 because I would like to connect wireless using head unit, but your Android Auto often hangs. And yes, I tried to remove e repair my phone using bluetooth. I have also other glitches, gui sometimes is slow and speedometer and other apps sometimes don't open or crash. In attachment there are the logs created on usb pen drive during the AIO install, I hope you can use it to understand what is not working. I noticed these lines:

AIO_log.log rootfs 90% used resources 75% used

gst-inspact.log (gst-plugin-scanner:25912): GStreamer-CRITICAL **: gst_pad_template_new: assertion caps != NULL' failed (gst-plugin-scanner:25912): GStreamer-CRITICAL **: gst_element_class_add_pad_template: assertion GST_IS_PAD_TEMPLATE (templ)' failed

What should I do now to have a stable firmware? Should I use AIO and remove ONLY the Android HeadUnit app? Should I remove also video player (gstreamer error is about videoplayer)?

node.log AIO_log.log AIO_log-0.log gst-inspect.log info.log

enzodev avatar Jan 18 '20 17:01 enzodev

I also tried to uninstall AA 1.1 and install AA 1.2 beta but no luck, same problems. As soon as I uninstalled AA 1.2 I got a fast and responsive unit with no crash at all. I also noticed that bluetooth is working in a different way: I got sharing contact option and contacts are now synced at startup. Bluetooth and USB are working fine now. In the meanwhile this bug is fixed I think you should add an alert message in AIO to do not install AA with FW >= 70

enzodev avatar Jan 19 '20 18:01 enzodev

I too have this issue. I am on a 2020 Mazda CX-5 with AIO Tweaks on firmware 70.00.335 and whenever I install the v1.1 or v1.2 version it detects nothing over wireless and it just goes to a black screen on usb.

Mibix avatar Feb 07 '20 15:02 Mibix

Black screen on usb?? Is that with or without AA installed on the mazda unit itself? And with or without hardware upgrade?

Davo86 avatar Feb 15 '20 01:02 Davo86