Change Min volume Level - Android Q&A, Help & Troubleshooting

Hello,
I have a motorola Moto Z2 Force. Like many other motorola, it has a problem: the minimum Media volume (one step above mute) is WAY to lout. (step one is about 36% of the max scale).
In Engineer mode you can set values for each step. But on my Moto there is no Engineer mode since as far as I understood it is only available for Mediatek devices.
I am wondering, in wich file are the volume steps defined? I would like to edit them manually. (>Yes my device is rooted..)
I do not want to use programs like precise volume or things like that.. I would just like to edit the setting and have it done.. I already increased the steps of the slider.. but that does nothing more than adding more steps between 36% volume and 100% volume.
I would like to transform that 36% to about 5%...
I am on Android 8.0.0 latest security update.
Thank you!
Best regards
Sharky

ok guys,
i found out that i have to edit this:
/** Minimum volume index values for audio streams */
protected static int[] MIN_STREAM_VOLUME = new int[] {
1, // STREAM_VOICE_CALL
0, // STREAM_SYSTEM
0, // STREAM_RING
0, // STREAM_MUSIC
1, // STREAM_ALARM
0, // STREAM_NOTIFICATION
0, // STREAM_BLUETOOTH_SCO
0, // STREAM_SYSTEM_ENFORCED
0, // STREAM_DTMF
0, // STREAM_TTS
1 // STREAM_ACCESSIBILITY
};
Click to expand...
Click to collapse
inside the audioservice.java file.. problem is, i dont seem to be able to find this file.. where is it located??

Nobody has an idea on how to change the min. volume of the media, keeping the max volume the same? I am still stuck and found nothing so far...

Related

Turning the screen off (not backlight)

