LG LEON - very low speaker volume - LG Leon Questions & Answers

Hey Guys,
I would like to ask for your support on my case. Basically, I have flashed a CM 12.1 into my LG Leon H320. Everything works smoothly, except one thing:
Default audio volume of speaker is very-very low. When I receive a call I can barely hear my partner, the situation is the same when I listen to music.
When I plug my headset, the volume is fine.
I was trying and googling out the most common solutions without any success. On the flashed ROM I have Audio FX and Viper4Android installed, however I am unable to tweak the volume by these tools.
I would very appreciate any advice on this matter.

I found a conf file on my phone what can be related to default speaker volume. Unfortunately I dont really know which position needs to be changed in order to have higher speaker volume. So here is the file:
#
# Audio policy configuration for generic device builds (goldfish audio HAL - emulator)
#
# Global configuration section: lists input and output devices always present on the device
# as well as the output device selected by default.
# Devices are designated by a string that corresponds to the enum in audio.h
#global_configuration {
# attached_output_devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE
# default_output_device AUDIO_DEVICE_OUT_SPEAKER
# attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_REMOTE_SUBMIX|AUDIO_DEVICE_IN_FM
#}
# audio hardware module section: contains descriptors for all audio hw modules present on the
# device. Each hw module node is named after the corresponding hw module library base name.
# For instance, "primary" corresponds to audio.primary.<device>.so.
# The "primary" module is mandatory and must include at least one output with
# AUDIO_OUTPUT_FLAG_PRIMARY flag.
# Each module descriptor contains one or more output profile descriptors and zero or more
# input profile descriptors. Each profile lists all the parameters supported by a given output
# or input stream category.
# The "channel_masks", "formats", "devices" and "flags" are specified using strings corresponding
# to enums in audio.h and audio_policy.h. They are concatenated by use of "|" without space or "\n".
audio_hw_modules {
primary {
global_configuration {
attached_output_devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_EARPIECE
default_output_device AUDIO_DEVICE_OUT_SPEAKER
attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_FM|AUDIO_DEVICE_IN_VOICE_CALL
audio_hal_version 3.0
}
devices {
headset {
type AUDIO_DEVICE_OUT_WIRED_HEADSET
gains {
gain_1 {
mode AUDIO_GAIN_MODE_JOINT
channel_mask AUDIO_CHANNEL_OUT_STEREO
min_value_mB -6400
max_value_mB 0
default_value_mB 0
step_value_mB 100
min_ramp_ms 0
max_ramp_ms 0
}
}
}
headphone {
type AUDIO_DEVICE_OUT_WIRED_HEADPHONE
gains {
gain_1 {
mode AUDIO_GAIN_MODE_JOINT
channel_mask AUDIO_CHANNEL_OUT_STEREO
min_value_mB -6400
max_value_mB 0
default_value_mB 0
step_value_mB 100
min_ramp_ms 0
max_ramp_ms 0
}
}
}
}
outputs {
primary {
sampling_rates 44100|48000
channel_masks AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET|AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_FM_TX|AUDIO_DEVICE_OUT_DEFAULT
flags AUDIO_OUTPUT_FLAG_PRIMARY
gains {
gain_1 {
mode AUDIO_GAIN_MODE_JOINT
channel_mask AUDIO_CHANNEL_OUT_STEREO
min_value_mB -6400
max_value_mB 0
default_value_mB 0
step_value_mB 100
min_ramp_ms 0
max_ramp_ms 0
}
}
}
}
inputs {
primary {
sampling_rates 48000
channel_masks AUDIO_CHANNEL_IN_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_IN_COMMUNICATION|AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_AMBIENT|AUDIO_DEVICE_IN_WIRED_HEADSET|AUDIO_DEVICE_IN_AUX_DIGITAL|AUDIO_DEVICE_IN_MATV|AUDIO_DEVICE_IN_VOICE_CALL|AUDIO_DEVICE_IN_BACK_MIC|AUDIO_DEVICE_IN_ALL_SCO|AUDIO_DEVICE_IN_FM|AUDIO_DEVICE_IN_DEFAULT
}
}
}
a2dp {
global_configuration {
audio_hal_version 2.0
}
outputs {
a2dp {
sampling_rates 44100
channel_masks AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_OUT_ALL_A2DP
}
compress_offload {
sampling_rates 8000|11025|16000|22050|32000|44100|48000
channel_masks AUDIO_CHANNEL_OUT_MONO|AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_AAC|AUDIO_FORMAT_MP3
devices AUDIO_DEVICE_OUT_ALL_A2DP
flags AUDIO_OUTPUT_FLAG_DIRECT|AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD
}
}
inputs {
a2dp {
sampling_rates 44100
channel_masks AUDIO_CHANNEL_IN_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_IN_BLUETOOTH_A2DP
}
}
}
usb {
global_configuration {
audio_hal_version 2.0
}
outputs {
usb_accessory {
sampling_rates 44100
channel_masks AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_OUT_USB_ACCESSORY
}
usb_device {
sampling_rates dynamic
channel_masks dynamic
formats dynamic
devices AUDIO_DEVICE_OUT_USB_DEVICE
}
}
inputs {
usb_device {
sampling_rates dynamic
channel_masks AUDIO_CHANNEL_IN_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_IN_USB_DEVICE
}
}
}
r_submix {
global_configuration {
attached_input_devices AUDIO_DEVICE_IN_REMOTE_SUBMIX
audio_hal_version 2.0
}
outputs {
r_submix {
sampling_rates 48000
channel_masks AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_OUT_REMOTE_SUBMIX
}
}
inputs {
r_submix {
sampling_rates 48000
channel_masks AUDIO_CHANNEL_IN_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_IN_REMOTE_SUBMIX
}
}
}
}
Click to expand...
Click to collapse

