[Motorola Droid RAZR] djuniah:
NOTE: A lot of this info is duplicated from a post i had made on droidrzr a while ago. I'm adding it here because i'm actively looking into getting this working once again and I would love any input/thoughts that other devs have on this topic.

Ok, so i've been poking around trying to get HDMI support working in non moto-based ROMs (basically anything that would be using kexec or an AOSP base like CM). It's not complete but i figure it's better to have more eyes on this than just mine. Apologies ahead of time if this post turns into a big info-dump, but here's what i have so far. Also, this is HDMI only, not webtop related.

Initial research:

My previous phone was a Droid X and there were similar issues relating to HDMI on non-stock roms. So my first inclination was to look into how that was fixed.

Here's the post in question: http://rootzwiki.com...m-audio-solved/

Basically, there are some required framework files that are needed for detecting an HDMI cable, notifying the system that it exists and enabling the output. There were also some permissions files and an APK that needed to be copied as well. The big issue with this is that the APK needed to be signed with a signature that matched the one that the ROM was built with (and since a lot of devs use the default android test/build keys, this wasn't all that difficult).

Now, keep in mind that the HDMI on the droid X wasn't mirror mode and operated VERY differently. However, it gave me a good place to start looking on the razr.

Some digging:

First, after looking through system/app i found this apk: ExtDispService.apk. As with the DX, this file is definitely going to be needed. This was where i started digging. I re-signed it and added it to the CM install zip, and put it on my phone. Now, of course it immediately crashed, but at least i had some logs to help me determine why.

Tools:

As a small note, I was using Virtuous Ten Studio to do a lot of this editing. I can't stress enough how awesome this program is for things like this. I had been doing it all manually at the start and making ONE change to that APK would take me close to 15 minutes. With VTS, i could do it in 5 or less. So from here on out, if you're following along, be sure to have the APK and JAR files mentioned added to a project in VTS and de-compiled so that you can see the smali code.

The roadblocks:

So once i had the logs, i was able to see where the APK was crashing. I knew that I would need to include some items from the framework, but i just wasn't sure what yet.

The first hiccup was in ExtDispService$HandleInitAutoDetectSetting.

const-string v3, "hdmi_autodetection"
invoke-static {v1, v3}, Lcom/motorola/android/provider/MotorolaSettings;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;)I

So, from looking at this, you can see that it's trying to access a Moto utility that allows programs access to information from the settings menu. In this particular instance, it's the on/off switch for HDMI autodetect. This opened up a whole new can of worms. How would we add these items back to the settings menu? How would we fake the overscan setting?

My first inclination was to look for the MotorolaSettings class and include that into the package. However, this could potentially lead us down a very dark path of dependency hell. Worst case scenario: we have to include a lot of moto's framework to get this working (and isn't the whole point of this to get away from moto's code?!). I attempted to remove the references to the settings menu in the smali code and replace them with hardcoded values. This was EXTREMELY hackey but it was more of a proof of concept at this point anyway. I was able to get the phone to boot and not have ExtDispService crash on me, however there was also no response when I plugged in the HDMI cable (nothing at all in the logs).

List of files needed:

Here are a list of some files that i know are required to get this working:

system/app/ExtDispService.apk

system/framework/framework-ext.jar

system/lib/libextdispjni.so

system/lib/libhdmi.so

system/lib/libhdcp.so

Some final thoughts:

I realize that there isn't too much concrete info here, but I wanted to share what progress I had made so that maybe someone else could either pick up from where i've left off, or make some suggestions on how to proceed.

EDIT: I wasn't sure if this belonged in the Android Development sub-forum or not, but i put it here just to be safe. If a mod sees this and think's thats a better place, please feel free to move it.