Friday, March 31, 2017

Adding Aux/BT to Subaru Stereo through CD changer

Fri 31 Mar 2017 02:28:03 PM MST

This is a log of my attempt to add auxiliary input to the Subaru P120 car stereo (i.e., receiver, head unit).  This device, manufactured by Panasonic, uses a variant of the Alpine MBus protocol.  The protocol in this radio is slightly different (how different I don't know yet, but the timing is different) than the solutions found by Olstyle and kjanesch (which this project will borrow heavily from).

From the pseudochanger readme...
"Alpine MBus is a bidirectional one-wire serial interface used for communication between audio head units and peripherals like CD players, CD changers, and tape decks. A period for each bit is 3 ms, and low/high bits are indicated by how long the line is held low. Low for the first 600us indicates a 1, low for 1800 us indicates a 0. Data is a multiple of four bits, and a four-bit check follows the packet, an XOR of all the other 4-bit chunks.

The Panasonic variant uses different ping and ACK codes, sends some data at different times, and does what looks like type detection by sending out a cycle of codes. The included library reflects these differences.

This project was developed specifically for the 2002 Subaru WRX head unit, model CQ-EF7260A, and should work with other Panasonic head units that have the same 16-pin connector on the back, as also found in some Mazdas and Hondas.
My P120 receiver (also 2002) is a AM/FM/WB with cassette.  It has the 16-pin connector.  It is confusing why it doesn't work with the original pseudochanger code by kevinsjanesch.  The zero and one bit timings are not 600us/1800us but on the order of 250us/325us, which is bizarre.  This timing leaves little room for error in distinguishing the bits.  Perhaps my unit is bad, but that's what I get on my logic analyzer.

Credits / References

http://www.hohensohn.info/mbus/
https://github.com/kjanesch/pseudochanger
https://sites.google.com/site/kevinsjanesch/projects/subaru-line-in
https://github.com/Olstyle/MBus

Saturday, March 4, 2017

How I Got the Adware/Malware ROM 7.8.21.8(MALCNDE) off of my Redmi 3s Using Archlinux

My Redmi 3s came from some unscrupulous vendor on Aliexpress with the MIUI 7 rom 7.8.21.8(MALCNDE).  This rom has adware, and crap that prohibits you from updating the rom.  It might have spyware for all I know.

I downloaded the appropriate fastboot rom for my phone from here..
http://en.miui.com/a-234.html

It happened to be:
land_global_images_V8.1.1.0.MALMIDI_20161108.0000.00_6.0_global_cd3d94ba1e.tgz

sudo pacman -S android-tools
tar -zxvf the_rom_you_downloaded.tgz

Connect phone to computer.  Hold the power button and volume-down button until the phone reboots.  It should boot into fastboot.

sudo sh flash_all.sh

Ta-da!