| View previous topic :: View next topic |
| Author |
Message |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Tue Apr 18, 2006 4:54 pm Post subject: 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/AT3PLAYERSAMPLE_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 |
|
| Back to top |
|
 |
dot_blank

Joined: 28 Sep 2005 Posts: 498 Location: Brasil
|
Posted: Tue Apr 18, 2006 6:16 pm Post subject: |
|
|
wow amazing!
this is an excellent reversal
my hat goes offf to you _________________ 10011011 00101010 11010111 10001001 10111010 |
|
| Back to top |
|
 |
weltall
Joined: 20 Feb 2004 Posts: 310
|
Posted: Tue Apr 18, 2006 7:49 pm Post subject: |
|
|
| good work :) |
|
| Back to top |
|
 |
weak
Joined: 13 Jan 2005 Posts: 114 Location: Vienna, Austria
|
Posted: Tue Apr 18, 2006 9:44 pm Post subject: |
|
|
| excellent |
|
| Back to top |
|
 |
jonny
Joined: 22 Sep 2005 Posts: 351
|
Posted: Tue Apr 18, 2006 10:26 pm Post subject: |
|
|
| awesome! |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Tue Apr 18, 2006 11:30 pm Post subject: |
|
|
| 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 :) |
|
| Back to top |
|
 |
TheHorst
Joined: 13 Apr 2006 Posts: 12
|
Posted: Wed Apr 19, 2006 4:08 am Post subject: |
|
|
very nice ...
just one queation, why does it stop playing the at3s after u have played 5 or 6?
does this only happen to me??
i´ve compiled your sample ... |
|
| Back to top |
|
 |
w0lv3121n3
Joined: 19 Apr 2006 Posts: 2
|
Posted: Wed Apr 19, 2006 10:21 am Post subject: |
|
|
Well done!
I was wondering, does this let us play Atrac files in our 1.5 psp? |
|
| Back to top |
|
 |
weltall
Joined: 20 Feb 2004 Posts: 310
|
Posted: Wed Apr 19, 2006 4:40 pm Post subject: |
|
|
| yes |
|
| Back to top |
|
 |
thanatos
Joined: 19 Apr 2006 Posts: 2
|
Posted: Wed Apr 19, 2006 7:47 pm Post subject: |
|
|
| :P come on ,have further try |
|
| Back to top |
|
 |
__count
Joined: 23 Mar 2006 Posts: 22
|
Posted: Thu Apr 20, 2006 12:10 am Post subject: |
|
|
Any clues on the performance of this built in lib? Does it look like it outperforms libmad?
| thanatos wrote: | | :P come on ,have further try |
? |
|
| Back to top |
|
 |
weak
Joined: 13 Jan 2005 Posts: 114 Location: Vienna, Austria
|
Posted: Thu Apr 20, 2006 12:29 am Post subject: |
|
|
| as i understand it atrac is decoded through the ME. so actually it should free all cpu time libmad uses for audio decoding? |
|
| Back to top |
|
 |
Mathieulh
Joined: 19 Oct 2005 Posts: 68
|
Posted: Thu Apr 20, 2006 1:37 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Thu Apr 20, 2006 1:57 am Post subject: |
|
|
| 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. |
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.
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 ;) |
|
| Back to top |
|
 |
Mathieulh
Joined: 19 Oct 2005 Posts: 68
|
Posted: Thu Apr 20, 2006 2:59 am Post subject: |
|
|
| 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) |
|
| Back to top |
|
 |
weak
Joined: 13 Jan 2005 Posts: 114 Location: Vienna, Austria
|
Posted: Thu Apr 20, 2006 4:40 am Post subject: |
|
|
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 ;) |
|
| Back to top |
|
 |
weak
Joined: 13 Jan 2005 Posts: 114 Location: Vienna, Austria
|
Posted: Thu Apr 20, 2006 7:30 am Post subject: Re: ATRAC3 Player Sample |
|
|
| 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).
|
seems like you have to delete the threads after they've finished (although you explicitly wait for end):
| Code: |
sceKernelWaitThreadEnd(playth, NULL);
sceKernelWaitThreadEnd(decodeth, NULL);
+sceKernelDeleteThread(playth);
+sceKernelDeleteThread(decodeth);
|
fixes it for me |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Thu Apr 20, 2006 7:52 am Post subject: Re: ATRAC3 Player Sample |
|
|
| weak wrote: | | 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).
|
seems like you have to delete the threads after they've finished (although you explicitly wait for end):
| Code: |
sceKernelWaitThreadEnd(playth, NULL);
sceKernelWaitThreadEnd(decodeth, NULL);
+sceKernelDeleteThread(playth);
+sceKernelDeleteThread(decodeth);
|
fixes it for me |
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. |
|
| Back to top |
|
 |
w0lv3121n3
Joined: 19 Apr 2006 Posts: 2
|
Posted: Thu Apr 20, 2006 8:28 am Post subject: |
|
|
| how come it doesnt detect the atrac files i put in my psp? |
|
| Back to top |
|
 |
majinboo
Joined: 15 Apr 2006 Posts: 4 Location: France
|
Posted: Thu Apr 20, 2006 8:05 pm Post subject: |
|
|
| w0lv3121n3 wrote: | | how come it doesnt detect the atrac files i put in my psp? |
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. _________________ There are only 10 types of people in the world: Those who understand binary, and those who don't ! |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Sat Apr 22, 2006 10:11 pm Post subject: |
|
|
| I've updated the sample. (see the first post). |
|
| Back to top |
|
 |
majinboo
Joined: 15 Apr 2006 Posts: 4 Location: France
|
Posted: Sun Apr 23, 2006 2:09 am Post subject: |
|
|
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 ! |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Sun Apr 23, 2006 2:42 am Post subject: |
|
|
| 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. |
Ok, now it's fixed and updated the link. I didn't know that extension. |
|
| Back to top |
|
 |
majinboo
Joined: 15 Apr 2006 Posts: 4 Location: France
|
Posted: Sun Apr 23, 2006 3:48 am Post subject: |
|
|
| moonlight wrote: | | 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. |
Ok, now it's fixed and updated the link. I didn't know that extension. |
So fast ! Thanks for your work. _________________ There are only 10 types of people in the world: Those who understand binary, and those who don't ! |
|
| Back to top |
|
 |
firun
Joined: 12 Jul 2005 Posts: 3 Location: Russia, Saint-Petersburg
|
Posted: Sun Apr 23, 2006 4:45 pm Post subject: 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! |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Sun Apr 23, 2006 5:15 pm Post subject: Re: Problem loading a3p files from UMD |
|
|
| 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. |
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: |
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.
|
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) |
|
| Back to top |
|
 |
firun
Joined: 12 Jul 2005 Posts: 3 Location: Russia, Saint-Petersburg
|
Posted: Sun Apr 23, 2006 5:34 pm Post subject: |
|
|
| 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. |
I din't read the source of the second release yet ^^
The extension is -- a3p.
| 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) |
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). |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Sun Apr 23, 2006 5:46 pm Post subject: |
|
|
Updated the link with support for that curious extension.
I haven't tried again with the first atrac3 sample, but the second works well with the psp audio recorder. |
|
| Back to top |
|
 |
firun
Joined: 12 Jul 2005 Posts: 3 Location: Russia, Saint-Petersburg
|
Posted: Sun Apr 23, 2006 5:53 pm Post subject: |
|
|
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! |
|
| Back to top |
|
 |
__count
Joined: 23 Mar 2006 Posts: 22
|
Posted: Mon Apr 24, 2006 4:55 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
|