FORUMS
Remove All Ads from XDA

[Android 4.1+] Headunit for Android Auto - 160117 - Self Mode+ other fixes, x86, 720p

7,827 posts
Thanks Meter: 4,164
 
By mikereidis, Inactive Recognized Developer on 2nd June 2015, 10:32 AM
Post Reply Email Thread
7th June 2015, 11:17 PM |#21  
Member
Thanks Meter: 9
 
More
Hey. N7 12 video is somewhat slow, but accurate without corruption.
All nexuses are completely stock.
After further investigation, it appears like the nexus 7 13 doesn't have otg support at all...
 
 
7th June 2015, 11:41 PM |#22  
Junior Member
Thanks Meter: 6
 
More
Thanks for all the help Mike!

For everyone following, I'd just like to offer some public thanks to Mike for helping me solve my problems. Even though the problem ended up being a misconfiguration on my end, Mike took the time to send me a debugging build of Headunit to help me track down the problem. I think the price (less than $9, as I recall) is well worth the functionality provided, and I encourage everyone who's looking for this functionality to buy Mike's app.

Here's a recap of my problem for posterity:

Problem
When I plug my Android phone (Nexus 4) into my Android tablet (Nexus 7) running the Headunit software, the display on my tablet remains black, and Android Auto does not open on my phone.

Solution
MTP mode was not enabled. To further debug, I decided to plug my Nexus 4 into my computer, to see if it would register. As I had been in USB debugging mode (to use Fastboot for flashing new images), MTP mode was disabled. However, I had already disabled USB debugging mode, believing this would have automatically re-enabled MTP mode. For some reason, that did not happen, and my device failed to register at all.

If your device appears not to be working, plug it in to your computer, and see if it shows up as a media player. If it does not, Headunit will not be able to see it. To re-enable MTP mode on your phone (in case it has become disabled), go to...

Applications > Settings > Storage > Menu (three vertical dots in the top-right corner on Android 5.x) > USB computer connection > Connect as > Media Device (MTP)

Then unplug your phone from your tablet, close the Headunit app, re-plug your phone, and you should see the USB popup on your tablet. After confirming this request, Headunit should work!

Great job Mike! I hope to see more improvements to this setup!
The Following 3 Users Say Thank You to jpreston84 For This Useful Post: [ View ] Gift jpreston84 Ad-Free
8th June 2015, 12:05 AM |#23  
OP Inactive Recognized Developer
Flag Ottawa/Gatineau, Canada
Thanks Meter: 4,164
 
Donate to Me
More
Quote:
Originally Posted by CJSnet

Hi, good work on getting this started. For me the deal breaker feature down the line would be car integration, namely:

Bluetooth calls take place over car mic and speakers
Steering wheel controls (volume, answer, next track, etc.)
I imagine some support for the pioneer adapter that allows this would be feasible.

Any plans or knowledge about that?

Yes, making it "all work together" seamlessly and as annoyance and bug free as possible is why I want to leverage Android Auto. I think Google has the resources and the will and profit potential that's needed to iron the problems out and perhaps become dominant in car infotainment.

If Google does not provide some highly sought features, like AA over WiFi or a standalone mode, I will try to do what I can to assist others or provide them myself in this app or some other.

Yes, supporting steering wheel controls etc. and OBD-II or other sensors is on my "try to do list".

AFAICT, Idatalink Maestro seems to be the most recommended device for supporting OEM controls. I'm not sure yet exactly how the connection could be made, but I guess it's a serial port of some kind and there is a documented protocol, private perhaps. I'll get one for my Pioneer 4100-NEX.
The Following User Says Thank You to mikereidis For This Useful Post: [ View ] Gift mikereidis Ad-Free
8th June 2015, 12:17 AM |#24  
OP Inactive Recognized Developer
Flag Ottawa/Gatineau, Canada
Thanks Meter: 4,164
 
Donate to Me
More
Quote:
Originally Posted by ldti

Hey. N7 12 video is somewhat slow, but accurate without corruption.
All nexuses are completely stock.

App will need a Frames Per Second display, and some other performance metrics.


Quote:
Originally Posted by ldti

After further investigation, it appears like the nexus 7 13 doesn't have otg support at all...

I thought this too, of my N7 2013 and my Xperia Z2 Tablet. I just couldn't get my app to work, but I didn't explore it much because there were still plenty of major issues to fix on N9 and N7 2012.