Is there a way to turn off, not the backlight, not the pda, but just the screen?
All I know is, I have Linux on my ipaqs, and you can turn off just the screen (the backlight will be off too of course), to save battery power. I usually do this when I'm listening to mp3 with it.
I imagine the hardware itself is capable to do this, but pocketpc by default does not have such an option. Now I'm wondering if pocketpc has exposed any APIs to do this.
Thanks.
I just know PocketDiVX in the new ROM can map a button to do this. No idea how to do it from code though...
this works on my xda with media player
http://homepage.ntlworld.com/gazzaman2k//a/Software/Display off.zip
Apart from setting the power pref's in system/settings, no such luck ... I've searched the XDA for a program that does this with no luck.
Has anyone found a ROM link ?
I like and use Pocket Toolman
http://members.shaw.ca/pockettoolman/
HTH
here's one that's hopefully the answer to your request. the file is called sleepscreen and it does exactly what you mentioned; turns off the screen while applications are running. i've installed it in my "start" menu so that anytime i want to switch off the screen i can do so.
when you click on the icon on your start menu; the screen goes blank and if you'll notice the LED of the xda is blinking...meaning apps are running while the screen is off. all you have to do to activate the screen is press any button (e.g. the contacts or calendar button)...but DON'T hit the power button because that switches off all the apps running.
how do i attach the file in this forum? it's only 24kb zipped. or give me your email address and i'll mail it to you.
hope that helps mate!
Code:
// offDisplay.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include <stdlib.h>
#include <nled.h>
// LED support
extern "C" BOOL NLedGetDeviceInfo(INT nID, PVOID pOutput);
extern "C" BOOL NLedSetDevice(INT nID, PVOID pOutput);
// GDI Escapes for ExtEscape()
#define QUERYESCSUPPORT 8
// The following are unique to CE
#define GETVFRAMEPHYSICAL 6144
#define GETVFRAMELEN 6145
#define DBGDRIVERSTAT 6146
#define SETPOWERMANAGEMENT 6147
#define GETPOWERMANAGEMENT 6148
typedef enum _VIDEO_POWER_STATE {
VideoPowerOn = 1,
VideoPowerStandBy,
VideoPowerSuspend,
VideoPowerOff
} VIDEO_POWER_STATE, *PVIDEO_POWER_STATE;
typedef struct _VIDEO_POWER_MANAGEMENT {
ULONG Length;
ULONG DPMSVersion;
ULONG PowerState;
} VIDEO_POWER_MANAGEMENT, *PVIDEO_POWER_MANAGEMENT;
// LED handling functions
int GetLedCount()
{
NLED_COUNT_INFO nci;
int wCount = 0;
if(NLedGetDeviceInfo(NLED_COUNT_INFO_ID, (PVOID) &nci))
wCount = (int) nci.cLeds;
return wCount;
}
void SetLedStatus(int wLed, int wStatus)
{
NLED_SETTINGS_INFO nsi;
nsi.LedNum = (INT) wLed;
nsi.OffOnBlink = (INT) wStatus;
NLedSetDevice(NLED_SETTINGS_INFO_ID, &nsi);
}
int WINAPI WinMain ( HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPWSTR pszCommandLine, int nCommandShow)
{
HDC gdc;
int iESC=SETPOWERMANAGEMENT;
gdc = ::GetDC(NULL);
if (ExtEscape(gdc, QUERYESCSUPPORT, sizeof(int), (LPCSTR)&iESC, 0, NULL)==0)
MessageBox(NULL, L"Sorry, your Pocket PC does not support toggleDisplay",
L"Pocket PC toggleDisplay",
MB_OK);
else
{
VIDEO_POWER_MANAGEMENT vpm;
ExtEscape(gdc, GETPOWERMANAGEMENT, 0, 0, sizeof(vpm), (char *) &vpm);
if (vpm.PowerState == VideoPowerOff) {
vpm.Length = sizeof(VIDEO_POWER_MANAGEMENT);
vpm.DPMSVersion = 0x0001;
vpm.PowerState = VideoPowerOn;
ExtEscape(gdc, SETPOWERMANAGEMENT, vpm.Length, (LPCSTR) &vpm, 0, NULL);
if (GetLedCount()) {
SetLedStatus(0, 0);
}
} else {
vpm.Length = sizeof(VIDEO_POWER_MANAGEMENT);
vpm.DPMSVersion = 0x0001;
vpm.PowerState = VideoPowerOff;
ExtEscape(gdc, SETPOWERMANAGEMENT, vpm.Length, (LPCSTR) &vpm, 0, NULL);
if (GetLedCount()) {
SetLedStatus(0, 1);
}
}
::ReleaseDC(NULL, gdc);
}
return 0;
}
uff, binaries for arm, probably compiled with debug on
but who cares with such a BIG file
http://pgate.host.sk/toggleDisplay.exe [4kB]
pigeon said:
Is there a way to turn off, not the backlight, not the pda, but just the screen?
I came across some silly software named PocketLight or PocketTorch or so, just can't find it right now. It turns off the screen but the backlight stays on. This way you can use your PDA as a light source in case you lost something in the dark ....
Is that what you're looking for?
Martin
Click to expand...
Click to collapse
Click to expand...
Click to collapse
i have a free program for this but i dont know how to upload it
http://www.mywirelessoffice.com/xda/screenoff.zip
Thanks emilk
Adrian
emilk said:
uff, binaries for arm, probably compiled with debug on
but who cares with such a BIG file
http://pgate.host.sk/toggleDisplay.exe [4kB]
Click to expand...
Click to collapse
Cant link to that exe file, I get a "not authorised", error message.
I know, my webhosting is not perfect
SOLUTION: when I use rightclick and choose 'save target as..'
it goes through
if you are unsuccesful with linking, that was probably intention
of my provider
Just press and hold the power button, this allows Windows Media Player to still play my mp3's but turns off my screen to reserve power.
Simply as that.
Mike
MIke Gascoigne said:
Just press and hold the power button, this allows Windows Media Player to still play my mp3's but turns off my screen to reserve power.
Simply as that.
Mike
Click to expand...
Click to collapse
If I press and hold the power button, it turns off only the backlight, not the screen.
Sorry, just press the power button, this turns the screen off, DONT HOLD IT as I told you to do before.
Just press it!
Mike
That suspends the device. It doesn't just turn off the screen.
If I have Media Player turned on and I just tap the power it turns off the whole device (MP3 player too)