I have your same problem! Did you find a solution?

Related

Catch ACTION_MEDIA_BUTTON - Intent from BT-Headset

Hi Community,
I have problems with the ACTION_MEDIA_BUTTON - Intent. I can't get my App receiving those actions and react on them.
In my AndroidManifest.xml I added the Intent-filter:
Code:
<intent-filter android:priority="42">
<action android:name="android.intent.action.MEDIA_BUTTON">
</intent-filter>
And in the onCreate-Method I registered a Receiver:
Code:
BroadcastReceiver receiver;
if (receiver == null) {
receiver = new ButtonReceiver();
}
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_MEDIA_BUTTON);
filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
registerReceiver(receiver, filter);
And the corresponding ButtonReceiver-class:
Code:
class ButtonReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent)
{
String intentAction = intent.getAction();
if (Intent.ACTION_MEDIA_BUTTON.equals(intentAction))
{
Log.d("ButtonReceiver", "I will handle buttons here");
//handle buttons
}
}
}
The app compiles fine and is also running without problems, BUT I never get to the "//handle buttons"-section.
For testing purpose I'm using my Jabra BT2015 and the provided earphones from HTC. Both don't work.
Every hint is very appreciated.
Greez
LordAlien

ambient sound values

hello
I would like to get the values from a sample of an ambient sounds phone absorbs from it's surroundings. how can I able to do so?
i.e how do I sample, and then how do I get values, and in which form?
thanks,
Doron
i know no way of getting the sound levels from the mic without recording a file and doing some sort of audio analysis on it.
see http://developer.android.com/reference/android/media/MediaRecorder.html
and (not my code...)
Code:
public class AudioRecorder {
final MediaRecorder recorder = new MediaRecorder();
final String path;
/**
* Creates a new audio recording at the given path (relative to root of SD card).
*/
public AudioRecorder(String path) {
this.path = sanitizePath(path);
}
private String sanitizePath(String path) {
if (!path.startsWith("/")) {
path = "/" + path;
}
if (!path.contains(".")) {
path += ".3gp";
}
return Environment.getExternalStorageDirectory().getAbsolutePath() + path;
}
/**
* Starts a new recording.
*/
public void start() throws IOException {
String state = android.os.Environment.getExternalStorageState();
if(!state.equals(android.os.Environment.MEDIA_MOUNTED)) {
throw new IOException("SD Card is not mounted. It is " + state + ".");
}
// make sure the directory we plan to store the recording in exists
File directory = new File(path).getParentFile();
if (!directory.exists() && !directory.mkdirs()) {
throw new IOException("Path to file could not be created.");
}
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(path);
recorder.prepare();
recorder.start();
}
/**
* Stops a recording that has been previously started.
*/
public void stop() throws IOException {
recorder.stop();
recorder.release();
}
}
thanks a lot.

