First off, how to use/install:
build using included build.sh
copy file "mcud" to /system/bin/
set permissions on /system/bin/mcud to 755
add line to /system/bin/install-recovery.sh: /system/bin/mcud
if you don't have an install-recovery.sh, create it with the following;
#!/system/bin/sh
/system/bin/mcud
And don't forget to set its permissions to 755.
Right now, we have a bunch of different Java/Android projects, implementing communications with hardware
through questionable jni libraries. These projects are for the purpose of gaining control over the
unusual hardware design of SYU/FYT car radios, rather than relying on the horribly buggy and untrustworthy
software that is shipped with them, which among other things, also includes spyware.
These libraries in particular, include;
https://github.com/lbdroid/MCUController (DEPRECATED)
https://github.com/lbdroid/MCUKeyReceiver
https://github.com/lbdroid/BD37033Controller
MCUController is responsible for passing commands back and forth with the MCU via /dev/ttyS0. The MCU has
some I/O lines (ACC -din, headlights -din, reverse -din, parking brake -din, antenna power -dout, amplifier
power -dout, steering wheel 1 -ain, steering wheel 2 -ain), and the AMFM radio via i2c. Critically, it
sends a particular command sequence when it is preparing to power down several seconds after ignition off.
It also monitors whether or not the application processor is still responsive based on whether or not it
continues to receive heartbeat signals.
MCUKeyReceiver receives signals from MCUController when steering wheel buttons are pressed. It then
responds to those signals.
BD37033Controller is responsible for passing commands back and forth with the bd37033 sound processor
via /dev/i2c-4. This sound processor has several stereo inputs and dual stereo + low frequency output.
It controls audio selection, balance, fade, volume, and mixing.
There are also some utilities;
https://github.com/lbdroid/MCURadio
https://github.com/lbdroid/HFPClient
HFPClient is a more or less "correct" implementation of an HFP client. It is forked from codeaurora and
modified to implement an incoming call notification, and to be buildable by the SDK rather than only as
part of a full AOSP tree. However, it is doing an ugly job of duplicating functionality that is included
as part of AOSP 8.0.
MCURadio is a complete cludge that is communicating with the MCUController to send commands to the AMFM
radio hardware.
Most of the functions of these programs should be handled by Android HALs.
In particular, the audio HAL, radio HAL, power HAL, and car HAL.
But the problem is that the different interfaces we have available to us need to both tie in to multiple
HALs, AND each handle multiple HALs.
And therefore we require a way to combine and divide the resources such that they are distributed
properly to the different HALs.
That is what MCUd is.
MCUd will implement several threads for reading data from several different HALs, and several different
interfaces to the car radio. As well the main thread will be responsible for heartbeat and maintenance.
When MCUd receives a message from any hardware or HAL, it will determine the appropriate destination
for that message and pass it along.