At some point I tried N7 2013 and Z2 Tab through a powered USB Hub and it worked. So I assumed they needed a Hub and couldn't provide power.

Then later I tried without a hub and it worked and it's been working for me since.

Maybe a direct connection will only work when the mobile device running AA is close to fully charged. If discharged, maybe the device requests more current than the tablet can give ?

I'm not sure but I'll do more testing, and see if I can find clues in the logs and USB APIs. Getting hardware based (USB) Android apps working on a wide range of devices can be pretty tricky...


If you have any other cables to try, that's a good idea. I have some that just won't work, and some others that seem "noisy". I see the same thing people report when using the Pioneer headunits; try a better cable and it may magically work, even if that cable works for other purposes or the same purpose but on a different device, or just a difference in battery charge or a fresh reboot.
8th June 2015, 12:22 AM |#25  
Member
Thanks Meter: 9
 
More
Interesting. Could indeed be power related since I got a slow charging notice on the HTC m8 (aa device) that I didn't get when connecting to the 2012.
However , I was unable to get even a flash stick working on the 2013, and only have one otg adapter. I will try a USB hub tomorrow.
8th June 2015, 12:35 AM |#26  
OP Inactive Recognized Developer
Flag Ottawa/Gatineau, Canada
Thanks Meter: 4,164
 
Donate to Me
More
Quote:
Originally Posted by sicconi

Mike, I am really excited to test Aahed on my Nexus 7 2013, to simulate an Android Auto to connect my Nexus 5 to. Both are running LL 5.1.1
I used an OTG cable as suggested, host side connected to the Nexus 7. Aahead release #2 was just installed and launched. The two pop-ups to allow USB access show up as you mention, and I oked both.
On the Nexus 5 side, I installed Google's latest Android Auto app, which requested me to authorize Maps and Google Play after I connected the Nexus 7. Eventually it showed an Android Auto logo, presumably allowing Aahead to take control and manage the screen on the Nexus 7.
But Aahead shows a black screen, other than the virtual buttons (back/home/menu).

I think that cable and connections are fine, as otherwise Android Auto would not have completed the setup sequence. Aahead is running, or I would not have been prompted with the two requests to use the USB port. But what is missing to get the Nexus 7 to show something on the screen as Android Auto host head unit?

Thank you.
Roberto

p.s. I think that creating this development/testing environment for Android Auto is a wonderful idea

Hi, FYI I've renamed the app to simply "Headunit".

I hope you don't mind that I've copied your post to my new thread here: http://forum.xda-developers.com/gene...-auto-t3125252