[Q] Android get the actual ip address

Hi, I've this method that looks for the IP of my device:
Code:
public String getLocalIpAddress(boolean useIPv4){
String ritorno="";
try{ List<NetworkInterface>interfaces=Collection.list(NetworkInterface.getNetworkInterfaces());
for (NetworkInterface intf : interfaces) {
List<InetAddress> addrs = Collections.list(intf.getInetAddresses());
for (InetAddress addr : addrs) {
if (!addr.isLoopbackAddress()) {
String sAddr = addr.getHostAddress().toUpperCase();
boolean isIPv4 = InetAddressUtils.isIPv4Address(sAddr);
if (useIPv4) {
if (isIPv4)
ritorno=sAddr;
} else {
if (!isIPv4) {
int delim = sAddr.indexOf('%'); // drop ip6 port suffix
return delim<0 ? sAddr : sAddr.substring(0, delim);
}
}
}
}
}
} catch (Exception ex) { } // for now eat exceptions
return ritorno;
Now, the issue is that when I do intf.getInetAddresses(), I get a collection of the addresses bound to intf, but I need the address relative to the last connection. How can I solve my issue?

[GUIDE] Customize Lollipop's official Clock application

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I am a person who needs many many multiple alarms to wake up early in the morning.
Every clock/alarm applications I tried has no feature that turning on or off all alarms at once.
So I decided to customize google's official android clock app.
Let's get it started.
### Needed #####
google's clock app source (I use Lollipop's source for my device)
buttons icon image
### Steps #####
1) download source from googlesource.com repository
android system clock application's package name is "DeskClock".
You can clone the source like below
Code:
git clone -b lollipop-release https://android.googlesource.com/platform/packages/apps/DeskClock
2. import it & remove errors
When you import the project to your IDE, you will get thousand of import errors.
Check below
SDK Version
- Make sure that you have lollipop sdk and check "Build Target" in "Project Properties"
AndroidManifest
- Specify min/targetSdkVersion, if it is not in AndroidManifest.xml
- There is "DEVICE_POWER" permission because it is android system app but we can't build system application so just remove it. (In my usage, it seems to be no problem)
Library
- Put android support-library jar file and add it to project build path.
3. Add button icons
- add ic_all_on.png, ic_all_off.png as drawable
4. Edit the sources
There is "DeskClockFragmet" class which is parent of alam/timer/stopwatch/clock's Fragment class.
It uses common layout "desk_clock.xml". It has three buttons (Fab, sub buttons) in the bottom of the screen and Alarm Fragment does not use and just hide sub buttons.
Which means we can easily add buttons to that place.
setLeftRightButtonAppearance() in AlarmClockFragment.java
Code:
@Override
public void setLeftRightButtonAppearance() {
final DeskClock activity = (DeskClock) getActivity();
if (mLeftButton == null || mRightButton == null ||
activity.getSelectedTab() != DeskClock.ALARM_TAB_INDEX) {
return;
}
[COLOR="SeaGreen"] // mLeftButton.setVisibility(View.INVISIBLE);
//mRightButton.setVisibility(View.INVISIBLE);
mLeftButton.setEnabled(true);
mRightButton.setEnabled(true);
mLeftButton.setVisibility(View.VISIBLE);
mRightButton.setVisibility(View.VISIBLE);
mLeftButton.setImageResource(R.drawable.ic_all_off);
mRightButton.setImageResource(R.drawable.ic_all_on);[/COLOR]
}
set mLeft/RightButton enabled and change visibilty to VISIBLE, set button image as drawable we added.
Override onLeftButtonClick/onRightButtonClick() from parent (DeskClockFragment.class) and call switchAlarms() what we will implement.
Code:
@Override
public void onLeftButtonClick(View view) {
super.onLeftButtonClick(view);
mAdapter.switchAlarms(false);
Toast.makeText(getActivity(), "Every Alarms Disabled!!", Toast.LENGTH_SHORT).show();
}
@Override
public void onRightButtonClick(View view) {
super.onRightButtonClick(view);
mAdapter.switchAlarms(true);
Toast.makeText(getActivity(), "Every Alarms Enabled!!", Toast.LENGTH_SHORT).show();
}
+ I just hide menu button in bottom-right just in alarm tab because right and menu button are overlayed.
onCreateView() in AlarmClockFragment.java
Code:
if (menuButton != null) {
// if (isLandscape) {
// menuButton.setVisibility(View.GONE);
// } else {
// menuButton.setVisibility(View.VISIBLE);
// setupFakeOverflowMenuButton(menuButton);
// }
//remove menu button
menuButton.setVisibility(View.GONE);
}
There is AlarmItemAdapter sub class in AlarmClockFragment.java which extends CursorAdapter.
We have to implement something that change actual alarm data in inner database and change views depend on each alarm's on/off value.
I just added a method "swichAlarms" into this sub class to do that.
boolean enabled value is passed as parameter (on : true / off : false)
Get every alarm's view and change the view when the alarm on/off status has to be changed
Also there's a way to get alarms llist in Alarm.java that is getAlarms() method.
I use it to get alarms list a alarm's enabled value is different.
And change alarms enabled value with asyncUpdateAlarm() method in AlarmClockFragment.java
That's all!
easy?
Code:
// added by donghe
/**
* A convenience method to enable or disable every alarm.
* Get child view (visible view) in alarm list and changing ItemAlpha whether if its enabled value is different
* Get alarm(s) linked list from Alarms Class only if the alarm has to be updated.
* Do asynchronous updating.
* @param enabled true for turning on, false for turning off
*/
private void switchAlarms(boolean enabled) {
int totalLength = mList.getCount();
for (int i = 0; i < totalLength; i++) {
View v = mList.getChildAt(i);
if (v != null) {
ItemHolder h = (ItemHolder)(v.getTag());
if (h != null && h.alarm.enabled != enabled) {
setDigitalTimeAlpha(h, enabled);
}
}
}
String selection = null;
if(enabled){
selection = "ENABLED = 0";
}
else{
selection = "ENABLED = 1";
}
ContentResolver cr = getActivity().getApplicationContext().getContentResolver();
List<Alarm> alarmList = Alarm.getAlarms(cr, selection, null);
for(Alarm alarm: alarmList){
alarm.enabled = enabled;
asyncUpdateAlarm(alarm, false);
}
}
Now I feel comfortable to sleep lately in the evening and wake up early in the morning
Hope this thread is helpful to someone like me.
I attached project archive and apk.
Enjoy it!
Thanks men!

