| View previous topic :: View next topic |
| Author |
Message |
Zettablade
Joined: 05 May 2006 Posts: 71
|
Posted: Mon Jul 10, 2006 12:24 pm Post subject: Getting volume |
|
|
| what's the code snippet for getting the volume? |
|
| Back to top |
|
 |
sg57
Joined: 14 Oct 2005 Posts: 154
|
Posted: Mon Jul 10, 2006 2:26 pm Post subject: |
|
|
volume of?
a cup.
a sphere.
a cube.
basics for volume |
|
| Back to top |
|
 |
Zettablade
Joined: 05 May 2006 Posts: 71
|
Posted: Mon Jul 10, 2006 2:50 pm Post subject: |
|
|
| the psp's speaker. is it even possible? |
|
| Back to top |
|
 |
Drakonite Site Admin

Joined: 17 Jan 2004 Posts: 989
|
Posted: Mon Jul 10, 2006 3:06 pm Post subject: |
|
|
IMO you should think of it like the volume of a TV -- you shouldn't really care if it's at 50% or 100%... the user is kinda responsible for putting it where they want it, and you shouldn't go screwing with their volume level.
That being said, if there was really a use for it, I'm sure there is some way of doing it.. _________________ Shoot Pixels Not People!
Makeshift Development |
|
| Back to top |
|
 |
sg57
Joined: 14 Oct 2005 Posts: 154
|
Posted: Mon Jul 10, 2006 4:47 pm Post subject: |
|
|
There is. Look at IrShell.
Check out the Doxygen on the sceAudio junk.
Its probably
sceAudioSetChnlAudiolLevel(int channel#, int vol)
Im guessing what to look for, but im positive ive seen it somewhere. |
|
| Back to top |
|
 |
Fanjita
Joined: 28 Sep 2005 Posts: 217
|
Posted: Mon Jul 10, 2006 9:23 pm Post subject: |
|
|
I seem to recall this being discussed before, and the basic conclusion being that there doesn't seem to be an API call that can retrieve the volume setting, but that if you happen to be running in kernel mode, you could monitor the Vol+ / Vol- buttons to at least receive notifications of changes.
Of course the kernel does seem to track volume settings, as it displays the volume when pressing those buttons - so maybe if you poked around in sceImpose you might find something. _________________ Got a v2.0-v2.80 firmware PSP? Download the eLoader here to run homebrew on it!
The PSP Homebrew Database needs you! |
|
| Back to top |
|
 |
Zettablade
Joined: 05 May 2006 Posts: 71
|
Posted: Mon Jul 10, 2006 10:49 pm Post subject: |
|
|
| Fanjita wrote: | I seem to recall this being discussed before, and the basic conclusion being that there doesn't seem to be an API call that can retrieve the volume setting, but that if you happen to be running in kernel mode, you could monitor the Vol+ / Vol- buttons to at least receive notifications of changes.
Of course the kernel does seem to track volume settings, as it displays the volume when pressing those buttons - so maybe if you poked around in sceImpose you might find something. |
That's all I'm really gonna do. I just wanna display the volume level. I don't wanna mess around with it. I'll look for it, but not right now, since I have to go somewhere. I'll post back if I find anything.
Wait, where is the sceImpose? |
|
| Back to top |
|
 |
MIB.42
Joined: 03 Nov 2006 Posts: 5
|
Posted: Fri Nov 03, 2006 5:35 pm Post subject: |
|
|
[quote="Zettablade"][quote="Fanjita"]I seem to recall this being discussed before, and the basic conclusion being that there doesn't seem to be an API call that can retrieve the volume setting, but that if you happen to be running in kernel mode, you could monitor the Vol+ / Vol- buttons to at least receive notifications of changes.
Of course the kernel does seem to track volume settings, as it displays the volume when pressing those buttons - so maybe if you poked around in sceImpose you might find something.[/quote]
That's all I'm really gonna do. I just wanna display the volume level. I don't wanna mess around with it. I'll look for it, but not right now, since I have to go somewhere. I'll post back if I find anything.
Wait, where is the sceImpose?[/quote]
The following seems to work only at launch time. Any idea on how to "re-read" it? If I read it again while running, it will stay the same even when the volume was changed...
#define SNDCNF "/CONFIG/SYSTEM/SOUND"
#define MANVLM "main_volume"
void GetVolume(void)
{
int ret=0;
struct RegParam reg;
REGHANDLE h;
memset(®, 0, sizeof(reg));
reg.unk1 = 1;
reg.namelen = strlen("/system");
reg.unk2 = 1;
reg.unk3 = 1;
strcpy(reg.name, "/system");
if(sceRegOpenRegistry(®, 2, &h) == 0)
{
REGHANDLE hd;
if(!sceRegOpenDir(h, SNDCNF, 2, &hd))
{
REGHANDLE hk;
unsigned int type, size;
if(!sceRegGetKeyInfo(hd, MANVLM, &hk, &type, &size))
{
if(!sceRegGetKeyValue(hd, hk, &MainVolume, 4))
{
sceRegFlushDir(hd);
}
}
}
sceRegCloseDir(hd);
sceRegFlushRegistry(h);
sceRegCloseRegistry(h);
}
} |
|
| Back to top |
|
 |
hlide
Joined: 10 Sep 2006 Posts: 750
|
Posted: Fri Nov 03, 2006 7:49 pm Post subject: |
|
|
| huh... this isn't because you change your volume that it would also change your register value. I would expect for it to do so at crucial moment (exiting an application for instance). It would be crazy to change this register value whenever you modify your volume as I suppose it touches flash0/1 which are very slow devices. |
|
| Back to top |
|
 |
MIB.42
Joined: 03 Nov 2006 Posts: 5
|
Posted: Sat Nov 04, 2006 4:17 am Post subject: |
|
|
[quote="hlide"]huh... this isn't because you change your volume that it would also change your register value. I would expect for it to do so at crucial moment (exiting an application for instance). It would be crazy to change this register value whenever you modify your volume as I suppose it touches flash0/1 which are very slow devices.[/quote]
Indeed. Do you happen to know the solution? |
|
| Back to top |
|
 |
hlide
Joined: 10 Sep 2006 Posts: 750
|
Posted: Sat Nov 04, 2006 6:52 am Post subject: |
|
|
| MIB.42 wrote: | | hlide wrote: | | huh... this isn't because you change your volume that it would also change your register value. I would expect for it to do so at crucial moment (exiting an application for instance). It would be crazy to change this register value whenever you modify your volume as I suppose it touches flash0/1 which are very slow devices. |
Indeed. Do you happen to know the solution? |
the solution may be somewhere in the undocumented functions of sceImpose : http://moonlight.lan.st/1.50/kd/impose.html
sceImposeChanges() ?
Or maybe there is a special kernel thread for volume as there is one for exit thread (by means of callback). |
|
| Back to top |
|
 |
MIB.42
Joined: 03 Nov 2006 Posts: 5
|
Posted: Sun Nov 05, 2006 3:32 am Post subject: |
|
|
[quote="hlide"]
the solution may be somewhere in the undocumented functions of sceImpose : [url]http://moonlight.lan.st/1.50/kd/impose.html[/url]
sceImposeChanges() ?
Or maybe there is a special kernel thread for volume as there is one for exit thread (by means of callback).[/quote]
There definitely is a kernel thread for the remote ( 'SceHpRemote' with 0x6F priority ), the rest is power,battery,umd,wlan only.
About ImposeChanges, yes, ImposeGetParam and GetStatus sounds promising, do you know if anybody has some experience with these or has deciphered the call structs? |
|
| Back to top |
|
 |
|