how can I get some informations in XMB
-
- Posts: 5
- Joined: Fri Sep 18, 2009 5:05 pm
how can I get some informations in XMB
NOW I'm going to make a prx which can show lyric when playing
But I cant't get the name of the playing music file or othes in XMB
for example,when you play a song ,the prx will get the music name and load the lrc on screen
Have any functions or projects which can get it?
THX
But I cant't get the name of the playing music file or othes in XMB
for example,when you play a song ,the prx will get the music name and load the lrc on screen
Have any functions or projects which can get it?
THX
Last edited by yucopowo2009 on Tue Sep 22, 2009 11:54 pm, edited 1 time in total.
-
- Posts: 5
- Joined: Fri Sep 18, 2009 5:05 pm
iceman755 wrote:I think you have to hook the sceIoOpen function and catch what file that function is trying to open, if it is an mp3 then you show the proper lyrics.
THX for you help
but you don't understand it's meaning
I want get the filename when I play mp3 or wma in XMB
Not in PBP
because I know play the mp3's name in howebrew,but not in XMB
In other words, How can I hook the lyric when i play some mp3 in XMB
And I tell you again, you must hook sceIoOpen function to do what you want to do.
Why??? because I'm sure that XMB music player use that function to open the music file to play it, then from that function you can get what file the XMB will try to open.
And why am I sure??? because in the time I'm writing this post, I'm seeing my PSP in front of me showing the name of the file that it is trying to open, I haven't tune it to show only mp3 or wma, so it shows the last file wich sceIoOpen was called with.
But everything is not as ease as it looks, there are technical issues that have to be solved, like breaking CFW patches.
Why??? because I'm sure that XMB music player use that function to open the music file to play it, then from that function you can get what file the XMB will try to open.
And why am I sure??? because in the time I'm writing this post, I'm seeing my PSP in front of me showing the name of the file that it is trying to open, I haven't tune it to show only mp3 or wma, so it shows the last file wich sceIoOpen was called with.
But everything is not as ease as it looks, there are technical issues that have to be solved, like breaking CFW patches.
"Libera eas de ore leonis, ne absorbeat eas tartarus, ne cadant in obscurum"
There will be 100s of calls to sceIoOpen since the XMB reads ahead the next song and even more when you're scrolling.
Best way is to directly hook the internal functions of the vsh to see the title of the song being played or the filename. You'd best ask Davee or BubbleTune as they are the most experienced with these internal functions.
Best way is to directly hook the internal functions of the vsh to see the title of the song being played or the filename. You'd best ask Davee or BubbleTune as they are the most experienced with these internal functions.
you will need to hook sceIoOpen and look for the mp3 file since, the mp3's are buffered to ram then fed to the Media Engine, so it will be opened via sceIoOpen, after that it is simple, the best way to write text to the XMB, is to catch the on and offscreen buffers, and then just write per pixel what you want. (look in the sdk at the pspDebugScreenPrint, it does exactly this).
the m33 sdk provides simplistic ways to find and patch system functions. However be careful not to hook it too soon or you will loose the m33 patched sceIoOpen and then you will break peoples custom firmware until a cold boot.
the m33 sdk provides simplistic ways to find and patch system functions. However be careful not to hook it too soon or you will loose the m33 patched sceIoOpen and then you will break peoples custom firmware until a cold boot.
Code: Select all
.øOº'ºOø.
'ºOo.oOº'
How would he know which is the currently playing song? There will be many calls to the function even while a song is playing. How will he know when the song has changed and which is the new song among the multiple calls.a_noob wrote:you will need to hook sceIoOpen and look for the mp3 file since, the mp3's are buffered to ram then fed to the Media Engine, so it will be opened via sceIoOpen, after that it is simple
sceIoOpen will not be called a lot, it should only be called once... read will be called a lot yes, but why would open be called a lot? Should only have one call to get a file handle. Then every time a new mp3 is played it will call sceIoClose and Open to obtain a new handle, then you have a new song.
Code: Select all
.øOº'ºOø.
'ºOo.oOº'
I have been doing some proofs with this and tune it to show only mp3 or wma, hooking sceIoOpen actually shows currently playing song and I didn't see further calls (to music files) while playing, but while accessing (listing the songs) the ms, under the music icon, all (or almost all) music files are called with sceIoOpen which may make dificult to know when the music files are called for playing or listing.
@Torch: do you know if somebody has worked on the functions from music_player.prx??? are those function what you talked about asking Davee or BubbleTune???
OFF-TOPIC (excuse me please):
@a_noob: Are you and A_nub (from psp-programming forums) the same person???
If yes, way back in this topic http://www.psp-programming.com/forums/i ... pic=2624.0 you post an example about GU over XMB, but links are dead, did you move it to another web or do you still have it???
@Torch: do you know if somebody has worked on the functions from music_player.prx??? are those function what you talked about asking Davee or BubbleTune???
OFF-TOPIC (excuse me please):
@a_noob: Are you and A_nub (from psp-programming forums) the same person???
If yes, way back in this topic http://www.psp-programming.com/forums/i ... pic=2624.0 you post an example about GU over XMB, but links are dead, did you move it to another web or do you still have it???
"Libera eas de ore leonis, ne absorbeat eas tartarus, ne cadant in obscurum"
@a_noob: why don't you read answers before posting?
a_noob wrote:sceIoOpen will not be called a lot, it should only be called once...
Torch wrote:since the XMB reads ahead the next song and even more when you're scrolling.
The Incredible Bill Gates wrote:The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
sorry m0skit0 I read it fast and seemed to have missed his point. @ iceman755 yeah I am A_Nub, I have some vsh gu stuff yeah. I plan to make a small little lib soon. That uses proper techniques, such as hooking into the vsh gu calls rather than bruteforcing my display lists into the GE cue. music_player.prx I could take a quick look into that I suppose. But there is another way. Log all the sceIoOpen handles, and the files they are linked to then when read is being called constantly to say an mp3 file, then you know its playing ;)
Code: Select all
.øOº'ºOø.
'ºOo.oOº'
If you instead hook the IMPORTS in music_player.prx from IoFileManagerForUser you should be able to narrow down the sceIo* calls to just the current song and the read ahead one.
Last edited by Torch on Thu Oct 01, 2009 6:03 pm, edited 1 time in total.
Excuse me that I ask but, hooking the IMPORTS takes the same aproach as hooking the original function???
I'm doing it like this, this is the line where I hook the original function:
and I changed it for this:
But it doesn't catch the files that are being open by the music player, well I catch nothing.
P.D.: I know that I didn't start this post, but it is rather interesting for me xDDD
I'm doing it like this, this is the line where I hook the original function:
Code: Select all
orgaddr = sctrlHENFindFunction("sceIOFileManager", "IoFileMgrForUser", 0x109F50BC);
Code: Select all
orgaddr = sctrlHENFindFunction("music_player_module", "IoFileMgrForUser", 0x109F50BC);
P.D.: I know that I didn't start this post, but it is rather interesting for me xDDD
"Libera eas de ore leonis, ne absorbeat eas tartarus, ne cadant in obscurum"
hooking the imports would be different, it would be over writing the module code in memory.
so basically an import looks like this
so hooking would be something like
actually umm that hooking is quite wrong. Seems the psp has different values for the op codes than my current MIPS documentation. Ill need to get back to this.
so basically an import looks like this
Code: Select all
; ======================================================
; Subroutine sceKernelStartThread - Address 0x0003437C
; Imported from ThreadManForUser
sceKernelStartThread: ; Refs: 0x00011130
0x0003437C: 0x03E00008 '....' - jr $ra
0x00034380: 0x00000000 '....' - nop
so hooking would be something like
Code: Select all
int startThreadOffset = 0x0003437C;
int *startThreadImport = myModuleTxtAddress + startThreadOffset;
*startThreadImport = (0x8 << 27) | (myfunc & ~(0x1F << 27));//patch call
int startThreadOriginal = myModuleTxtAddress + startThreadOffset;
Code: Select all
.øOº'ºOø.
'ºOo.oOº'
I can help you with hooking imports, I've done it for my eloader.
Let's suppose you wanna hook the import for sceIoOpen. Write a function like this one:
Then just make a plain jump (not a call!) to your function with this macro:
Then overwrite the jr $ra (0x03E00008) instruction for the sceIoOpen entry in the import table of the module you wanna hook (you must know the address of this one, of course) with the resulting jump instruction to your function.
Works like a charm ;)
@a_noob: PSP has standard MIPS opcodes, except for a very few instructions that are not standard.
EDIT: of course, this only works if both the module to hook and your own function are in userspace. You can't do a direct jump from userspace to kernelspace.
Let's suppose you wanna hook the import for sceIoOpen. Write a function like this one:
Code: Select all
SceUID my_sceIoOpen (const char *file, int flags, SceMode mode)
{
/* Your code for replacing sceIoOpen here */
}
Code: Select all
#define MAKE_JUMP(f) (0x08000000 | (((u32)(f) >> 2) & 0x03ffffff))
/*Example using the above macro*/
u32 jump_my_sceIoOpen;
jump_my_sceIoOpen = MAKE_JUMP(my_sceIoOpen);
Works like a charm ;)
@a_noob: PSP has standard MIPS opcodes, except for a very few instructions that are not standard.
EDIT: of course, this only works if both the module to hook and your own function are in userspace. You can't do a direct jump from userspace to kernelspace.
The Incredible Bill Gates wrote:The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.