ATRAC3 Player Sample
ATRAC3 Player Sample
This is a sample showing a simple atrac3 player using the libatrac3plus from the firmware.
Warning (to avoid confussion): the use of the libatrac3plus library functions was deduced with a bit of reverse engeneering in the own library and how a game was using it, by hooking calls to the functions and inspecting how the parameters evolved (psplink was of great help, thanks Tyranid for making that beautiful tool)
This program does not pretend to be a serious player, it's only a sample on how to use the sceATRAC3plus_Library, and it may have some bugs or incorrect code.
Third version changes:
- use of sceAtracGetMaxSample to find the appropiated channel size.
http://www.megaupload.com/?d=87UL06DC
Second version changes:
- the bug of the threads not created is gone
- recompiled making use of pspatrac3.h/libpspatrac3 included by Tyranid in the PSPSDK this week.
- faster search of files by filtering extensions (it will search only at3, pbp, toc, a3p and wav)
http://rapidshare.de/files/18713456/AT3 ... 2.zip.html
First Version:
http://rapidshare.de/files/18292583/at3player.zip.html
Warning (to avoid confussion): the use of the libatrac3plus library functions was deduced with a bit of reverse engeneering in the own library and how a game was using it, by hooking calls to the functions and inspecting how the parameters evolved (psplink was of great help, thanks Tyranid for making that beautiful tool)
This program does not pretend to be a serious player, it's only a sample on how to use the sceATRAC3plus_Library, and it may have some bugs or incorrect code.
Third version changes:
- use of sceAtracGetMaxSample to find the appropiated channel size.
http://www.megaupload.com/?d=87UL06DC
Second version changes:
- the bug of the threads not created is gone
- recompiled making use of pspatrac3.h/libpspatrac3 included by Tyranid in the PSPSDK this week.
- faster search of files by filtering extensions (it will search only at3, pbp, toc, a3p and wav)
http://rapidshare.de/files/18713456/AT3 ... 2.zip.html
First Version:
http://rapidshare.de/files/18292583/at3player.zip.html
Last edited by moonlight on Mon May 01, 2006 8:08 pm, edited 7 times in total.
Ive put the atrac3 stubs into pspsdk and shameless c&p the function prototypes from moonlights sample. However as these are user mode functions they are close to useless for normal elfs :) So youll either have to do the function fixup trick as shown in the sample or preload the atrac library before your user mode application :)
-
- Posts: 2
- Joined: Wed Apr 19, 2006 10:20 am
It's a great reverse engeneering job you've done here moonlight, Although it would be more interesting to reverse engeneer the way the psp play AVC files (while playing a pmf or a mps (UMD Video) ) as the psp uses AVC hardware decoding so it can play smoothly any avc file at 222mhz and probably in user mode.
Then we could play avc videos at 480x272 witch would be great considering that avc is a great video format.
Then we could play avc videos at 480x272 witch would be great considering that avc is a great video format.
In fact i was thinking of taking a look on how the firmware decodes the MP4 files (using the sceMpeg i suppose), and see if somekind of patch could be done to play 480x272 MP4 through the firmware.Mathieulh wrote:It's a great reverse engeneering job you've done here moonlight, Although it would be more interesting to reverse engeneer the way the psp play AVC files (while playing a pmf or a mps (UMD Video) ) as the psp uses AVC hardware decoding so it can play smoothly any avc file at 222mhz and probably in user mode.
Then we could play avc videos at 480x272 witch would be great considering that avc is a great video format.
But this will be probably harder this time, we don't have all the NIDS :(
http://pspdev.ofcode.com/api2.0/index.php?type=2&id=76
But well, i suppose that one does loose nothing for trying ;)
Well the problem is that 1.50 fw can only natively play MP4 SP files and the mpeg4 SP codec sucks, the highest quality file encoded with the SP format at 480x272 takes a LOT of space (about 200MB for 30 minutes of playback) while avc videos would be even lighter than pmp files (xvid/divx muxed with mp3 track) and would take much less ressources considering the fact that the psp features avc h.264 hardware decoding, in fact the avc codec allready exists in 1.00/1.50 and is beeing used while playing pmfs or UMD Video, it's only because sony wanted to promote the umd videos that they didn't input the avc playback feature from memory stick directly in the firmware (they finally did with 2.00 because they wanted people to update their psp systems)
i'm just wondering how it's possible to encode your own at3 files.
i tried that horrible sonic stage software from sony. you can convert your files to atrac3/atrac3plus with .oma ending. (maybe another container? i've got no idea).
but doesn't seem like those files are recognized as atrac3 files.
anyone managed to convert and play some files?
edit:
just used this tool and it works great. thx jouni ;)
i tried that horrible sonic stage software from sony. you can convert your files to atrac3/atrac3plus with .oma ending. (maybe another container? i've got no idea).
but doesn't seem like those files are recognized as atrac3 files.
anyone managed to convert and play some files?
edit:
just used this tool and it works great. thx jouni ;)
Re: ATRAC3 Player Sample
seems like you have to delete the threads after they've finished (although you explicitly wait for end):moonlight wrote: - There is a bug in which sometimes one of the threads cannot be created because the previous copy of the thread is already running (probably, because of a deadlock).
Code: Select all
sceKernelWaitThreadEnd(playth, NULL);
sceKernelWaitThreadEnd(decodeth, NULL);
+sceKernelDeleteThread(playth);
+sceKernelDeleteThread(decodeth);
Re: ATRAC3 Player Sample
Thanks for pointing that out! Probably i'll rewrite it tomorrow or the next day fixing that and using the new pspatrac3.h header that Tyranid has added to the pspsdk.weak wrote:seems like you have to delete the threads after they've finished (although you explicitly wait for end):moonlight wrote: - There is a bug in which sometimes one of the threads cannot be created because the previous copy of the thread is already running (probably, because of a deadlock).
fixes it for meCode: Select all
sceKernelWaitThreadEnd(playth, NULL); sceKernelWaitThreadEnd(decodeth, NULL); +sceKernelDeleteThread(playth); +sceKernelDeleteThread(decodeth);
-
- Posts: 2
- Joined: Wed Apr 19, 2006 10:20 am
Maybe you put some *.oma files that can't be read by the PSP. You need to use EAC PSP Edition to make your atrac3 files for the PSP.w0lv3121n3 wrote:how come it doesnt detect the atrac files i put in my psp?
There are only 10 types of people in the world: Those who understand binary, and those who don't !
So fast ! Thanks for your work.moonlight wrote:Ok, now it's fixed and updated the link. I didn't know that extension.majinboo wrote:It seems that the new version doesn't detect .toc fils. These files are Atrac3 files created with EAC PSP Edition. The first version is able to play these files without any problems.
There are only 10 types of people in the world: Those who understand binary, and those who don't !
Problem loading a3p files from UMD
In second version I've noticed that it loads only one file from disc (at least on Metal Gear Ac!d UMD)... In first version everything was alright. But of course, as I noticed on other UMDs, the reading speed increased.
And I have a little question about another your program -- PSP Audio Recorder -- it seems that it can't execute Atrac3 Sample Player from Homebrew dir, but I tried only the first release of Atrac3 Player, maybe with the second one everything will be alright.
Thanks a lot for your work!
And I have a little question about another your program -- PSP Audio Recorder -- it seems that it can't execute Atrac3 Sample Player from Homebrew dir, but I tried only the first release of Atrac3 Player, maybe with the second one everything will be alright.
Thanks a lot for your work!
Re: Problem loading a3p files from UMD
This is because it applies a extension filter to increase the search speed. Probably those files of that umd have another extension different to at3, wav, pbp, and toc. If you tell me the extension i'll add it quickly.firun wrote:In second version I've noticed that it loads only one file from disc (at least on Metal Gear Ac!d UMD)... In first version everything was alright. But of course, as I noticed on other UMDs, the reading speed increased.
It's strange because I remember to have succeeded using psp audio recorder with the first atrac3 player sample (i also haven't tried the second version)firun wrote: And I have a little question about another your program -- PSP Audio Recorder -- it seems that it can't execute Atrac3 Sample Player from Homebrew dir, but I tried only the first release of Atrac3 Player, maybe with the second one everything will be alright.
I din't read the source of the second release yet ^^moonlight wrote: This is because it applies a extension filter to increase the search speed. Probably those files of that umd have another extension different to at3, wav, pbp, and toc. If you tell me the extension i'll add it quickly.
The extension is -- a3p.
I'll try the second release, but with the first sample Atrac3 Player I had only nonresponding PSP (PSP Recorder brilliantly works with UMD, but I couldn't make it work with Atrac3 Player). Maybe I've done something wrong -- I've put the Atrac3 Player Sample in PSP\GAME\HOMEBREW. I've put the EBOOT.PBP which was made from 2 (the loader & the executable).moonlight wrote: It's strange because I remember to have succeeded using psp audio recorder with the first atrac3 player sample (i also haven't tried the second version)
Thanks a lot!
-------------------------
Um, but I still can't execute Atrac3 Player from PSP Audio Recorder. After I press "o" it freezes and doesn't respond to any buttons' actions. If that's not a difficult for you, can you write here how to execute Atrac3 Player (second release) from PSP Audio Recorder. Thanks in advance!
-------------------------
Um, but I still can't execute Atrac3 Player from PSP Audio Recorder. After I press "o" it freezes and doesn't respond to any buttons' actions. If that's not a difficult for you, can you write here how to execute Atrac3 Player (second release) from PSP Audio Recorder. Thanks in advance!
Just a FYI if anyone else is having problems with EAC (it goes into an infinite loop on my machine); here is a codec you can use to encode/decode AT3. It worked well for me with audiograbber.