Lollipop Leak for Sprint Galaxy S5, TWRP for Micromax Canvas Magnus – XDA TV

Android 5.0 Lollipop has been leaked for the Sprint … more

Velocity is Like OpenTable on Steroids

We all enjoy a night out with friends or our significant other from time to time. However, there is … more

Android Lollipop Lands for the Sony Xperia Z Ultra

The undisputed king of the beasts–at least in Sony’s current stable,is the … more

Android 5.0 Lollipop in 3D–EVO 3D, That Is!

It is that time of the year once again. Flowers bloom (or snow falls, depending on which … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[THINK TANK] Boosting Nexus Audio Even Further

OP Geniusdog254

4th May 2010, 03:19 AM   |  #1  
Geniusdog254's Avatar
OP Retired Recognized Developer
Flag St. Louis
Thanks Meter: 167
 
1,094 posts
Join Date:Joined: Jan 2009
Donate to Me
More
Ok, we all know about the volume level changes on CodeAurora. I'm trying to take it a step further, as the speaker is still incredibly soft compared to my G1. I'm working on some kernel mods to boost the audio further.

If you look in q6audio.c where (along with board-mahimahi-audio.c) the audio hacks are made. The current mod just raises the values within the current range settings.

However, in q6audio.c at line 1275-1287 it defines the stream volume. There is code there to check if the min/max ranges set earlier in the file and in board-mahimahi-audio.c are within the ranges of the chip as I'm guessing defined by Qualcomm. My idea is to change those values, thus setting a higher range that we can use to set the volume. I've changed the code to set it at 3200 max & -2000 min which matches the original range of 1200 to -4000.

Then I set the values at 2000 & -400 for the speaker in the ealier min/max definitions at the beginning of q6audio.c & board-mahimahi-audio.c and I hear no discernable difference. Why?

When I change the values back to the original 1200 to -4000 and then just set the min/max values lower to see if it gets quieter, there is no difference yet again. I know my kernel is building right, because if I change kernel freqs/voltages it works, and if I change RAM tables it works, why won't the audio changes work?

Any kernel chefs wanna weigh in here? Any ideas to boost audio more? Thanks all, maybe we can finally get decent volume on our Nexii!
4th May 2010, 03:31 AM   |  #2  
Senior Member
Thanks Meter: 4
 
261 posts
Join Date:Joined: Feb 2009
From my own experiences, I think modding the audio on my G1 eventually caused the speaker to blow.. So i bought a N1. I've also heard that it's common with HTC phones. With that said i'm very interested to see where this goes.
4th May 2010, 03:34 AM   |  #3  
Geniusdog254's Avatar
OP Retired Recognized Developer
Flag St. Louis
Thanks Meter: 167
 
1,094 posts
Join Date:Joined: Jan 2009
Donate to Me
More
Quote:
Originally Posted by ComplexMinded

From my own experiences, I think modding the audio on my G1 eventually caused the speaker to blow.. So i bought a N1. I've also heard that it's common with HTC phones. With that said i'm very interested to see where this goes.

Yeah I have no intention of pushing things too far lol. I'll be careful with values & test things on my own before (read: if) I ever release anything.

Still, I have no responsibility if you guys screw up.
4th May 2010, 05:44 AM   |  #4  
Geniusdog254's Avatar
OP Retired Recognized Developer
Flag St. Louis
Thanks Meter: 167
 
1,094 posts
Join Date:Joined: Jan 2009
Donate to Me
More
Tried again with slightly different settings. Still a no go.

Gunna look at some more code tomorrow night (maybe ADIE tables & some other ****).

One idea that hit me, though its over my head, would be boosting the voltage running to the speaker? Stupid or no? I'm guessing it would be in a GPIO setting somewhere. Board-mahimahi.c? Something in the qdsp6 folder where the q6audio & ADIE files are?

Sorry just kinda rambling here. Trying to spark some brighter minds than my own. Running out of ideas, any help would be appreciated
4th May 2010, 09:09 AM   |  #5  
vegetaleb's Avatar
Senior Member
Flag Beirut
Thanks Meter: 858
 
5,685 posts
Join Date:Joined: Feb 2010
More
Did you try the final Desire audio kernel? Reviews showed that Desire has 30% more volume for ringtones...
4th May 2010, 01:22 PM   |  #6  
kelddaug's Avatar
Senior Member
Thanks Meter: 13
 
235 posts
Join Date:Joined: Dec 2009
More
I think that the loudspeaker on Nexus and Desire is screamy(high freq) it needs more bass, but i dont think its made for that.
It sounds terrible strident.
4th May 2010, 02:32 PM   |  #7  
Meltus's Avatar
Senior Member
Flag Manchester
Thanks Meter: 1,015
 
1,911 posts
Join Date:Joined: Jan 2009
Donate to Me
More
Some sort of progress

If you push libhtc-acoustic.so from a Desire build to '/system/lib' and restart the media server ("killall mediaserver") it then tries to load a file called 'TPA2018.csv' and when it fails it says something along the lines of "Speaker Amplification Failed". I managed to track this file down and i can get it to successfully load, but then it fails trying to load '/dev/tpa2018d1' and try as i might, i can't find this file anywhere.
I'm not in a position where i can build the source at the moment but if anyone could try building this file (if it's even present in the source) it would be very helpful
4th May 2010, 04:55 PM   |  #8  
Geniusdog254's Avatar
OP Retired Recognized Developer
Flag St. Louis
Thanks Meter: 167
 
