yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] mikereidis:
Hi, Sorry about that. The instructions I put in post #2 should have restored original HAL and removed restore script, but I messed up with the remounts. This works to restore, as long as you note the manual step to determine HAL file name:

adb shell
su
mount -o remount,rw /system ll /system/lib/hw/audio.primary.*.so
# !!!! Note the name of the HAL, like audio.primary.msm8960.so and use this name in next line. (If only audio.primary.default.so exists, use that.)

mv /system/lib/hw/audio.primary.orig.so /system/lib/hw/audio.primary.msm8960.so
rm /system/addon.d/99-audiotricks.sh
mount -o remount,ro /system
reboot

Yes, the single button shows Install, Remove, or Update depending on what it detects. If the detection is wrong, that's a problem. I'm running a version now (next post) that ALWAYS puts Remove on the 2nd tab for input.

Detection was messed up because the HAL wasn't working right.

For your stock based ROM, the approach of my Shim HAL won't work. It could work if I added Legacy support, but I'm not sure if or when I'll do that.

This is still a "research project" and here's what I've learned (believe it or not, LOL...):

- Android GB 2.3.x and earlier do not support the "New" HALs. They use what's called "Legacy" HALs. The underlying functions are more or less the same, but the API is different.

- Android ICS 4.x and later CAN support the "New" HALs, like the Shim HAL in this app.

But OEMs still have a choice to stick with the Legacy HALs, though Google is TRYING to encourage OEMs to update.

Some OEMs are better than others at supporting New HALs and removing Legacy stuff. Specifically, it looks to me like HTC have been slower to update than Samsung.

AFAICT, most CM11 ROMs are New HALs only. But I see an Android 4.1 unofficial CM10 for One V that is stuck on Legacy, and same for my stock Android 4.1 Xperia P.

Even some AOSP-ish ROMs sometimes use the OEM HAL as a "binary blob" with no source code, and some of these are stuck on Legacy.
[Android Apps and Games] Rinoceros:
Hi Mike,

Yes, I am still running the stock kernel. My battery lasts for over three days with average use of the phone. So, no need to flash another kernel.

I will keep a close eye on this project but don't feel any pressure to alter your code just for me.

Thank you very much!
[Android Apps and Games] mikereidis:
v.1.0.3 : http://d-h.st/UTP

- Adds a permanent "Remove" button on right page / 2nd tab.

- API Level 15 = Android 4.0.3 and up enforcement at installation.

May not work on stock ROMs, especially older Android versions and HTC stock ROMs.
[Android Apps and Games] _breez_:
Just installed the apk on a samsung galaxy note (gt-n7000) with slimkat (4.4.2) but it doesn't seem to work on the input part. The volume left/right indicators stay gray even if it's enabled.

I did a full reboot and the app is having root access
[Android Apps and Games] droopyar:
nice

i will be testing it.

But it is possible to uninstall it without any alteration on the firmware?

According to your post is a little dangerous to remove it. We need to use a script?

Please make it easy to completely uninstall it?
[Android Apps and Games] mikereidis:
224 downloads of v1.0.3 in 48 hours.

I'm a bit surprised to see that many. :)

I think the next improvement needs to be detection of devices on which it won't work.

Instead of having to install, test, and remove, it will be better to just show a message that an old Legacy HAL is in use and it won't work.
[Android Apps and Games] mikereidis:
Did you have an app running that was recording, or otherwise using audio input like Google Now voice input ?

This module depends on an app to do the input, it just modifies it's amplitude.

On CM11 at least, there is a simple Sound Recorder app. But it stops running when you leave it's UI, so you can never see the audio level. But if I enable input in this app, and change the value (blindly in this case), the effect is seen the next time I run the Sound Recorder app.

Besides this, the only thing I know that will stop it working on input is Android setting a "Fast" Flag, but I don't think this is too common on inputs.

I will be improving the UI to show info and statistics, and that will improve trouble-shooting.
[Android Apps and Games] mikereidis:
The latest v1.0.3 should make it easy to remove the HAL shim.

Swipe from right to left, or select the Input tab, and press the Remove button.

When Android restarts, you can start the app to confirm it asks you to Install, and that should confirm that it's removed.

If the Shim HAL is installed, you should also see messages in the logcat using the tag "atshim" at startup time and when audio is started, paused, etc.
[Android Apps and Games] Traace:
Audio starts crackling here after go over 0. Even if i just do a little.

Try'd clean and with Viper4Audio.

Galaxy S Blaze 4G | 4.4.2 - ART

Snapdragon S3 MSM8260

Edit: I read now some of the thread, seems like my Phone is already maxed out.

Sadly i can't get higher vol.

Keep dev up!
[Android Apps and Games] _breez_:
No I do not have any app running in the background which uses the mic.

I noticed however that the DSP manager in my rom isn't working properly either (equalizer and bass boost not working even when enabled). Could these problems be related?

I will try flashing the latest version of SlimKat in the upcoming days and I'll give you an update on the problem.

*edit* I've re-read your comment and it makes sense now. So there needs to be an app running which uses the microphone in order to see the idicators moving? Never mind it's working perfectly :) (Tested with tapemachine recorder in the background)

This is great for preventing clipping!
[Android Apps and Games] Zeljko1234:
Finally someone started to work on audio recording! I will try asap. If works would be much better than manually edit file and try to guess optimal microphone sensitivity/level. Or without it got this :D
[Android Apps and Games] nadimac:
Volume tricks

dont work for LG G2 intall but dont let me chouse option

coarse dont move -10 -5 0 5 10

fine dont move -1 -05 0 05 1
[Android Apps and Games] Zeljko1234:
Works but could you make indicators to show signal after amplification, not before? For example, before (during probe) or when concert starts, we can correct levels according indicator. Now I need to guess which level will be correct during recording.

As temporary workaround Sound Meter could be used but I need to change level, switch to the meter app, back to your app and so on several times. Before and after level correction (for me only after is enough) indicator will be awesome. And will definitely buy you app.

Thank for app and what you've done already. If I can help you somehow, just let me know.
[Android Apps and Games] peauproductions:
I've tested this app on Android 4.2.2 and it works well (or at least I think it does). I am using a voice app (utter) that responds to my voice commands that are preset ahead of time. I am getting noticeably more false reads where it doesn't understand my commands with this app enabled (understandable if it's receiving more ambient noises that's confusing it).

My questions is: what settings would you recommend setting (I'm guessing only on the input tab) to simply boost the volume of my voice (so I can bark commands from further away) without introducing false ambient noises?

Single word commands work great, it's the multi-word ones that are not working well. I know this may have more to do with the particular microphone I'm using (I have a bunch to try) but wanted to ask what you'd suggest to improve results if at all possible. Thanks!
[Android Apps and Games] jaw2floor:
If you get this to work on Sense 5 I will give you a kidney

In Sense 5 base on HOX, there's a bug which causes all 3rd party apps to have very low, nearly silent microphone volume. Will try his out soon anyway
[Android Apps and Games] mikereidis:
Email me your address and I'll send a DIY kidney removal kit w/ refrigerated return mailer. ;)

Here's the latest version av-140524.apk: http://d-h.st/W4e

I think it should now work on most ICS 4.0.3 and up, including the stock devices I thought were Legacy only. Turns out I just needed to tell audioflinger the HAL is same version as the real HAL. :)
[Android Apps and Games] mikereidis:
There's almost always SOME way to increase volume.

At some point I will add some ALSA controls which should usually be able to increase analog volume after DACs or later.

Currently, only digital volume can be changed, and if it's maxed to 32k or so, then it's maxed.

A lot of digital audio only goes to 20-24k or so, so a small increase in the fine volume might give a bit more.
[Android Apps and Games] mikereidis:
Great ! :)

I'll eventually add some functions that can record or monitor inputs, or generate test tones for outputs etc.
[Android Apps and Games] mikereidis:
At this time I think it's best to wait until we've had more experience, some bugs are fixed, and some features are added.

If there is AGC Automatic gain control for mic input working well on your device, that may be superior to anything this app/HAL shim can do, for now anyway.

It's inevitable that volume/gain adjustment in the digital domain adds at least a little bit of distortion, and the current code is not optimal. Eg it just truncates numbers like 999.9 to 999 instead of rounding up to 1000, which would be better.
[Android Apps and Games] mikereidis:
Try the latest version av-140524.apk: http://d-h.st/W4e
[Android Apps and Games] mikereidis:
:)

Yes, these are among the intended features.

Also, being able to control left and right channels separately (can do that now via adb shell, but not the UI yet)....

I'm happy to hear about desired features. The more often I hear a specific request, the farther up it goes in priority.
[Android Apps and Games] Zeljko1234:
Thank you! (But don't expect my kidney :D)

I have another idea, could you add numerical indicator of changed levels? Sometimes is hard to precisely see or adjust levels.
[Android Apps and Games] mikereidis:
I'd say Yes, but I dunno, if you're backing out of the kidney deal... ;)
[Android Apps and Games] mikereidis:
Just noticed an XDA portal article: http://www.xda-developers.com/android/manipulate-the-volume-level-of-your-device-with-audiotricks/ :)

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.

As with my Spirit FM apps, the Google Play sales statistics will be used to determine which devices I should buy for testing & support, and will of course provide the funds to buy them.

I want to be clear that with a 99 cent app, I can't provide the level of individual email support I've provided for the Spirit FM apps, and I don't want to waste time on refunds. Test it free first.

(Anyway Google now apparently allows you to get a refund at any time, even months after the 15 minute window expired.)

Support will be primarily here on this XDA thread and I'll ask you to email me if it makes sense.

I also want to be clear that this 99 cent app will be pretty much focused on audio output volumes and input gains. The ALSA stuff I've mentioned, and more, will be added when I can.

I also expect to put out a few more 99 center's; maybe one focused on equalization and visualization, and another one for recording inputs and outputs.

And I expect/hope to create a premium master AudioTricks app that will combine the functionality of all the little 99 cent apps.

I hope all of the above doesn't sound too commercial. I'm currently only making a small fraction of what is made by several of the best known devs in the rooting/moding/ROMing community. I hope to at least rise to roughly what I've made working for private tech companies over the decades, and to continue to communicate well with the users/supporters.

Thanks ! :)
[Android Apps and Games] Gixermouse:
HELP!

My One X+ won't get past "Starting apps" after installing this. I ran the app and it said it would need to install something else and then 'warm reboot' but this reboot doesn't look very warm from where I'm standing!

Any chance of telling me where to go in TWRP to undo what has been done? :)
[Android Apps and Games] OldYellowBricks:
Hello. It works on my 2011 SK17i Running CM10.1 (JB 4.2.2). From what I've read, you can increase volume up to the point where headphones/speaker starts to distort I guess? and its what happened to my phone and that is normal right? The volume goes up to a level where the headphones can't stand the loudness am I right? If so, I can confirm its working on SK17i running CM10.1 JB 4.2.2

Hope this helps :)

So when the sounds distorts, does it mean that its reached beyond its capabilities (the headphones/speaker?) If I bought better headphones, would the crackling/distortion disappear?
[Android Apps and Games] themadproducer:
Some headphones have higher impedance or resistance, not to mention varying sound quality. This plays a role. Also, no matter the digital boost level, if the amp of your device can't drive the headphones, then you will get distortion as well. That's why there is a trend for audiophiles to buy external DAC converters and boutique micro amps to drive better sounding high impedance headphones.... Etc.
[Android Apps and Games] mikereidis:
Sorry about that... :

If you can get the app started, this is the normal advice:

But if you can't start apps, this won't help.

If you had a connected PC with ADB shell this is my advice from post #2: (Note the manual step of using the specific file name on your device)

adb shell su mount -o remount,rw /system ll /system/lib/hw/audio.primary.*.so # !!!! Note the name of the HAL, like audio.primary.msm8960.so and use this name in next line. (If only audio.primary.default.so exists, use that.) mv /system/lib/hw/audio.primary.orig.so /system/lib/hw/audio.primary.msm8960.so rm /system/addon.d/99-audiotricks.sh mount -o remount,ro /system reboot

But this is a lot of typing from the shell in TWRP.

I think the easiest way in TWRP is to flash the ROM again, or an update. No wipe is needed. But first you may need to run "rm /system/addon.d/99-audiotricks.sh" or otherwise delete that file.