I will close the original "I should create an app" thread to redirect discussion to the new; 1 thread is easier than 2 for everyone I think. (Original: http://forum.xda-developers.com/andr...de-aa-t3059481)


Yes, if you've gotten that far then the USB connection and pretty much all of the initial protocol exchange has been successful. One of the few reasons for problems at that point is a bad H.264 decoder, but if you have a stock-ish N7 it should be fine.

I'll presume that "latest" AA app means you have the June 3/4 release. Otherwise you might be having the "outside of the US" problem I solved here: http://forum.xda-developers.com/andr...abled-t3102020

It MIGHT help to open the Android Auto app, tap 7 times on the picture to enable Developer mode, then hit the dots overflow men for Developer Settings, and enabling "Skip Disclaimer".

Rebooting the devices may help also; you are very close I think; just one more piece of "magic" to solve.
8th June 2015, 12:50 AM |#27  
OP Inactive Recognized Developer
Flag Ottawa/Gatineau, Canada
Thanks Meter: 4,164
 
Donate to Me
More
Quote:
Originally Posted by jpreston84

Thanks for all the help Mike!

For everyone following, I'd just like to offer some public thanks to Mike for helping me solve my problems. Even though the problem ended up being a misconfiguration on my end, Mike took the time to send me a debugging build of Headunit to help me track down the problem. I think the price (less than $9, as I recall) is well worth the functionality provided, and I encourage everyone who's looking for this functionality to buy Mike's app.

Here's a recap of my problem for posterity:

Problem
When I plug my Android phone (Nexus 4) into my Android tablet (Nexus 7) running the Headunit software, the display on my tablet remains black, and Android Auto does not open on my phone.

Solution
MTP mode was not enabled. To further debug, I decided to plug my Nexus 4 into my computer, to see if it would register. As I had been in USB debugging mode (to use Fastboot for flashing new images), MTP mode was disabled. However, I had already disabled USB debugging mode, believing this would have automatically re-enabled MTP mode. For some reason, that did not happen, and my device failed to register at all.

If your device appears not to be working, plug it in to your computer, and see if it shows up as a media player. If it does not, Headunit will not be able to see it. To re-enable MTP mode on your phone (in case it has become disabled), go to...

Applications > Settings > Storage > Menu (three vertical dots in the top-right corner on Android 5.x) > USB computer connection > Connect as > Media Device (MTP)

Then unplug your phone from your tablet, close the Headunit app, re-plug your phone, and you should see the USB popup on your tablet. After confirming this request, Headunit should work!

Great job Mike! I hope to see more improvements to this setup!

Great !

Yes, USB mode is something I haven't tested much yet, so I'll see what I can find and add the info to my trouble-shooting and usage posts.

I've noted that stock ROMs often have differences in this area. I've found it aggravating that on many devices I can't prevent the Gallery or Image Importer type apps from starting up despite sometimes being able to select "USB - Charge only".

A WiFi mode where USB is only and optionally used for charging can't come soon enough, though it may come with a new set of problems like lag, particularly in a noisy RF environment that can be common in cars.

Hmmm, A Google supported WiFi mode will likely make a standalone mode (1 device, running AA & HU both) easier to do in this app, maybe even without root... Google might not do it for this reason, or do it in a way that makes it difficult...
The Following 2 Users Say Thank You to mikereidis For This Useful Post: [ View ] Gift mikereidis Ad-Free
8th June 2015, 01:47 AM |#28  
Junior Member
Thanks Meter: 6
 
More
My current feature request list (some of which, in my opinion, should be accomplished by separate apps) includes...

1) Bluetooth headset emulation. I assume that a stock Android Auto setup connects audio through Bluetooth A2DP and HFP profiles. As I can't do this yet, I'm unable to use the microphone and speakers on my N7 for most Android Auto functionality. While a normal Bluetooth adapter could provide audio to a car's 3.5mm aux input, this often will not include a microphone. As it is, voice recognition tasks don't work while in Android Auto with Headunit. An ideal setup would be to connect the phone to the Headunit device (usually a tablet), which will provide a microphone, and will be able to route stereo audio out to the car or elsewhere through its own 3.5mm jack.

2) Screen mirroring and remote touch input. There are plenty of apps which are not, and may never be Android Auto compatible. However, many of them will also work quite well in landscape mode, and may be suitable for a car. For instance, I very commonly use Audible to listen to audio books on long trips, and its landscape interface is perfectly suitable (in my opinion) for use on a car head unit. While there are several screen-mirroring options out there, (i) none seem to work over a USB connection, (ii) a number of them won't mirror audio (maybe not a problem if we can get bluetooth emulation), and (iii) most do not offer remote touch screen control, to control the phone from the tablet interface.

3) OBD2 and other car sensor support. I would, personally, like to see this built in a way that can be customized by a user community, with a scripting format that can be modified by users to provide for whatever custom sensors their car might have. This is just a "nice to have" in my book, but is not absolutely essential. Apps like Torque exist already, and may cover most of this. Still, it'd be great to be able to monitor all those door sensors, collision alert features, tire pressure sensors, etc that exist in newer vehicles.

4) Car button support. This is really important for a lot of us. With cars including a lot of buttons that can be accessed through CANBUS and other interfaces, being able to use these buttons would be really important. Some of the Chinese Android-powered head units seem to be able to do this already.

5) Physical button support. Being able to connect external button panels (perhaps as "keyboard" inputs via something like a TeensyUSB?) and get functionality for them would be very important as well.
8th June 2015, 04:46 AM |#29  
sicconi's Avatar
Junior Member
Flag Danbury, CT
Thanks Meter: 3
 
More
Almost there...
I installed Headunit to replace aahead (and thank you for your prompt response). The Android Auto I installed from Google Play was dated June 3 (v. 1.1.069961). To play it safe I uninstalled it and reinstalled, which forced the first time requests about Bluetooth GPS, etc.

Per your suggestion, I tapped 7 times on AA to enable Developer Mode, and then I checked "Skip Disclaimer". Then rebooted both the phone and the tablet.
With both devices connected, I launched Headunit, double authorized USB port use, launched AA... Still no connection. I disconnected the USB male plug from the OTG cable and reconnected. I had to double authorize the USB connection again, but this time AA switched to the Android Auto logo, and on the tablet I saw the bottom bar with the 5 icons. First (partial) success. Screen stuck, though.
I repeated the procedure, this time I got some explanation screens on the tablet. I went step by step through the suggestions about GPS, Music, etc. and finally landed with a full menu on the tablet. I switched to Maps, then to Music, select NPR and the scree got stuck again.

