Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,742,347 Members 52,055 Now Online
XDA Developers Android and Mobile Development Forum

[THINK TANK] Boosting Nexus Audio Even Further

Tip us?
 
Geniusdog254
Old
#1  
Geniusdog254's Avatar
Retired Recognized Developer - OP
Thanks Meter 166
Posts: 1,094
Join Date: Jan 2009
Location: St. Louis

 
DONATE TO ME
Default [THINK TANK] Boosting Nexus Audio Even Further

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!
Follow me on Twitter @Geniusdog254

If you like my work, please buy one of my apps on the Market or donate!
  • Reflex-A-Tron - A colorful, addicting, & fun game to test yourself & challenge friends for only $.99!
  • Search2Play - Control your music with your device's buttons!
  • Task'd - A beautiful to-do list app!

Phones:
Android Dev Phone 1 - Dec. '08
Rogers HTC Dream - Sept. '09
AT&T Nexus One - March '10
Motorola Droid - Apr. '10
HTC Evo - Jun. '10
HTC Evo 3D - Jun. '11
Sprint Galaxy Nexus - May '12
 
ComplexMinded
Old
#2  
Senior Member
Thanks Meter 4
Posts: 261
Join Date: 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.
VB.NET,C#,ASP.NET Developer

It would probably be best to follow me on twitter
 
Geniusdog254
Old
#3  
Geniusdog254's Avatar
Retired Recognized Developer - OP
Thanks Meter 166
Posts: 1,094
Join Date: Jan 2009
Location: St. Louis

 
DONATE TO ME
Quote:
Originally Posted by ComplexMinded View Post
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.
Follow me on Twitter @Geniusdog254

If you like my work, please buy one of my apps on the Market or donate!
  • Reflex-A-Tron - A colorful, addicting, & fun game to test yourself & challenge friends for only $.99!
  • Search2Play - Control your music with your device's buttons!
  • Task'd - A beautiful to-do list app!

Phones:
Android Dev Phone 1 - Dec. '08
Rogers HTC Dream - Sept. '09
AT&T Nexus One - March '10
Motorola Droid - Apr. '10
HTC Evo - Jun. '10
HTC Evo 3D - Jun. '11
Sprint Galaxy Nexus - May '12
 
Geniusdog254
Old
#4  
Geniusdog254's Avatar
Retired Recognized Developer - OP
Thanks Meter 166
Posts: 1,094
Join Date: Jan 2009
Location: St. Louis

 
DONATE TO ME
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
Follow me on Twitter @Geniusdog254

If you like my work, please buy one of my apps on the Market or donate!
  • Reflex-A-Tron - A colorful, addicting, & fun game to test yourself & challenge friends for only $.99!
  • Search2Play - Control your music with your device's buttons!
  • Task'd - A beautiful to-do list app!

Phones:
Android Dev Phone 1 - Dec. '08
Rogers HTC Dream - Sept. '09
AT&T Nexus One - March '10
Motorola Droid - Apr. '10
HTC Evo - Jun. '10
HTC Evo 3D - Jun. '11
Sprint Galaxy Nexus - May '12
 
vegetaleb
Old
#5  
vegetaleb's Avatar
Senior Member
Thanks Meter 832
Posts: 5,629
Join Date: Feb 2010
Location: Beirut
Did you try the final Desire audio kernel? Reviews showed that Desire has 30% more volume for ringtones...
 
kelddaug
Old
#6  
kelddaug's Avatar
Senior Member
Thanks Meter 8
Posts: 218
Join Date: Dec 2009
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.
 
Meltus
Old
#7  
Meltus's Avatar
Senior Member
Thanks Meter 993
Posts: 1,909
Join Date: Jan 2009
Location: Manchester

 
DONATE TO ME
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
 
Geniusdog254
Old
#8  
Geniusdog254's Avatar
Retired Recognized Developer - OP
Thanks Meter 166
Posts: 1,094
Join Date: Jan 2009
Location: St. Louis

 
DONATE TO ME
Quote:
Originally Posted by Meltus View Post
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.
Follow me on Twitter @Geniusdog254

If you like my work, please buy one of my apps on the Market or donate!
  • Reflex-A-Tron - A colorful, addicting, & fun game to test yourself & challenge friends for only $.99!
  • Search2Play - Control your music with your device's buttons!
  • Task'd - A beautiful to-do list app!

Phones:
Android Dev Phone 1 - Dec. '08
Rogers HTC Dream - Sept. '09
AT&T Nexus One - March '10
Motorola Droid - Apr. '10
HTC Evo - Jun. '10
HTC Evo 3D - Jun. '11
Sprint Galaxy Nexus - May '12
 
Meltus
Old
#9  
Meltus's Avatar
Senior Member
Thanks Meter 993
Posts: 1,909
Join Date: Jan 2009
Location: Manchester

 
DONATE TO ME
Quote:
Originally Posted by Geniusdog254 View Post
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
 
Geniusdog254
Old
#10  
Geniusdog254's Avatar
Retired Recognized Developer - OP
Thanks Meter 166
Posts: 1,094
Join Date: Jan 2009
Location: St. Louis

 
DONATE TO ME
Quote:
Originally Posted by Meltus View Post
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?
Follow me on Twitter @Geniusdog254

If you like my work, please buy one of my apps on the Market or donate!
  • Reflex-A-Tron - A colorful, addicting, & fun game to test yourself & challenge friends for only $.99!
  • Search2Play - Control your music with your device's buttons!
  • Task'd - A beautiful to-do list app!

Phones:
Android Dev Phone 1 - Dec. '08
Rogers HTC Dream - Sept. '09
AT&T Nexus One - March '10
Motorola Droid - Apr. '10
HTC Evo - Jun. '10
HTC Evo 3D - Jun. '11
Sprint Galaxy Nexus - May '12

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Navigate with Your Samsung Gear 2 Using DMA Navi Watch

Whether you’re travelling to a new destination or exploring some previously … more

Xperia Z1 Stereo Speaker Mod, Cell Phone Unlocking Legal Again! – XDA Developer TV

Cell Phone Unlocking is legal again!! That and much … more

[OTA Captured] Verizon LG G Pad 8.3 Finally Gets Official KitKat Update

It’s been almost nine months since the LG G Pad … more

Enjoy Wallpaper Overload with PhotoPhase

We don’t usually feature live wallpapers on the XDA Portal unless they are somewhat innovative … more