I think the 2nd easiest way in TWRP is:

Mount -> System, then hit Back

Advanced-> Terminal Command -> system -> lib -> hw -> SELECT

then:

ls -> Go

Do you see a file named audio.primary.default.so ? If yes then good, it's sort of a backup HAL that lets Android boot.

Now look for a file named something like audio.primary.MYDEVICE.so .

Now, if there is a file named audio.primary.orig.so then run this, replacing MYDEVICE with your phone specific value:

mv audio.primary.orig.so audio.primary.MYDEVICE.so

Reboot and it should be back to normal. Run Remove from the app if you haven't to delete the backup script.

An alternative that's quicker to type is:

rm audio.primary.MYDEVICE.so

Phone should boot after this, if you have that audio.primary.default.so file, but audio won't work. Remove from the app will hopefully work in this state.
[Android Apps and Games] mikereidis:
OK, sounds good. :)

Try my new version 140525: http://d-h.st/rJi

It has a better gain maximizer that knocks gain down as needed, until you reset it in the UI.
[Android Apps and Games] mikereidis:
New version 140525: http://d-h.st/rJi

Also on Play as a 99 center: https://play.google.com/store/apps/details?id=fm.a2d.av (Forgot to enable all countries earlier, thanks for your support... :) )

Press Update/OK for new features if already installed, otherwise Install/OK.

The enhancements:

- Automatic gain reduction is now sticky, so reduces distortion when maxed. Touch sliders to reset.

- Numbers for VU.

- After amplification VU display.

- Sliders calibrated in dB.
[Android Apps and Games] mikereidis:
Yeah, I think I need to get a half decent $200 range USB DAC/ADC for testing things.

Do you think this might suffice ? : "Firestone Audio Fubar I-o USB DAC / ADC" : http://www.amazon.com/Firestone-Audio-Fubar-USB-Silver/dp/B005WKN94W

My personal needs have never ventured into "audiophile". $100-200 speakers work fine enough for me.
[Android Apps and Games] Naf3ts:
Donation

Is it possible to donate without doing it on the Playstore?
[Android Apps and Games] Zeljko1234:
Fantastic! You've listened users and you added after amplification VU display!

Could you somehow start microphone, dummy recording, whatever to be able adjust levels without starting another recording app in the background? And to switch in and out? I preffere to have in first as option.

P.S.

As always, glad to support developers. Applications purchased.
[Android Apps and Games] themadproducer:
[MENTION=3575078]mikereidis[/MENTION]

I just love the look of these new age bootique dac/adc units.

Almost every model have I looked at has compelling visual style.

When I was researching this topic a good 4-6months ago, already, there were so many of them available, it was a bit overwhelming. I didn't get one, since at the moment, I don't have a set of worthy headphones to match.

Taking a quick look at the Fubar, I noticed it has input/rec as well. (hence ADC...which incidentally, are my name initials) This unit would probably be a superb compliment to the app Audio Evolution.

IMO, the worth of units like the Fubar, would also be noticed, if the Source device (eg SGS3) has a crappy dac or sound chip....or whatever it's called. On my S3 (North American version) I am almost positive they put in a crappy or faulty chip. Under certain scenarios, I can hear CPU noises leaking into the sound output....especially in a car if shielding or grounding is not perfect. I am comparing this to my old HTC HD2 which never exhibited those issue even with the same cabling.
[Android Apps and Games] mikereidis:
Thanks for your interest. :)

Sure. Anyone can paypal me at my email mikereidis@gmail.com .

But wouldn't it be easier to get automatic Play updates ? I don't expect to build any alternative update mechanism, or email updates, so the only alternative would be downloading each update manually.

Google now supports Paypal in some countries for Play purchases, and other places have gift cards.
[Android Apps and Games] mikereidis:
Of course. :)

I read a good writeup a few years ago that said not to bother creating issues/bug/feature request lists. As time goes by they just get longer and take valuable time to maintain. I've seen that myself many times.

The advice was to listen to the customers (and keep rough counts in your head). In aggregate, they will let you know what to prioritize. IE, 10 requests for A and only 1 request for B, you do A.

Yes, I'm thinking about this.