Audio improvement for N7100 : Break vol./power limits with no distortion

Hi all
I rarely post in XDA becau I havehave nothing to share. But today I am happy to share this a little thing.
For audio of Note2 N7100, have two matters : 1)Volume limit for some local, and for others seems not limit but still small sound, not enough for a high resistance headphone which over 150Ohm. 2) Distort and include auto interrupt power (sound stop) due to Headphones volume trick (mostly from original 55dB to 57dB or 60dB and 63dB as in some kernel/app or flashzip).
Now start. We need a rooted device Note2 (also for S3, Note3, S4 ) and Root Browser app (on google market)
Use Root browser (other app can do but recommend root browser) to access
\system\etc\sound\t03g. Base on device and Android version, if not found, it will be at \system\etc\default_gain.conf
Open it and you see extractly or similar to this
And this
That's all! Those values are different from your original, I changed them.
You see 3 elements related to volume
Headphones volume
Aif1dac volume
Dac1 volume
I have read specs of DAC chip WM1811 in Note2 from maker's homepage.
All volume level of components are 96 to 100dB (means over 100 is out of range or with distortion). But, actually those value I confirmed OK : sounds bigger and better.
Headphone volume is limit at 63 on Note2, 64 will cause no sound. On high impedance HP as 300Ohm, 63 also make overpowered of sound chip and it stops player.
It is not a good item to change
Aif1dac (audio interface 1) is reduce because I want to use more volume from Dac1
(Main audio use dac1, other as call, mic, FM on aif2, dac2 if I don't misreading).
For Dac1 volume we can choose 96(original) to 128 (over that makes no sound). I run near max value and never found audio interrupted or any thing happens, not heating, no distortion.
Lastly Audio path DAC to headphone mux val. =0 (original ="mixer")
Test it and feel. Have fun!
This was really useful, thank you.
I changed the values for headset, headphones and aux DAC. I'm happy with analogue dock out, speaker, in-call values etc. and I don't use a bluetooth headset. I also didn't change any of the loop values as I'm sure Samsung know much better than me about this stuff as I know nothing!
Original headset values:
Code:
Modifier "Normal" {
SupportedDevice {
"Headset Out"
}
Enable {
{ "Headphone ZC Switch", 0 },
{ "AIF1DAC1 Volume", 96 },
{ "AIF1 Boost Volume", 0 },
{ "DAC1 Volume", 96 },
{ "Left Output Mixer DAC Volume", 7 },
{ "Right Output Mixer DAC Volume", 7 },
{ "Headphone Volume", 49 },
}
Disable {
{ "Headphone ZC Switch", 0 },
{ "AIF1DAC1 Volume", 96 },
{ "AIF1 Boost Volume", 0 },
{ "DAC1 Volume", 96 },
{ "Headphone Volume", 50 },
}
}
New headset values:
Code:
Modifier "Normal" {
SupportedDevice {
"Headset Out"
}
Enable {
{ "Headphone ZC Switch", 0 },
{ "AIF1DAC1 Volume", 100 },
{ "AIF1 Boost Volume", 0 },
{ "DAC1 Volume", 100 },
{ "Left Output Mixer DAC Volume", 7 },
{ "Right Output Mixer DAC Volume", 7 },
{ "Headphone Volume", 63 },
}
Disable {
{ "Headphone ZC Switch", 0 },
{ "AIF1DAC1 Volume", 100 },
{ "AIF1 Boost Volume", 0 },
{ "DAC1 Volume", 100 },
{ "Headphone Volume", 63 },
}
}
Headphone changes are as above.
Original AUX Digital Out values:
Code:
Modifier "Normal" {
SupportedDevice {
"AUX Digital Out"
}
Enable {
{ "AIF1DAC1 Volume", 96 },
}
Disable {
{ "AIF1DAC1 Volume", 96 },
{ "AIF1 Boost Volume", 0 },
{ "DAC1 Volume", 96 },
{ "SPKL DAC1 Volume", 1 },
{ "SPKR DAC1 Volume", 1 },
{ "Speaker Mixer Volume", 0 },
{ "Speaker Volume", 57 },
{ "Speaker Boost Volume", 0 },
}
}
New AUX Digital Out values:
Code:
Modifier "Normal" {
SupportedDevice {
"AUX Digital Out"
}
Enable {
{ "AIF1DAC1 Volume", 100 },
}
Disable {
{ "AIF1DAC1 Volume", 100 },
{ "AIF1 Boost Volume", 0 },
{ "DAC1 Volume", 100 },
{ "SPKL DAC1 Volume", 1 },
{ "SPKR DAC1 Volume", 1 },
{ "Speaker Mixer Volume", 0 },
{ "Speaker Volume", 63 },
{ "Speaker Boost Volume", 0 },
}
}
I rebooted and checked with Samsung HS330 headset, a standard headphone (no mic or call controls) and also with my FiiO E7 USB DAC/Amp connected via USB OTG cable. I get a convenient volume increase in each case, no extra system noise, no audible distortion and nothing went wrong ...so far.
Rocking on Dr. Ketan V14. Thanks a Ton !!!

Categories

Resources