Related
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)
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.
As a lot of other persons I have the "screen lag" issue. After reading several posts I have found a way to fix it : I've just removed the back cover and I check the battery position, then I put back the back cover.
Now the big lag disappeared.....
No need to add a paper between the battery and the back cover in my case.
I hope it will help others.
Well, another thing that worked for me was tighten all screws a tiny bit.
Worked like charm ^^
I opened d battery twice since i bought my folio. Lagging issue oni several times for me. Is it really should do this i don know.
Should give a try bcoz it is no need to pay for opening d battery
I still believe that must of the lag is caused by bad software, though i also notice that screen is kind of lose.
bastospn said:
I still believe that must of the lag is caused by bad software
Click to expand...
Click to collapse
i do believe too, no prove but have the feeling that some app crashed behind the screen and make the folio lag or freezed.
somebody can confirm that?
waii69 said:
i do believe too, no prove but have the feeling that some app crashed behind the screen and make the folio lag or freezed.
somebody can confirm that?
Click to expand...
Click to collapse
using dev tools, u can monitor the cpu usage values. if it get above 2.0( except for the first 2/3 minutes when booting and when connecting to wifi), then some app is causing it to lag. if values are still below that number for a long time and still there is screen lag issue, then its definitely a hardware issue.
use an app called aLogCat to see what's happening during an error. Pretty handy errorlog tool
thanks guys, i will try and see what is happen.
This is what i get when i clear the log, then shut the screen and wait till it pops open.
Code:
D/WindowManager( 1081): I'm tired mEndcallBehavior=0x2
I/power ( 1081): *** set_screen_state 0
E/Sensors ( 1081): mask[0x0]
D/RemoteCtrlManager( 1081): ACTION_SCREEN_OFF
D/UpdateReceiver:( 1081): HDMI_UNPLUG
D/UpdateReceiver:( 1081): false
D/RemoteCtrlManager( 1081): initHDMIfalse
V/alogcat (12698): save instance
V/alogcat (12698): paused
D/JuicePlotter.CollectService( 1583): battery:81, plugged:1, screen:0, wifi:false,apn:false,bluetooth:false
D/ ( 976): NVRM_DAEMON(985): pm_notifier_thread: calling power_displays(false)
D/ ( 976): NVRM_DAEMON(988): pm_notifier_thread: returned from power_displays(false)
D/JuicePlotter.CollectService( 1583): battery:81, plugged:1, screen:0, wifi:false,apn:false,bluetooth:false
D/JuicePlotter.CollectService( 1583): battery:81, plugged:1, screen:0, wifi:false,apn:false,bluetooth:false
D/dalvikvm( 1178): GC_EXPLICIT freed 546 objects / 124312 bytes in 74ms
I/AKMD2 ( 930): akmd2 : Compass Closed.
D/dalvikvm( 5555): GC_EXPLICIT freed 2696 objects / 169120 bytes in 70ms
D/dalvikvm( 5835): GC_EXPLICIT freed 3104 objects / 113848 bytes in 93ms
D/ ( 976): NVRM_DAEMON(974): pm_notifier_thread: calling power NvddkAudioFxSuspend(true)
I/AKMD2 ( 930): akmd2 : Suspended.
W/EventHub( 1081): could not get event (errno=19)
I/EventHub( 1081): Removed device: path=/dev/input/event8 name=USB2.0 UVC 1.3M WebCam id=0x380008 (of 0x9) index=10 fd=328 classes=0x1
D/org.jraf.android.nolock.NoLockService( 1479): onStartCommand
D/org.jraf.android.nolock.NoLockService( 1479): handleStart locking=false (nolock ENABLED)
D/org.jraf.android.nolock.NoLockService( 1479): handleStart mKeyguardLock != null: reenabling keyguard
I/power ( 1081): *** set_screen_state 1
D/ ( 976): NVRM_DAEMON(980): pm_notifier_thread: calling power NvddkAudioFxSuspend(false)
D/ ( 976): NVRM_DAEMON(991): pm_notifier_thread: calling power_displays(true)
W/ResourceType( 1081): Invalid package identifier when getting bag for resource number 0x00000000
D/GoogleLoginService( 1178): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService }
E/Sensors ( 1081): mask[0x0]
D/RemoteCtrlManager( 1081): ACTION_SCREEN_ON
D/UpdateReceiver:( 1081): HDMI_UNPLUG
D/UpdateReceiver:( 1081): false
D/RemoteCtrlManager( 1081): initHDMIfalse
V/alogcat (12698): resumed
D/ ( 976): NVRM_DAEMON(994): pm_notifier_thread: returned from power_displays(true)
Some unrelated stuff there too like juice plotter and no lock...sorry.
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
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,