My thoughts had been that I would create a separate "Recording Tricks" app to record any input or output (from other apps). I could integrate loosely by having a UI button that would launch that other app.

But I don't want to re-invent the wheel too much. There are plenty of general "Record from Mic apps" out there, and I'm happy to refer people to them, instead of spending valuable time doing the same. (That said, I want to be able to allow tests of the APIs that those apps use, but I'd keep it simple, and we'll see how that goes.)

Note that the processed audio values at the HAL level are not necessarily the same a recording app would see. A normal Android Java API high level recording app might see audio data AFTER it's been processed by software that does AGC, noise reduction, multi-mic noise cancellation, etc. So tuning the mic at the HAL level may not be a complete solution.

My expectation is to eventually have more tabs, 2 for each audio device that has both output and input. Right now most have 3 or 4 "audio devices": primary, A2DP BT, USB DAC/ADC, lately "Remote Submix", and I'm sure Google will define more as time goes by.

I thought that I could have UI enables for each tab, so you wouldn't have to flip through tabs you don't care about. I hadn't thought too much about order, but if a user can create a new list of tabs, order could be accommodated.

Since Google will surely be adding more devices, and since the Audio HAL API is standard across all of them, I should be able to create a mechanism by which the user can define new tabs; the main or only difference should be the HAL filenames.
[Android Apps and Games] mikereidis:
Thanks.

Yeah for me it would be just for testing. I understand audiophiles would never buy a device that had ADCs as well as DACs.

The LTE GS3s have Qualcomm audio hubs/chips, which tend to be considered "competent" or "reasonably good/not too bad" by people who really care about audio quality. But circuitry after the chip, and the speakers, etc. can make a big difference.

I have the International GSM GS3: GT-I9300 and it has one of those wonderful Wolfson chips. I've looked deeply into many of the 260+ ALSA controls it has, and studied the internal block diagrams. It's funny that the GS3 chip seems almost identical to the GS1 chip, despite the 2 generations of difference. But the GS1 chip was very good and ahead of it's time.

OTOH, the hilariously anonymous/unidentified audio chip on GS2 GT-I9100 and Note GT-N7000 is horrible, even to my tin ears. Reminds me of the late 1970's Mustangs which weren't much more than Pintos. (Regrettably, I had both, LOL.)
[Android Apps and Games] mikereidis:
Please let me know if my advice helped, or if you're booting again at least.

For a phone not booting, feel free to email me mikereidis @ gmail.com . I'll try to get to my weekend email tonight.

I will try to create a removal script that can be run from recovery, but it may have to be generated at install time.
[Android Apps and Games] themadproducer:
[MENTION=3575078]mikereidis[/MENTION]

Good follow up bro. Great info. Yup...those Wolfson chips. The name escaped me as my memory retention for details fades with age. If my cash wasn't so spoken for at all times...I would buy and play around with some of those DAC's...and the matching dedicated AMPS that are around the same size. There are some real nice toys out there. Frankly, I don't see how the designers will make a profit seeing as there are so few people that would be capable of appreciating the difference...and...there is too much competition as well.
[Android Apps and Games] OldYellowBricks:
thank you sooo much! :)

---------- Post added at 11:02 AM ---------- Previous post was at 10:59 AM ----------

Now it all makes sense haha. Thank you so much!
[Android Apps and Games] aidfarh:
[MENTION=3575078]mikereidis[/MENTION],

Thanks for this great app. I have a feature suggestion. Maybe you can implement intent actions that can be used by third party apps. We can then use something like Tasker to have customised levels for different apps, e.g. to increase the recording gain when we launch the camera/video recording app.
[Android Apps and Games] andrgn:
Well, that broke my device. I started the app, pressed OK to install + warm boot, warm boot started and never ended. I forced a full boot and the device never went past the logo.

Device is a Samsung P7500 (SGT 10.1) stock 4.0.4. You may want to warn about this in the original post.

Fixed by booting to CWM, mounting system, dropping to an adb shell, removing the new .so, and reinstating orig.
[Android Apps and Games] mikereidis:
Sounds good. :)

I implemented an Intent based API for my Spirit2 FM app, but nobody seems much interested.