1,094 posts
Join Date:Joined: Jan 2009
Donate to Me
More
Quote:
Originally Posted by Meltus

Some sort of progress

If you push libhtc-acoustic.so from a Desire build to '/system/lib' and restart the media server ("killall mediaserver") it then tries to load a file called 'TPA2018.csv' and when it fails it says something along the lines of "Speaker Amplification Failed". I managed to track this file down and i can get it to successfully load, but then it fails trying to load '/dev/tpa2018d1' and try as i might, i can't find this file anywhere.
I'm not in a position where i can build the source at the moment but if anyone could try building this file (if it's even present in the source) it would be very helpful

The reason its failing is because the Nexus doesn't have that hardware. The TPA2018.c file runs a check to see if your on a CDMA revision device and if you are it enables an extra pin on the chip that amplifies it. That is a dead end since even hardcoding it to try and load that pin will fail since it doesn't exist on UMTS devices.

I did however find some gain settings in a few files that I'm going to try out once I get outta school today though. It should work, but we'll have to wait and see.

Also, interestingly enough it seems as though the CDMA revisions support stereo speakers. The code has support for left/right device speakers in CDMA mode.

It seems those of us that bought GSM/UMTS Nexii are getting continually shafted. Weaker screens, crappy touch sensor on both revisions, worse speaker. Oh well though, I still love my Nexus.
4th May 2010, 05:11 PM   |  #9  
Meltus's Avatar
Senior Member
Flag Manchester
Thanks Meter: 1,015
 
1,911 posts
Join Date:Joined: Jan 2009
Donate to Me
More
Quote:
Originally Posted by Geniusdog254

The reason its failing is because the Nexus doesn't have that hardware. The TPA2018.c file runs a check to see if your on a CDMA revision device and if you are it enables an extra pin on the chip that amplifies it. That is a dead end since even hardcoding it to try and load that pin will fail since it doesn't exist on UMTS devices.

Ah that's a shame. Thanks for the info though, it sucks that i've been chasing a dead end with that, it looked so promising too
5th May 2010, 02:10 AM   |  #10  
Geniusdog254's Avatar
OP Retired Recognized Developer
Flag St. Louis
Thanks Meter: 167
 
1,094 posts
Join Date:Joined: Jan 2009
Donate to Me
More
Quote:
Originally Posted by Meltus

Some sort of progress

If you push libhtc-acoustic.so from a Desire build to '/system/lib' and restart the media server ("killall mediaserver") it then tries to load a file called 'TPA2018.csv' and when it fails it says something along the lines of "Speaker Amplification Failed". I managed to track this file down and i can get it to successfully load, but then it fails trying to load '/dev/tpa2018d1' and try as i might, i can't find this file anywhere.
I'm not in a position where i can build the source at the moment but if anyone could try building this file (if it's even present in the source) it would be very helpful

Also, /dev/tpa2018d1 isn't a file, its a link to a hardware device. In this case the speaker amplifier pin. Manufacturer page here @ TI page. Obviously a speaker amplifier chip, I would need to see a Nexus board to see if its present or not, but I have no idea how to go about that. I'd have to talk to a disassembly expert.

Anyways, I did a little more work.

To start with, in pmic.h:
  • Lines 39-49 have a speaker gain settings table. This is used in files like board-mahimahi-audio.c. The "SPKR_GAIN_PLUS12DB" is already whats defined. So I added a setting for 16DB gain. More on that later.

Next, in board-mahimahi-audio.c:
  • Lines 71-136 have the speaker enable methods.
    Lines 120-121 already used the pmic_spkr_set_gain method as defined in pmic.h. I added those methods to lines 84-85 & 94-95 in the code where it turns on the speaker.

Still a no go. Does anyone else have any clues on this?

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes