BlogPart 2 · the car
Teaching a 2011 Audi to show album art, in the car
Part two: taking the patch from the desktop to the real MMI 3G High. A 32 KB limit hiding in the media engine, a head unit stuck on its splash screen, two bugs no desktop could show, and album art on the dashboard.
Part one ended with Audi’s HMI running on my desk, showing album art and Japanese titles, and three questions only the car could answer: whether J9 on the unit would load a patch over its built-in classes, whether the track ID the HMI sees is the one the media engine expects, and whether the unit’s font engine would take my Japanese font.
Two of those now have answers, and the album art works. Getting there took four installs and one rescue, and almost nothing failed where I expected it to. One of the fixes needed no patch at all, and if you own an MMI 3G, it very likely applies to your music too.

A way in
The MMI has no network shell and no debug port I wanted to open. It does have a script launcher. When a card goes in, a small native process looks for a file named copie_scr.sh on it and runs it as root. Decompiling that launcher answered the details the forums disagree on:
- The script has to be XOR-encoded with a fixed seed, or it gets “decoded” into garbage.
- It is decoded into flash and run with the card’s mount path as its only argument. Anything inserted in the first eleven seconds after the launcher starts is ignored.
- The card is mounted read-only. A script that wants to write its results back has to remount it first.
That is the whole interface: write a script, encode it, walk to the car, insert the card, wait, walk back, read the card. Every experiment in this post went through that loop, and each probe wrote everything it learned onto the card, because the car has nowhere else to put it.
The shell at the other end is PD KSH from 1999, with no sed, awk, head or tail, and, as I found out later, no sync and no rmdir.
The media engine says no
Part one rested on one assumption: the media engine can hand out a cover for a track. It has a call for exactly that, and a command-line client, mmecli, that exposes it as getphoto <id>. The first probe asked it for the cover of the track that was playing.
Bad value from the MME.
It failed for every track I tried. Fetching the cover is the engine’s job, so the next step was the engine itself. I opened mme-becker in Ghidra and followed getphoto down. It looks up the file, asks the MP3 parser for an AlbumArt value, and if that comes back empty, looks for an album.jpg next to the file. The fallback never fires on this unit: every photo file type is commented out in the engine’s configuration, so it never indexes a JPEG at all.
The MP3 parser was the interesting part:
// mme-becker, MP3 parser (decompiled): the ID3 tag is skipped if it is too big
if (32768 < tagSize + 10) {
// seek past the whole tag; only an old ID3v1 tag at the end of the file is read
}
Any ID3 tag larger than 32 KB is not parsed at all. No cover, and also no title and no artist. The cover picture is almost all of a tag, so a file with a 40 KB cover loses everything, and 13 of my 33 files were over the limit.
That also explained something I had not connected: on the car, only some tracks ever showed a title. Every one that did had a tag under 32 KB.
The fix needed no firmware at all. I re-encoded those 13 covers at the same 320×320 until each whole tag fit in 30 KB, leaving every other byte of every file untouched. The next probe got a cover back for all 33 tracks, each one byte-for-byte the picture in the MP3 plus a single trailing zero.
If you own an MMI 3G: keep the whole ID3 tag under 32 KB, cover included. It decides whether the unit reads your titles at all, patch or no patch. “Covers up to 256 KB” is a figure that floats around; on this firmware it is wrong.
This is also a correction to part one, which said the engine stores a reference to each cover. It does not: there is no artwork table in its database. It parses the file again every time it is asked.
Probing is its own adventure
Each probe cost a walk to the car, so each of these cost at least one:
- The
|character. One probe read every track ID from the database, and on the car it read none. PD KSH does not handle|inside a${var#pattern}trim, so the line came back unchanged. It worked perfectly in bash on my desk. - IDs that move. Hard-coding the track IDs from the previous run failed too, because the unit re-indexes a card whenever it is reinserted, and every ID changes.
- The lock switch. One run wrote nothing at all. The SD adapter’s write-protect switch had been nudged.
- Where the covers go.
getphotoignores the current directory and writes each cover to/tmpunder a random name. Every probe that looked for covers next to itself found an empty folder, while/tmpslowly filled up. - A crash with a fixed address. The shell segfaulted near the end of longer scripts, at the same instruction address every time.
After that, every script that runs on the unit is short and straight-line: no shell functions, almost no command substitution, and output that never depends on reaching the end.
Installing without bricking it
The patch itself is two files: a JAR in flash, and five lines added to lsd.sh, the script that starts J9. Most of the work went into making sure that changing those two files could not leave the car half-patched.
- Checks before anything is written. The install script checksums every file on the card and the current
lsd.sh. Iflsd.shis anything other than stock or one of my own versions, it stops without touching the unit. - A dry run first. With a
DRYRUNfile on the card, it runs every check, logs what it would do and writes nothing to the unit. Every install was dry-run in the car first. - One rename at the end. Each file is copied under a temporary name, verified, then renamed into place.
lsd.shis switched last, by a single rename, after everything else has been checked. - A rescue card. It restores the stock
lsd.shfrom a copy on the card itself, so it works even if the backup on the unit is damaged. The script launcher runs without the HMI, so the rescue works even with a dead screen. - No recursive deletes. I cannot see the whole filesystem of the car, so scripts that run there only ever delete files by full name. Never a wildcard, never a directory.
Both scripts are tested on the desktop against a fake copy of the unit’s filesystem. One test cuts each script off after every single line, simulating a crash at each point, and checks the unit is always either fully stock or fully installed. All 413 checks pass, and the first time the scripts ran in the car, they did what the log said they would.
Attempt one: a splash screen
The first real install reported success. I rebooted the MMI, and it stayed on the Audi splash screen. The music came back on its own, so the system underneath was alive, but the screen never moved.

Not my photo, but my view for several minutes. A nice screen, as screens to stare at go.
The rescue card was built for exactly this, and I made it do one more thing first: after restoring lsd.sh, it saves the system log, the state of every J9 thread and Harman’s error dumps onto the card, because a reboot would erase all of it. Then I rebooted, and the car was stock again.
The diagnostics answered question one from part one: yes, J9 loads a patch JAR over classes from its built-in image. The log shows the framework starting completely and announcing that its first screen was displayed. But nothing was drawn, and minutes later every thread in J9 was waiting on something that never came.
My cover-art code had not run once; its log file did not even exist. The only part of the patch active from the very first frame was the Japanese font: the native font engine was pointed at a folder holding a 2.6 MB font, and my hooks sat on every piece of text the HMI set. So I split the patch, set the font aside, and built a version with album art only.
Attempt two: no covers, no errors
Version two booted normally. It also showed no covers, logged one line saying it had installed, and then said nothing else, through several track changes.
The HMI talks to the media engine through Harman’s JDSI library, and decompiling it showed that it keeps two separate lists of listeners. Ongoing updates such as “this track is playing at this position” go to listeners that subscribed to them. Answers to questions, such as “here are the details for track 194”, go only to listeners registered as services in the HMI’s OSGi framework. My listener had subscribed but was never registered, so it heard every track change and never heard a single answer.
My desktop stand-in for the media engine had treated the two the same, so the harness could never have shown this. The fix copies what Audi’s own media application does:
// register like Audi's media app: responses only reach listeners registered as services
Hashtable props = new Hashtable();
props.put("DEVICE_NAME", "org.dsi.ifc.media.DSIMediaListener");
props.put("DEVICE_INSTANCE", new Integer(0));
bundleContext.registerService("org.dsi.ifc.base.DSIListener", listener, props);
The stand-in now keeps both lists the way JDSI does, so the harness fails the same way the car did.
Attempt three: almost
Version three’s log showed every step arriving: the track change, the detail request, the answer. It also answered question two from part one: the ID the HMI uses for a track is exactly the engine’s ID for the file. Track 194 in the HMI was file 194 in the engine’s library.
Then the cover lookup refused every track. Before trusting an ID, the patch checks that the engine’s library row for it has the file name the HMI reported. A wrong ID should never fetch another track’s cover, and IDs change every time the card is re-indexed. On the car, the HMI reports the name without its extension, Altai Kai - Jerim for Altai Kai - Jerim.mp3. My check compared the two exactly. Every track failed it, so the patch never even asked the engine for a cover.
The check now also accepts the library’s name being the HMI’s plus a short extension. The stand-in now drops extensions too.
Attempt four
Every track change, end to end. The highlighted steps are the patch; the rest is Harman’s own code.
Version four went in like the others: dry run, real install, rescue card in the glovebox, reboot. I opened the SD player, picked a track, and after a second the cover appeared on the right and the transport ring slid over to make room.

The install log is still open on the laptop. It was not closed for a while.
Skipping tracks works the way it did on my desk: the old cover disappears at once, the ring holds still while the next lookup runs, and the new cover drops in. Nothing else on the unit changed. The instrument cluster still shows the track name exactly as before, because it gets its text through a separate path the patch never touches.
What is left
The Japanese titles are still empty boxes on the MMI, and blanks in the instrument cluster. Question three from part one, whether the font engine takes the Noto file, is still open, and attempt one suggests the honest answer is “not like that”. The font comes back as its own install: cut down to only the characters my library uses, in a folder by itself, with every step logged, and kept apart from the album art so it cannot take the covers down with it.
That is part three.
Credits
On top of everything credited in part one:
- Ghidra for taking the media engine and the script launcher apart, including the 32 KB check.
- MMI3G-Toolkit by dspl1236, whose script encoder matched the launcher’s cipher exactly.
- Pillow for re-encoding the oversized covers.
- Keldo Gliana’s recovery guide, which stayed in the glovebox, unused.