[APP] TF3D Music Sleep Timer

I was getting utterly annoyed by the fact that the TF3D music player had no sleep funtion (turn of the music after a set amount of time). After doing some searches I was unable to find anything that suits my needs (anything at all in fact).
Now I have been using an application that pauses my music when I press the headset button for 1 second. What that app in fact does is: run an executable that somehow pauses the TF3D music player.
So in combination with 3 lines of mortscript I had my sleep application. Just run it (you will need to have mortscript installed, http://www.sto-helit.de/index.php?module=page&entry=ms_overview&action=view) and enter the amount if time (in minutes) after which you wan't the music player to stop playing. I usually set this to 1 hour, put on my headphones and fall somewhere within that hour to sleep. The players turns off and I won't wake up at 3 'o clock in the morning when I would rather be sleeping because of some loud track that starts playing.
The sddialer.exe file (which pauses the player) was developed by DYNAMIC+ (http://forum.xda-developers.com/showthread.php?t=502881). If the original developer has any problems with me redistributing a piece of his work, contact me.
The mortscript file (for the interested ones)
Code:
t = Input("Minutes until sleep","TF3D Music Sleep",1);
Sleep(60000*t);
Run("SDDialer.exe");
That's all there is to it, the pausing is handled by the SDDialer.exe file. which I did NOT write myself. So in case you find any error related to SDDialer.exe, you should contact DYNAMIC+ (the original dev). Because the SDDialer.exe file was originally written to be used in conjuction with a headset, it only works when a headset is plugged in! (don't know how bluetooth headsets are handled though)
Cabbed using the wonderfully simple QuickCab!
After installation you will have a new shortcut in your startmenu, just tap it, enter the amount of minutes and lay back. This works when your device is in sleep-mode, as well as in normal active mode. One remark: the SDDialer.exe file in fact toggles the music playback, so when you don't play music, and you set the timer to for example 10 minutes, the music will start playing after 10 minutes. Could be useful for a countdowncounter with music or something
Test results are ALWAYS appreciated
ill post you the requested source....
Code:
#define AUDIO_MANAGER_COMMAND_PAUSE 0x3
HWND GetAudioManagerWindow( )
{
return FindWindow( TEXT("AUDIO_MANAGER_ENG"), NULL );
}
BOOL IsAudioManagerPlaying( )
{
BOOL bIsAudioManagerPlaying = FALSE;
HKEY hkAudioManagerInformation;
if ( ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Software\\HTC\\AudioManager_Eng\\information"), 0, 0, &hkAudioManagerInformation) )
{
DWORD dwType, dwStatus, dwCbStatus = sizeof(dwStatus);
if ( ERROR_SUCCESS == RegQueryValueEx(hkAudioManagerInformation, TEXT("status"), 0, &dwType, (LPBYTE)&dwStatus, &dwCbStatus) && dwType == REG_DWORD )
{
if ( dwStatus == 4 )
bIsAudioManagerPlaying = TRUE;
}
RegCloseKey( hkAudioManagerInformation );
}
return bIsAudioManagerPlaying;
}
LRESULT SendAudioManagerMessage( HWND hAudioManagerWnd, DWORD dwCommand )
{
return SendMessage( hAudioManagerWnd, WM_USER + 1, dwCommand, 0 );
}
Code:
if ( IsAudioManagerPlaying() )
{
HWND hAudioManagerWnd = GetAudioManagerWindow( );
if ( hAudioManagerWnd )
SendAudioManagerMessage( hAudioManagerWnd, AUDIO_MANAGER_COMMAND_PAUSE );
}
Is it possible to make this work with the speaker function? I quite like the speaker quality on my TP2.
Another feature I would love to see is the gradual decrease in volume. I have a sleep machine that slowly lowers the volume, so when the sound stops it isnt abrupt and possibly causing the person to wake.
Id be a willing beta tester...
sleep machine functionality for TF3D
Nice one, thank you!
I'd second the above suggestion for a gradual lowering of volume, it would be great to have some sort of sleep machine functionality.
Please not that I won't be adding any features/fix bugs on this 'application'. In fact: I don't even use TF3D anymore (Titanium + Nitrogen music player). But if it works for you, I always like to hear that.

[Q] Assistance with LMT ISAS setup on HTC EVO 4G LTE

I don't have sufficient posts to add a reply to the LMT Launcher thread since it's in the development section, so I'm posting here.
I'd really like to get ISAS working on the EVO 4g LTE, as it's a great feature. Here are my details:
Details
- State: rooted, s-off, TWRP 2.5 installed
- ROM: CM 10.2 nightly (2013-09-01)
- LMT v. 1.912 installed
LMT Settings
- Activate TouchService = on
- Autostart TouchService checked
- Set TouchService mode = Gestures, ISAS, and pie
- Set gesture input = 2 (see below)
- Relevant output of
Code:
getevent -p
Code:
add device 8: /dev/input/event2 # hence setting 2 in gesture input above
name "synaptics-rmi-touchscreen"
[...]
0035 : value 0, min 0, max 1100, fuzz 0, flat 0, resolution 0
0036 : value 0, min 0, max 1750, fuzz 0, flat 0, resolution 0
- Min bbox = 1
- Activation area thickness = 80
- According to the LMT thread, I should divide the max outputs above by my screen resolution (1280 x 720) to get the right x/y % settings for ISAS, which I've done:
--- Touchscreen to screen factor X = 1100 / 720 = 153%
--- Touchscreen to screen factor Y = 1750 / 1280 = 137%.
Lastly, I've set ISA 1 and ISA 2 (bottom left and bottom center) to open Apollo music player just to test things out. I can get it to work, but I have to hold the phone face up with one hand and violently flick the screen up from the bottom left with my index finger to get it to open. It is not a usable gesture in the least. Trying in vain with the speed I can produce with just my thumb while holding the phone produces no result.
Can someone chime in on any settings that might affect this?
Pie works properly, as do gestures (though if I have a gesture like two finger swipe to the left/right, it cycles my homescreen page at the same time as catching that I passed a gesture to LMT), so it would seem that the general configuration is sound. I just can't figure out why I need to swipe the ISA so darn fast. There's no way I could swipe that fast with my thumb; only holding in one hand and doing it at about 70% of my top possible speed gets the ISA to work.
Thanks for any input/suggestions! Feel free to ask for any other output.
jwhendy said:
I don't have sufficient posts to add a reply to the LMT Launcher thread since it's in the development section, so I'm posting here.
I'd really like to get ISAS working on the EVO 4g LTE, as it's a great feature. Here are my details:
Details
- State: rooted, s-off, TWRP 2.5 installed
- ROM: CM 10.2 nightly (2013-09-01)
- LMT v. 1.912 installed
LMT Settings
- Activate TouchService = on
- Autostart TouchService checked
- Set TouchService mode = Gestures, ISAS, and pie
- Set gesture input = 2 (see below)
- Relevant output of
Code:
getevent -p
Code:
add device 8: /dev/input/event2 # hence setting 2 in gesture input above
name "synaptics-rmi-touchscreen"
[...]
0035 : value 0, min 0, max 1100, fuzz 0, flat 0, resolution 0
0036 : value 0, min 0, max 1750, fuzz 0, flat 0, resolution 0
- Min bbox = 1
- Activation area thickness = 80
- According to the LMT thread, I should divide the max outputs above by my screen resolution (1280 x 720) to get the right x/y % settings for ISAS, which I've done:
--- Touchscreen to screen factor X = 1100 / 720 = 153%
--- Touchscreen to screen factor Y = 1750 / 1280 = 137%.
Lastly, I've set ISA 1 and ISA 2 (bottom left and bottom center) to open Apollo music player just to test things out. I can get it to work, but I have to hold the phone face up with one hand and violently flick the screen up from the bottom left with my index finger to get it to open. It is not a usable gesture in the least. Trying in vain with the speed I can produce with just my thumb while holding the phone produces no result.
Can someone chime in on any settings that might affect this?
Pie works properly, as do gestures (though if I have a gesture like two finger swipe to the left/right, it cycles my homescreen page at the same time as catching that I passed a gesture to LMT), so it would seem that the general configuration is sound. I just can't figure out why I need to swipe the ISA so darn fast. There's no way I could swipe that fast with my thumb; only holding in one hand and doing it at about 70% of my top possible speed gets the ISA to work.
Thanks for any input/suggestions! Feel free to ask for any other output.
Click to expand...
Click to collapse
Can you go into debug mode with 777 as described in the op? Then create a logcat containing starting the touchservice, doing some isas and stopping it again? Then just send me the log via pm and I can check what's wrong.
Btw: Min gesture score and min path length are also affecting isas. What did you configure for these?
Sent from my Nexus 4
@noname81: sorry, should have done the logcat from the beginning. I actually did look through it myself and couldn't figure out how to discern what LMT picked up from the unsuccessful ISA attempts. It seemed like it either worked (a line about a trigger event) or didn't.
In any case, yes, I should have just made one, and I'll send it along shortly.
With respect to any other settings, if they aren't mentioned, I left them alone. So min score was at 70% and min path was at 7. I changed the response to a debug overlay and anytime it activates, I've never seen a score of less than 95%. I did fiddle with making it something like 20% and setting the path at 2 to try and make it really easy to trigger; no luck.
I've now restored defaults, so my post is accurate for the logcat coming your way.
@noname81: links to logs sent (appears I can't attach files yet). Thanks for the assistance.

[ Need APP ] < Alarm app every 30 seconds

Hi all~!
I'm user of my Lumia 620 and I'm looking for free alarm app . The alarm must repeat every 30 seconds . Is there any app ? I need it , because I'm starting ABS for my chest
kukusiek97 said:
Hi all~!
I'm user of my Lumia 620 and I'm looking for free alarm app . The alarm must repeat every 30 seconds . Is there any app ? I need it , because I'm starting ABS for my chest
Click to expand...
Click to collapse
Hello,
What kind of sound would you like? Pick your own music? etc..
Sounds more like a repeative timer to me...this wouldn't even be that hard to make...
C#:
In App.xaml.cs input:
Code:
using System.Threading;
private static DispatcherTimer m_Timer;
private static bool RepeatTimer;
private static int m_Days, m_Hours, m_Minutes, m_Seconds;
public static void beginTiming(int Days, int Hours, int Minutes, int Seconds, bool Repeative)
{
RepeatTimer = Repeative; //Set repeat
m_Days = Days;
m_Hours = Hours;
m_Minutes = Minutes;
m_Seconds = Seconds;
m_Timer = new DispatcherTimer();
m_Timer.Tick += new EventHandler(m_Timer_Tick);
m_Timer.Interval = new TimeSpan(Days, Hours, Minutes, Seconds);
m_Timer.Start();
}
static void m_Timer_Tick(object sender, EventArgs e)
{
if (RepeatTimer == true)
beginTiming(m_Days, m_Hours, m_Minutes, m_Seconds);
//Play Sound Here (Max Limit 10 Seconds)
}
Then have a sound selector and button to begin timing the fields on the MainPage.xaml, if the user's phone turns off (due to WP8 lacking capability of real multitasking -- Thank you Microsoft!) use the background to set a timer to run every thirty seconds or disable screen powering off in the application.
That's basically how it can be created.
So, if anyone decides to do this really quick (5 minutes?) it's quite simple.
I'll give it a go if no one else completes this for you.
kuzcoed said:
Hello,
What kind of sound would you like? Pick your own music? etc..
Sounds more like a repeative timer to me...this wouldn't even be that hard to make...
C#:
In App.xaml.cs input:
Code:
using System.Threading;
private static DispatcherTimer m_Timer;
private static bool RepeatTimer;
private static int m_Days, m_Hours, m_Minutes, m_Seconds;
public static void beginTiming(int Days, int Hours, int Minutes, int Seconds, bool Repeative)
{
RepeatTimer = Repeative; //Set repeat
m_Days = Days;
m_Hours = Hours;
m_Minutes = Minutes;
m_Seconds = Seconds;
m_Timer = new DispatcherTimer();
m_Timer.Tick += new EventHandler(m_Timer_Tick);
m_Timer.Interval = new TimeSpan(Days, Hours, Minutes, Seconds);
m_Timer.Start();
}
static void m_Timer_Tick(object sender, EventArgs e)
{
if (RepeatTimer == true)
beginTiming(m_Days, m_Hours, m_Minutes, m_Seconds);
//Play Sound Here (Max Limit 10 Seconds)
}
Then have a sound selector and button to begin timing the fields on the MainPage.xaml, if the user's phone turns off (due to WP8 lacking capability of real multitasking -- Thank you Microsoft!) use the background to set a timer to run every thirty seconds or disable screen powering off in the application.
That's basically how it can be created.
So, if anyone decides to do this really quick (5 minutes?) it's quite simple.
I'll give it a go if no one else completes this for you.
Click to expand...
Click to collapse
For me something like this http://www.youtube.com/watch?v=uJ2SqGfURyY is enough . But could you give me more instructions ? I'm new user of my Lumia .
kukusiek97 said:
For me something like this http://www.youtube.com/watch?v=uJ2SqGfURyY is enough . But could you give me more instructions ? I'm new user of my Lumia .
Click to expand...
Click to collapse
Hi,
To play the sound you'll need some code that allows play music, in App.xaml.cs you can use multiple options, but, for what you're looking for I think this would work fine:
Code:
Stream musStr = TitleContainer.OpenStream("alarm.wav");
SoundEffect musEffect = SoundEffect.FromStream(musStr);
FrameworkDispatcher.Update();
musEffect.Play();
Put that code inside the "m_Timer_Tick" event or put another
Code:
private / public static void
in your code, then call it.
For example:
Code:
private static void playSound(string Sound)
{
Stream musStr = TitleContainer.OpenStream(Sound);
SoundEffect musEffect = SoundEffect.FromStream(musStr);
FrameworkDispatcher.Update();
musEffect.Play();
}
Call that with the m_Timer_Tick event using:
Code:
playSound(mysound.wav);
Requirements of doing this way is that:
1) Sample Rate must be between 8k Hz and 48k Hz
2) The audio file must be a PCM wave file
3) Can only be mono or stereo
4) Must be 8 or 16 bit