I restarted the system a few times, trying different combinations of starting the apps, connecting/disconnecting the cable on the tablet side, on the phone side, but best seems to be between the USB cable and the OTG cable. After a few attempts I managed to get AA going again, with full screen on the tablet again. I managed to select different music players (not Google, but NPR One, Stitcher Radio, iHearthRadio, TuneIn Radio) worked. I was surprised to see that the music would play on the phone, not on the tablet (as I expected/hoped). No big deal. Then I tried to use the microphone button to select a destination, or a song, but Google Now does not recognize input from the mike (neither on the phone nor on the tablet).
After some switching between apps the graphics on the tablet screen started getting a little corrupted, like fresh paint dripping vertically. Occasionally switching app would fix the screen. I disconnected and reconnected, usual steps, but now I cannot get the full screen on the tablet anymore.

I tried using different microUSB cables, but only a few seem to work (I discovered that only the ones that make the battery icon on the phone show "charging" work). The only OTG cable that works is a passive one. Two other ones adapters I have that sport an extra microUSB port to connect to a charger don't seem to allow AA and Headunit to connect.

So... I made a lot of progress, but getting the combination of phone, tablet, USB cable and OTG adapter work reliably is still tricky. You warned us that your code is labeled "experimental"...

Let me know if there are any tests or log collections I can do to help pinpoint the reasons for the somewhat unpredictable behavior. I enjoyed playing with AA/Headunit on the tablet, as long as it lasted... I ordered 2 more OTG adapters (different versions, to see if I manage to get a reliable one).

Thanks!


Quote:
Originally Posted by mikereidis

Hi, FYI I've renamed the app to simply "Headunit".

I hope you don't mind that I've copied your post to my new thread here: http://forum.xda-developers.com/gene...-auto-t3125252

I will close the original "I should create an app" thread to redirect discussion to the new; 1 thread is easier than 2 for everyone I think. (Original: http://forum.xda-developers.com/andr...de-aa-t3059481)


Yes, if you've gotten that far then the USB connection and pretty much all of the initial protocol exchange has been successful. One of the few reasons for problems at that point is a bad H.264 decoder, but if you have a stock-ish N7 it should be fine.

I'll presume that "latest" AA app means you have the June 3/4 release. Otherwise you might be having the "outside of the US" problem I solved here: http://forum.xda-developers.com/andr...abled-t3102020

It MIGHT help to open the Android Auto app, tap 7 times on the picture to enable Developer mode, then hit the dots overflow men for Developer Settings, and enabling "Skip Disclaimer".

Rebooting the devices may help also; you are very close I think; just one more piece of "magic" to solve.

8th June 2015, 04:22 PM |#30  
BlkSquad's Avatar
Senior Member
Flag Huntsville, AL
Thanks Meter: 28
 
Donate to Me
More
Purchased from Play Store to support the dev.

Mike, I'd like to see same screen use for the headunit app. Such as, I can mount my Nexus 6 and this screen size is sufficient for me using the AutoMate app. I'd prefer the native AA such as your app provides though. Also, is there a Google+ beta group? The Play Store still shows June 2 for me.
The Following User Says Thank You to BlkSquad For This Useful Post: [ View ] Gift BlkSquad Ad-Free
8th June 2015, 09:32 PM |#31  
Junior Member
Thanks Meter: 1
 
More
I can confirm working with stock (rooted) nexus 5 and Stock (rooted) nexus 7 2013. Took a little research to get working properly. N7 2013 does not support usb host out of the box, from what i can tell this is due to voltage output through the usb. (feel free to correct me if im wrong) To fix this i installed stickmount (requires root), search xda. Also a powered usb hub was used; N7 -> otg -> host port usb hub. N5 -> general usb port on hub

found an issue where if device running headunit was returned to home screen, headunit app would be blank on relaunch (reboot to fix). also noticed a slight video pixelation at times, fixed when changing screens.

would love to see OBD support, as i currently use torque and a bluetooth obdii adaptor

will be purchasing app to support dev, thanks for all the work. can't wait to see how this app evolves
The Following User Says Thank You to rsalem For This Useful Post: [ View ] Gift rsalem Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes