[Android Apps and Games] mikereidis:
Thread is under construction. :)

WARNING: There have been 3 reports so far of failure to boot after installing the Shim HAL. This sort of problem should be assumed possible at this early "Alpha level research project" phase.

Please don't install if you have stock recovery or don't know what recovery is.

Please don't install if you are nervous. Wait a while for the bugs to get worked out and info compiled.

Don't install if not confident in your technical skills.

Don't install if you might freak out if your phone gets disabled for a little while.

For bootloops or to fix or remove: http://xdaforums.com/showpost.php?p=52931431&postcount=67

Post #2 has download links and instructions: http://xdaforums.com/showpost.php?p=52765309&postcount=2

Since interest has ramped up quickly, I've published a 99 cent "donate" version on Play: https://play.google.com/store/apps/details?id=fm.a2d.av (Wait until the $200 placeholder price disappears, LOL.)

I'm not sure "donate" is the right word, but it's the exact same app I'm distributing and will continue to distribute for free (for at least X months to a year ??), so nobody is under any obligation to buy to get the app. Updates will be automatic via Play though.

============================================================

AudioTricks / VolumeTricks is a new kind of "audio mod" that is HAL Shim based.

At present, it can raise or lower output volume and microphone input gains digitally.

Only works on ICS Android 4.0.3 and later. AOSP ROMs such as CM11 or other KitKat very much preferred. Many stock ROMs 4.1-4.3, won't work, especially HTC.

Post 2 has download link and instructions.

Disclaimer: Please understand that this is the first public release of this app. Although I endeavour to make my apps as safe as possible, one never knows whether or not some silly bug or unusual interaction might pop a speaker, headset or whatever. I have over 20 devices that I use for testing my apps and I try to "torture test" as much as possible. So if something goes pop, I'll be very sorry and do everything I can to analyze and fix any problems. If you're "not sure", just wait and more adventurous people will do the early testing needed to help ensure nothing breaks.

By it's very nature, any app that can boost volume creates risk for audio output devices as well as your ears.

For those who know my Spirit FM apps, this is a bit of a move for me. Spirit1 and Spirit2 both are alive and well, but the future of FM radio on Android seems to be dimming the last few years. I'll be splitting my time between apps based on the support I get.

Making this HAL Shim based provides some advantages and disadvantages over other methods of changing volume or gain.

Advantages include:

- Audio modification even for apps, games, etc. that use the low level Android NDK OpenSL ES API.

Disadvantages:

- Analog controls, if available, may be better.

AudioTricks is intended to be my name for a group of small apps, and/or a "master app" that includes the features of them all.

VolumeTricks is the first such small app to be released, and is focused on output volumes and input gains.

VolumeTricks may not be limited to the "HAL Shim" approach to audio mods. It may also include ALSA, ALSA UCM, and other methods to manipulate audio.

At this time, the app is free, but Copyright Me. I'll likely maintain a free version for some time, but I gotta eat too so there will be a paid version on Play when it seems ready.

At this time, this app has been tested mostly on CM11 and a few other AOSP ROMs. Many stock ROMs won't work, especially HTC.

The app is currently set to only work on Android KitKat 4.03+.

I haven't tested ART much yet, mostly Dalvik, but it's working OK on my One M7 w/ ART. Shouldn't be too hard to fix any ART issues.

So what the heck is a "HAL Shim" ??

Android uses HALs (Hardware Adaptation Libraries) as an API between Google's Android code and the phone OEMs hardware specific code. Android Audio has at least 2 HALs, one for "Policy" (selects outputs, inputs and some other stuff) and one for the audio transfers. The HAL Shim in this app works with the latter "Primary" HAL for audio transfers.

A SHIM is a component that sits between 2 other components and pretends to be the higher component as well as the lower component. Hierarchy:

Android AudioFlinger

------------------------

HAL Shim

------------------------

Primary Audio HAL

So, the HAL shim pretends to be an audio HAL to Android's AudioFlinger. AND it pretends to be Android AudioFlinger to the Primary Audio HAL.

The HAL shim acts as an intermediary. It can pass everything back and forth unmodified which makes it invisible. Or it can modify anything passing between, including the audio data.

Isn't there a better way to do this ? No, I don't think so. I don't want to be modifying a bunch of HALs on thousands of ROMs. I also don't want to be modifying AudioFlinger on those same hordes of ROMs.

What else can be done with the HAL Shim concept, besides "Volume Tricks".

I think some of these may be feasible:

- Recording all inputs and/or outputs. Maybe even both sides of phone calls.

- Analyze, Visualize, Equalize, Effects-ize all or many inputs and outputs.

- Bypass DRM. :)

- Maybe a method to modify (eg. encrypt / decrypt) phone call audio, inbound and outbound; possibly via pretending to be a BT headset....

Note that, at present, the HAL shim only works with the "Primary Audio Interface". Small-ish mods could do the same for HDMI, A2DP / BT, USB Audio, "Remote Submix" and whatever new audio devices Google defines.