getRingerMode always returns 0???

Hello,
I would like to detect the ringer mode..so here is the code I am currently using.
Below is the code inside onCreate...
BroadcastReceiver receiver=new BroadcastReceiver(){
@override
public void onReceive(Context context, Intent intent) {
AudioManager am = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
Log.i("MyApp", String.valueOf(am.getRingerMode()));
}
};
IntentFilter filter=new IntentFilter(
AudioManager.RINGER_MODE_CHANGED_ACTION);
registerReceiver(receiver,filter);
1. When the app runs first time, it printed 0. (Even if my phone ringer mode was normal, it always prints 0 first time when my app runs)
2. I tried to change to vibrate mode...normal mode......however, it never printed. I think that onReceive is not getting called even if I changed the ringer mode to vibrate/normal...
Here is another testing...
I created a simple button..and when the button is clicked, I called getSystemService and getRingerMode to print the value...
I noticed it always prints 0, which is RINGER_MODE_SILENT... I changed my phone to vibrate mode..and it still prints 0....I changed my phone to normal mode..but it still prints 0...
BTW, SDK version is 28 (API 28: Android 9.0(Pie))...
Could this be a permission issue? I don't think I would need to add some permission in order to use RINGER_MODE_CHANGED_ACTION...
Any idea?
Any help much appreciated.
Thanks,

Categories

Resources