| View previous topic :: View next topic |
| Author |
Message |
Raphael

Joined: 17 Jan 2006 Posts: 646 Location: Germany
|
Posted: Tue Jan 24, 2006 10:43 pm Post subject: GetVolume function? |
|
|
Hello there,
I searched for a function to get the currently set volume level on psp with the +/- buttons, but couldn't find anything like that in the sdk. Maybe I have overseen it, or maybe this function just hasn't been found yet.
Would be happy if anyone here could tell me the answer.
EDIT:
And another question regarding the sceKernelLibcGettimeofday function.
What is the int it returns? And why doesn't my code return the correct timezone settings?
| Code: |
struct timeval t;
struct timezone tz;
sceKernelLibcGettimeofday(&t, &tz);
|
After this, tz.tz_minuteswest and tz.tz_dsttime are both 0? If I set GMT+1 in PSP Settings, shouldn't minuteswest be 60 (or -60?)?
Thanks a lot :) |
|
| Back to top |
|
 |
sandberg
Joined: 05 Oct 2005 Posts: 90 Location: Denmark
|
Posted: Thu Jan 26, 2006 5:50 am Post subject: Re: GetVolume function? |
|
|
| Raphael wrote: | Hello there,
I searched for a function to get the currently set volume level on psp with the +/- buttons, but couldn't find anything like that in the sdk. Maybe I have overseen it, or maybe this function just hasn't been found yet.
Would be happy if anyone here could tell me the answer.
|
Sadly, there isn't such function. See my earlier post.
http://forums.ps2dev.org/viewtopic.php?t=4394&highlight=
I've found a way how to do it, but I have some questions about that, which I haven't got any answer to, so I haven't tried it yet.
http://forums.ps2dev.org/viewtopic.php?t=4645&highlight= _________________ Br, Sandberg |
|
| Back to top |
|
 |
Shazz

Joined: 31 Aug 2004 Posts: 244 Location: Somewhere over the rainbow
|
Posted: Sat Jan 28, 2006 5:33 am Post subject: |
|
|
Look in pspaudiolib
| Code: | static psp_audio_channelinfo AudioStatus[PSP_NUM_AUDIO_CHANNELS];
typedef struct {
int threadhandle;
int handle;
int volumeleft;
int volumeright;
pspAudioCallback_t callback;
void *pdata;
} psp_audio_channelinfo; |
At least if your app is using pspaudiolib _________________ - TiTAN Art Division -
http://www.titandemo.org |
|
| Back to top |
|
 |
sandberg
Joined: 05 Oct 2005 Posts: 90 Location: Denmark
|
Posted: Sat Jan 28, 2006 6:17 am Post subject: |
|
|
| Shazz wrote: | Look in pspaudiolib
| Code: | static psp_audio_channelinfo AudioStatus[PSP_NUM_AUDIO_CHANNELS];
typedef struct {
int threadhandle;
int handle;
int volumeleft;
int volumeright;
pspAudioCallback_t callback;
void *pdata;
} psp_audio_channelinfo; |
At least if your app is using pspaudiolib |
Thanks, but that doesn't work. pspaudiolib only reports back what you have set with the pspAudioSetVolume function, as it can be seen from the code below. It cannot report the global volume, since there is no API to get this value.
| Code: |
void pspAudioSetVolume(int channel, int left, int right)
{
AudioStatus[channel].volumeright = right;
AudioStatus[channel].volumeleft = left;
}
|
_________________ Br, Sandberg |
|
| Back to top |
|
 |
Shazz

Joined: 31 Aug 2004 Posts: 244 Location: Somewhere over the rainbow
|
Posted: Sun Jan 29, 2006 1:33 am Post subject: |
|
|
I agree :D That was why I mentioned "At least if your app is using pspaudiolib" as at init, the volume is init'd to the max. So that's a little virtual :D but enough ?
Else.. you can use
| Code: | | int sceAudioChangeChannelVolume(int channel, int leftvol, int rightvol); |
Set it then you know the value and you can handle it. Not really different but.... _________________ - TiTAN Art Division -
http://www.titandemo.org |
|
| Back to top |
|
 |
sandberg
Joined: 05 Oct 2005 Posts: 90 Location: Denmark
|
Posted: Sun Jan 29, 2006 2:59 am Post subject: |
|
|
| Shazz wrote: | I agree :D That was why I mentioned "At least if your app is using pspaudiolib" as at init, the volume is init'd to the max. So that's a little virtual :D but enough ?
Else.. you can use
| Code: | | int sceAudioChangeChannelVolume(int channel, int leftvol, int rightvol); |
Set it then you know the value and you can handle it. Not really different but.... |
Thanks again, but that won't work either :) You still wouldn't know the volume level. You can set it to some initial level, but when the user presses the + or - volume button or uses the head remote, you have no clue what the volume is anymore. _________________ Br, Sandberg |
|
| Back to top |
|
 |
Shazz

Joined: 31 Aug 2004 Posts: 244 Location: Somewhere over the rainbow
|
Posted: Sun Jan 29, 2006 6:56 am Post subject: |
|
|
Ok I did not catch the goal was to get the volume set by the +/- buttons...
It seems (or I'm wrong) that there is physical volume (speakers) and logical volume (audio).... I did not try to catch +/- pad events to modifiy the "soft" volume instead...should be feasible, not ? Else.... dunno :D _________________ - TiTAN Art Division -
http://www.titandemo.org
Last edited by Shazz on Mon Jan 30, 2006 4:34 am; edited 1 time in total |
|
| Back to top |
|
 |
sandberg
Joined: 05 Oct 2005 Posts: 90 Location: Denmark
|
Posted: Sun Jan 29, 2006 6:23 pm Post subject: |
|
|
It'll all the same volume. You just don't have normal access to read the volume set by the system.
I've also tried to figure out how to notify presses on + and -, but that doesn't seem possible either. So it seems like I'm stuck here :) _________________ Br, Sandberg |
|
| Back to top |
|
 |
Shazz

Joined: 31 Aug 2004 Posts: 244 Location: Somewhere over the rainbow
|
Posted: Mon Jan 30, 2006 4:34 am Post subject: |
|
|
Even in kernel mode ? _________________ - TiTAN Art Division -
http://www.titandemo.org |
|
| Back to top |
|
 |
sandberg
Joined: 05 Oct 2005 Posts: 90 Location: Denmark
|
Posted: Mon Jan 30, 2006 5:03 am Post subject: |
|
|
Yep. At least no values are defined for those buttons, and nothing seems to change in the latch registers, even in kernel mode. _________________ Br, Sandberg |
|
| Back to top |
|
 |
Shazz

Joined: 31 Aug 2004 Posts: 244 Location: Somewhere over the rainbow
|
Posted: Sat Feb 04, 2006 4:18 am Post subject: |
|
|
That's weird... what makes you think that the voume controlled by those two ghost buttons and the volume controlled by soft are the same (and not as I was wondering speaker vs chip volumes) ?
That's so strange how they seem both decoupled...
Do we have some hardware audio registers ? Time to look at groepaz's doc ;D
And mybe try to look what we have there :
| Code: | -------------------------------------------------------------
-------------------------------------------------------------
- audio.prx
-------------------------------------------------------------
-------------------------------------------------------------
0xbe000000
0xbe000004
0xbe000008
0xbe00000c
0xbe000010
0xbe000014
0xbe000018
0xbe00001c
0xbe000020
0xbe000024
0xbe000028
0xbe00002c
0xbe000038
0xbe00003c
0xbe000040
0xbe000044
0xbe000050
0xbe000060
0xbe000070
0xbe000080 |
And if the PSP audio chip is similar to the WM8750L, we should find the volume ;-)
Note : I hope this doc is public, found on Groepaz's website. Else I'll get it out.
It could be interesting to monitor those registers (at least memory blocks) to see if something move while pushing the buttons... I'll test if I'll find some time. _________________ - TiTAN Art Division -
http://www.titandemo.org |
|
| Back to top |
|
 |
Fanjita
Joined: 28 Sep 2005 Posts: 217
|
Posted: Sun Feb 05, 2006 10:08 am Post subject: |
|
|
BTW, you should be able to read the volume buttons.
In VSH mode, you can use vshCtrlReadBufferPositive to read the buttons, and the following values register for Vol+ and Vol- :
00200000 : vol -
00100000 : vol +
As far as I know, sceCtrlReadBufferPositive, and similar functions, should read the same values in kernel mode, but I haven't tested it. _________________ 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 |
|
 |
weltall
Joined: 20 Feb 2004 Posts: 310
|
Posted: Sun Feb 05, 2006 4:45 pm Post subject: |
|
|
| but in this way you don't know what was the starting volume you know only that it's more or less than before... or am i wrong? |
|
| Back to top |
|
 |
|