MZD Headunit App for Android Auto
Instructions for Android Auto Wireless Support (v1.09+):
Initial wireless connection
- PHONE: Enable Developer Settings on Android Auto
- CAR : Start car
- PHONE: Create a personal hotspot
- CAR : Connect Wifi to personal hotspot
- PHONE: Open Android Auto app and go to “about”. Open the menu and tap “Start Head unit Server”
- CAR: Android Auto Headunit will start automatically
- CAR: Exit Headunit
- PHONE: Stop Head unit Server. Disable developer mode (options).
- CAR: Disconnect personal hotspot
- PHONE: disable personal hotspot
Changelog since v1.0:
- Bluetooth calling issue resolved with patch to sound config files
- Audio streams adjusted
- Video focus is lost at beginning and end of a Bluetooth call
- Bluetooth calling issue completely resolved (no patch needed)
- MZD multicontroller buttons mapped:
- Nav - AA home
- FAV () - Regain video focus
- Call - AA Phone context or Answer calls
- Call End - End Call
- Tap textarea on credits screen to view headunit.log
- Video Focus on Bluetooth calls issue resolved
- AA Log scrollable (credits screen)
- Some Audio volume/quality issues resolved
- GPS code rewritten to be more stable and work in parallel with MZD Navigation
- AA Media registered on its own separate stream (resolves multiple audio focus issues)
- Remapped FAV () Button - Switch audio focus to MZD Entertainment
- Control USB audio with prev/next buttons (when it has audio focus)
Beta releases will have 1 or more features from the next version but official releases will have more stable code.
v1.06b(Car GPS disabled)
Mirror for v1.05b, v1.06 & v1.06b
Another Mirror for v1.06
Mirror for v1.07
v1.10+ (Without HUD because feature was unstable)
How To Run Android Auto In Ubuntu (Virtual Machine)
OR just Ubuntu Ubuntu v16.04 64-bit as the main OS.
To Run: Ability to follow these instructions, create a Virtual Machine, use a command line interface, and basic understanding of git and bash shell scripting.
Android Phone: v5+ with Android Auto App installed and USB Debugging Enabled.
USB Bluetooth Receiver: or built in Bluetooth receiver.
Part 1: Virtual Machine
If you already know how to do this or are already on Ubuntu/Linux skip to part 2 These are instructions for Windows 10 and Ubuntu 16.04(64-bit) but any recent Mac OS and Linux distro should work just as well.
|- Create an Ubuntu (Linux) Virtual Machine and boot up Linux with a disk image from the link above|
|- Give plenty of allowed RAM and Disk Space (you can use VDI Virtual Disk Image) and complete the installation|
|- While the installation is running, you can set up your USB devices (phone and Bluetooth) to connect automatically in settings>USB. When adding a device erase all entries except for name, Vendor ID, and Product ID (you can delete Product ID field too if your phone is having issues reconnecting). Then after they are set up disconnect them until the installation is finished and the system reboots.|
|- When Ubuntu is finished installing, try connecting your USB devices. In the menu under devices>USB there should be a check mark next to your Bluetooth receiver and phone. If there isn’t try to connect them, if you are getting an error you might need to fix your drivers like I did. I had to do this to get my USB devices to work Method No. 2|
|- By now you should have a fully functional Ubuntu Virtual Machine running with working USB drivers to use your devices.|
Part 2: From 0 to AA
Once Ubuntu is all set up this is the complete set of commands to take you from 0 to Android Auto in about 30-60 minutes:
cd ~ sudo apt-get install git adb bluetooth libbluetooth-dev tlp blueman bluemon bluez libsdl2-2.0-0 libsdl2-ttf-2.0-0 libportaudio2 gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-alsa sudo apt-get install libssl-dev libusb-1.0-0-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libsdl1.2-dev libgtk-3-dev libudev-dev libunwind-dev libsdl2-dev libgstreamer-plugins-bad1.0-dev protobuf-compiler libdbusxx git clone --recursive //github.com/gartnera/headunit.git sed -i 's/xvimagesink/ximagesink/g' ~/headunit/ubuntu/outputs.cpp # ONLY NEEDED if running on a virtual machine cd ~/headunit/ubuntu make clean && make sudo ./headunit
Now you have the Android Auto Ubuntu Emulator Installed, every time you want to open the emulator back up you just enter the command:
To compile a headunit binary for use in the car run:
cd ~/headunit/mazda && make clean && make
I hope this will lead to more programmers who did not want to bother installing a new operating system or spend a lot of time figuring out how to set up the development environment and whatnot to contribute to the Android Auto project. I tried to make these instructions as simple, clear, and straightforward as possible but if there are any ambiguities or you have an improvement or suggestion for this tutorial shoot me an email. To all my fellow HaXors out there Happy Hacking!
NOTES: You may need to manually reconnect your phone if it is disconnected by AA. You need to have your phone in MTP mode (you can try PTP as well) to make the adb connection properly. if you are having trouble connecting you may be using an incompatible Bluetooth receiver.
AA Headunit app repository: <//github.com/gartnera/headunit.git>
These are the dependencies: <//github.com/gartnera/headunit/tree/master/ubuntu>
Now that you have Ubuntu set up and the Mazda arm toolchain installed you can also compile and run the CastScreen-Receiver:
cd ~ git clone //github.com/JonesChi/CastScreen.git cd CastScreen/receiver && make sudo sh ./wait_adb.sh reboot
To start again:
cd ~/CastScreen/receiver sudo sh ./wait_adb.sh