forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ATRAC3 Player Sample
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
moonlight



Joined: 26 Oct 2005
Posts: 567

PostPosted: Sun Jul 23, 2006 9:28 pm    Post subject: Reply with quote

User mode cannot load anything from the flash not even signed modules (except if a kernel app like psplink previously did a patch).
Loading from flash is only possible in kernel mode and vsh mode. Well, in vsh mode it would require the vshbridge module to be previously loaded, something that is not done automatically in "game" operative mode, so at the end you are forced to use kernel mode.
Back to top
View user's profile Send private message
subbie



Joined: 05 May 2005
Posts: 122

PostPosted: Mon Jul 24, 2006 2:08 am    Post subject: Reply with quote

moonlight wrote:
User mode cannot load anything from the flash not even signed modules (except if a kernel app like psplink previously did a patch).
Loading from flash is only possible in kernel mode and vsh mode. Well, in vsh mode it would require the vshbridge module to be previously loaded, something that is not done automatically in "game" operative mode, so at the end you are forced to use kernel mode.


Is there any other posible way as making my app kernal mode only would destroy compatibility with many psp units.
Back to top
View user's profile Send private message
weltall



Joined: 20 Feb 2004
Posts: 310

PostPosted: Mon Jul 24, 2006 4:09 am    Post subject: Reply with quote

yeah to load the required libraries you need kernel mode
Back to top
View user's profile Send private message Visit poster's website
moonlight



Joined: 26 Oct 2005
Posts: 567

PostPosted: Mon Jul 24, 2006 4:32 am    Post subject: Reply with quote

weltall wrote:
yeah to load the required libraries you need kernel mode


In user mode, they can be loaded from a disc anyways, and all umd usually have those two libraries.

In that way, the atrac3 player sample would work on a normal user mode application... but it wouldn't work on a GTA-exploit application.
Back to top
View user's profile Send private message
subbie



Joined: 05 May 2005
Posts: 122

PostPosted: Mon Jul 24, 2006 11:59 am    Post subject: Reply with quote

moonlight wrote:
weltall wrote:
yeah to load the required libraries you need kernel mode


In user mode, they can be loaded from a disc anyways, and all umd usually have those two libraries.

In that way, the atrac3 player sample would work on a normal user mode application... but it wouldn't work on a GTA-exploit application.


So stuff ran with gta loader wont work but 2.0 via tiff should work.

Hmm. This kind of sucks... Does the GTA-exploit alow wifi or does not as well because of this same issue?

Also if my app is running in kernal. I noticed comments on atrac3 needing user mode. Do I only just need to execute the threads in user vs kernal?
Back to top
View user's profile Send private message
sakya



Joined: 28 Apr 2006
Posts: 190

PostPosted: Thu Sep 28, 2006 5:50 pm    Post subject: Re: ATRAC3 Player Sample Reply with quote

Hi! :)

Sorry to bother. I'm not an experienced C/C++ coder, sorry for my question.
I'm trying to use the sample code in a "normal" eboot (not in a prx).
I'm always getting the "Cannot play that file." message.
Can someone help me? :)

Many thanks
Sakya
Back to top
View user's profile Send private message Visit poster's website
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Thu Sep 28, 2006 7:55 pm    Post subject: Reply with quote

sakya wrote:
Hi! :)

Sorry to bother. I'm not an experienced C/C++ coder, sorry for my question.
I'm trying to use the sample code in a "normal" eboot (not in a prx).
I'm always getting the "Cannot play that file." message.
Can someone help me? :)

Many thanks
Sakya


I've been trying to achieve the same sakya and have the exact same issue.

I forget what the error code I got back from the function was - I'll post it up when I get back from work.
Back to top
View user's profile Send private message
sakya



Joined: 28 Apr 2006
Posts: 190

PostPosted: Thu Sep 28, 2006 8:28 pm    Post subject: Reply with quote

Hi!
Insert_witty_name wrote:
I've been trying to achieve the same sakya and have the exact same issue.
I forget what the error code I got back from the function was - I'll post it up when I get back from work.

The function
Code:

atracID = sceAtracSetDataAndGetID(file_buffer, fsize);   

returns tha value -2147352262

Ciaooo
Sakya
Back to top
View user's profile Send private message Visit poster's website
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Thu Sep 28, 2006 9:30 pm    Post subject: Reply with quote

Yeah that's the one ... 8002013A ... library not linked yet.

Ran a search on that error code and this post came up:

http://forums.ps2dev.org/viewtopic.php?t=6460
Back to top
View user's profile Send private message
sakya



Joined: 28 Apr 2006
Posts: 190

PostPosted: Thu Sep 28, 2006 10:29 pm    Post subject: Reply with quote

Hi!
Many thanks for your help. :)
I red the post, but I'm loading prx from flash, not umd!
My thread is in user mode. I tested also kernel mode, but i get the same error.

I post my code (99,9% taken from Atrac3 Player Sample).
Code:

#include <pspsdk.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspumd.h>
#include <pspaudio.h>
#include <pspaudiolib.h>
#include <pspaudiocodec.h>
#include <pspatrac3.h>

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
//PSP_MODULE_INFO("AT3PLAYER", 0x1000, 1, 1);
//PSP_MAIN_THREAD_ATTR(0);
PSP_MODULE_INFO("AT3PLAYER", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER|PSP_THREAD_ATTR_VFPU);

#define psprintf pspDebugScreenPrintf

#define PBP_SIGNATURE   0x50425000
#define RIFF_SIGNATURE   0x46464952

typedef struct FileEntry
{
   char path[512];
   //u32  signature;
} FileEntry;

#define MAX_FILES 256

FileEntry at3files[MAX_FILES];

int listAT3Files(char *path, int i, char *filter)
{
   SceUID dfd;

   if ((dfd = sceIoDopen(path)) > 0)
   {
      SceIoDirent dir;

      memset(&dir, 0, sizeof(SceIoDirent));

      while (sceIoDread(dfd, &dir) > 0)
      {
         char f_path[512];

         if(FIO_S_ISDIR(dir.d_stat.st_mode))
         {
            if (dir.d_name[0] != '.')
            {
               sprintf(f_path, "%s%s/", path, dir.d_name);
               i = listAT3Files(f_path, i, filter);
            }
         }

         else
         {
            SceUID fd;   
            
            if (filter)
            {
               char *f_temp;
               int found;

               f_temp = filter;
               found = 0;

               while (*f_temp)
               {
                  if (strstr(dir.d_name, f_temp) != NULL)
                  {
                     found = 1;
                     break;
                  }

                  f_temp += strlen(f_temp) + 1;
               }

               if (!found)
                  continue;
            }   

            strcpy(f_path, path);
            strcat(f_path, dir.d_name);

            fd = sceIoOpen(f_path, PSP_O_RDONLY, 0777);

            if (fd >= 0)
            {
               u32 signature;

               sceIoRead(fd, &signature, 4);

               if (signature != RIFF_SIGNATURE)
               {
                  u32 offsets[8];
                  u32 at3size;

                  if (signature != PBP_SIGNATURE)
                  {
                     sceIoClose(fd);
                     continue;
                  }

                  sceIoLseek(fd, 8, PSP_SEEK_SET);
                  sceIoRead(fd, offsets, sizeof(offsets));

                  at3size = offsets[6] - offsets[5];

                  if (at3size == 0)
                  {
                     sceIoClose(fd);
                     continue;
                  }
               }

               strcpy(at3files[i++].path, f_path);
               sceIoClose(fd);               

               if (i == MAX_FILES)
                  break;
            }
         }
      }
   }

   sceIoDclose(dfd);
   return i;
}


u8 file_buffer[6*1024*1024] __attribute__((aligned(64)));

#define N_BLOCKS 16

u16 blocks[N_BLOCKS][16384]; // 16384 -> more than necessary

SceUID playth=-1, decodeth=-1;
SceUID nonfull, nonempty, mutex;

int atracID;
int startIndex, endIndex;
int decodeEnd;

void debugMessage(const char *fmt, ...);

int decode_thread(SceSize args, void *argp)
{
   int res, nsamples, end, rem;

   // Producer
   while(!decodeEnd)
   {
      sceKernelWaitSema(nonfull, 1, NULL);
      sceKernelWaitSema(mutex, 1, NULL);

      endIndex = (endIndex+1) % N_BLOCKS;
      
      nsamples = 0;
      end = 0;
      rem = -1;

      res = sceAtracDecodeData(atracID, blocks[endIndex], &nsamples, &end, &rem);
      
      if (res < 0 || end)
      {
         decodeEnd = 1;
         //psprintf("decode end, res=%08X\n", res);         
      }

      sceKernelSignalSema(mutex, 1);
      sceKernelSignalSema(nonempty, 1);
   }

   return 0;
}

int play_thread(SceSize args, void *argp)
{
   SceUID fd;
   int fsize, size;
   int channel, chsize;
   u32 signature;
            
   fd = sceIoOpen((char *)argp, PSP_O_RDONLY, 0777);
   
   if (fd < 0)
   {
      psprintf("Error opening file.\n");
      return -1;
   }

   sceIoRead(fd, &signature, 4);

   if (signature != RIFF_SIGNATURE)
   {
      u32 offsets[8];

      if (signature != PBP_SIGNATURE)
      {
         debugMessage("File type not supported.\n");
         return -1;
      }

      sceIoLseek(fd, 8, PSP_SEEK_SET);
      sceIoRead(fd, offsets, sizeof(offsets));

      size = offsets[6] - offsets[5];

      if (size == 0)
      {
         debugMessage("PBP file does not contain AT3 data.\n");
         return -1;
      }

      sceIoLseek(fd, offsets[5], PSP_SEEK_SET);
   }

   else
   {
      size = 6 * 1024 * 1024;
      sceIoLseek(fd, 0, PSP_SEEK_SET);
   }

   fsize = sceIoRead(fd, file_buffer, size);
   sceIoClose(fd);   

   atracID = sceAtracSetDataAndGetID(file_buffer, fsize);   
   if (atracID < 0)
   {
      debugMessage("Cannot play that file. (0x%08x)\n", atracID);
      return -1;
   }

   sceAtracGetMaxSample(atracID, &chsize);   
   sceAtracSetLoopNum(atracID, 0);

   nonfull = sceKernelCreateSema("nonfull", 0, N_BLOCKS, N_BLOCKS, NULL);
   nonempty = sceKernelCreateSema("nonempty", 0, 0, N_BLOCKS, NULL);
   mutex = sceKernelCreateSema("mutex", 0, 1, 1, NULL);

   if (nonfull < 0 || nonempty < 0 || mutex < 0)
   {
      debugMessage("Error creating semaphores\n");
      return -1;
   }

   channel = sceAudioChReserve(0, chsize, PSP_AUDIO_FORMAT_STEREO);

   if (channel < 0)
   {
      debugMessage("Error reserving channel\n");
      return -1;
   }

   startIndex = -1;
   endIndex = -1;
   decodeEnd = 0;

   decodeth = sceKernelCreateThread("decode_thread", decode_thread, 0x12, 0x10000, PSP_THREAD_ATTR_USER, NULL);

   if (decodeth < 0)
   {
      debugMessage("Error creating decode_thread.\n");
      return -1;
   }

   sceKernelStartThread(decodeth, 0, 0);

   // Consumer
   while (1)
   {
      sceKernelWaitSema(nonempty, 1, NULL);
      sceKernelWaitSema(mutex, 1, NULL);

      startIndex = (startIndex + 1) % N_BLOCKS;
      sceAudioOutputBlocking(channel, 0x8000, blocks[startIndex]);

      if (decodeEnd && startIndex==endIndex)
         break;      

      sceKernelSignalSema(mutex, 1);
      sceKernelSignalSema(nonfull, 1);
   }

   sceKernelDelayThread(50000);

   sceAtracReleaseAtracID(atracID);
   sceKernelDeleteSema(nonfull);
   sceKernelDeleteSema(nonempty);
   sceKernelDeleteSema(mutex);
   sceAudioChRelease(channel);   

   //psprintf("thread end\n");

   return 0;
}

void playAT3File(char *file)
{
   decodeEnd = 1;

   sceKernelWaitThreadEnd(playth, NULL);
   sceKernelWaitThreadEnd(decodeth, NULL);
   sceKernelDeleteThread(playth);
   sceKernelDeleteThread(decodeth);

   sceKernelDelayThread(50000);
   
   // IMPORTANT: libatrac3 needs user mode, it won't work in kernel mode
   playth = sceKernelCreateThread("play_thread", play_thread, 0x12, 0x10000, PSP_THREAD_ATTR_USER, NULL);

   if (playth < 0)
   {
      debugMessage("Error creating play_thread.\n");
      return;
   }

   sceKernelStartThread(playth, strlen(file)+1, file);
}

#define GREEN 0x0000FF00
#define WHITE 0x00FFFFFF
#define RED     0x000000FF

#define START_Y_POSITION   3
#define HELP_Y_POSITION      28
#define DEBUG_Y_POSITION   30   
#define ROOT_STR_N         4
#define N_PAGE_ITEMS      20

char *root_str[ROOT_STR_N] =
{
   "MUSIC FILES",
   "DISC FILES",
   "HOMEBREW FILES",
   "SAVEDATA FILES"
};

char *dir_paths[ROOT_STR_N] =
{
   "ms0:/PSP/MUSIC/",
   "disc0:/",
   "ms0:/PSP/GAME/",
   "ms0:/PSP/SAVEDATA/"
};

void debugMessage(const char *fmt, ...)
{
   va_list list;
   char msg[256];

   pspDebugScreenSetXY(0, DEBUG_Y_POSITION);
   pspDebugScreenSetTextColor(RED);

   va_start(list,fmt);
   vsprintf(msg,fmt,list);
   va_end(list);

   psprintf("%s", msg);
}

void clearDebug()
{
   char msg[68];

   pspDebugScreenSetXY(0, DEBUG_Y_POSITION);
   pspDebugScreenSetTextColor(RED);

   memset(msg, ' ', 67);

   msg[67] = 0;

   psprintf("%s", msg);
   
}

void printHelpMessage()
{
   pspDebugScreenSetXY(0, HELP_Y_POSITION);
   pspDebugScreenSetTextColor(GREEN);
   psprintf("Press X to select/play, O to go back and HOME to exit.");
}

int mainScreen();

void printPage(int j, int npages, int ntotal, int nthispage)
{
   int i;

   pspDebugScreenClear();
   printHelpMessage();
   
   pspDebugScreenSetXY(0, START_Y_POSITION);
   for (i = 0; i < nthispage; i++)
   {
      pspDebugScreenSetTextColor((i == 0) ? GREEN : WHITE);
      psprintf("%s\n", at3files[(j*N_PAGE_ITEMS)+i].path);
   }

   if (npages > 1)
   {
      psprintf("\nShowing page %d of %d.\n", j+1, npages);
      psprintf("Press R to move to next page. Press L to move to previous page");
   }
}

void selectScreen(int dirindex)
{
   SceCtrlData pad;
   int i, j, npages, ntotal, nthispage;
   char *filter;

   pspDebugScreenClear();
   pspDebugScreenSetXY(0, START_Y_POSITION);
   pspDebugScreenSetTextColor(GREEN);

   filter = ".at3\0.AT3\0.pbp\0.PBP\0.wav\0.WAV\0.toc\0.TOC\0.a3p\0.A3P\0\0";

   if (dirindex == 1)
   {
      // Mount disc if inserted

      if(sceUmdCheckMedium(0) == 0)
      {
         psprintf("No disc inserted.\nGoing back\n");
         sceKernelDelayThread(1200000);
         mainScreen();
      }

      sceUmdActivate(1, "disc0:");
      sceUmdWaitDriveStat(UMD_WAITFORINIT);      
   }

   psprintf("Listing files. Wait...%s", (dirindex == 1) ? "(search in disc is slow, be patient)\n" : "\n");
   ntotal = listAT3Files(dir_paths[dirindex], 0, filter);

   if (ntotal == 0)
   {
      psprintf("No files found.\nGoing back\n");
      sceKernelDelayThread(1200000);
      mainScreen();
   }

   if (ntotal < N_PAGE_ITEMS)
   {
      npages = 1;
      nthispage = ntotal;
   }

   else
   {
      npages = ntotal / N_PAGE_ITEMS;

      if ((ntotal % N_PAGE_ITEMS) != 0)
         npages++;

      nthispage = N_PAGE_ITEMS;
   }

   i = 0;
   j = 0;

   printPage(j, npages, ntotal, nthispage);

   sceCtrlSetSamplingCycle(0);
   sceCtrlSetSamplingMode(PSP_CTRL_MODE_DIGITAL);

   while (1)
   {
      int keyprocessed;

      keyprocessed = 0;
      
      sceCtrlReadBufferPositive(&pad, 1);

      if (pad.Buttons & PSP_CTRL_UP)
      {
         if ( ((j != (npages-1)) && ((i % N_PAGE_ITEMS) != 0))
            || ((j == (npages-1)) && ((i % N_PAGE_ITEMS) != 0)) )
         {
            i--;

            pspDebugScreenSetXY(0, START_Y_POSITION+(i % N_PAGE_ITEMS));
            pspDebugScreenSetTextColor(GREEN);
            psprintf("%s\n", at3files[i].path);

            pspDebugScreenSetTextColor(WHITE);
            psprintf("%s", at3files[i+1].path);

            keyprocessed = 1;
         }
      }

      else if (pad.Buttons & PSP_CTRL_DOWN)
      {
         if ( ((j != (npages-1)) && ((i % N_PAGE_ITEMS) != (N_PAGE_ITEMS-1)))
            || ((j == (npages-1)) && ((i % N_PAGE_ITEMS) != (nthispage-1))) )
         {
            i++;
            
            pspDebugScreenSetXY(0, START_Y_POSITION+(i % N_PAGE_ITEMS)-1);
            pspDebugScreenSetTextColor(WHITE);
            psprintf("%s\n", at3files[i-1].path);

            pspDebugScreenSetTextColor(GREEN);
            psprintf("%s", at3files[i].path);            

            keyprocessed = 1;
         }
      }

      else if (pad.Buttons & PSP_CTRL_LTRIGGER)
      {
         if (j != 0)
         {
            j--;
            i = j * N_PAGE_ITEMS;

            nthispage = N_PAGE_ITEMS;
            printPage(j, npages, ntotal, nthispage);
            
            keyprocessed = 1;
         }
      }

      else if (pad.Buttons & PSP_CTRL_RTRIGGER)
      {
         if (j != (npages-1))
         {
            j++;
            i = j * N_PAGE_ITEMS;

            if ( (j == (npages-1)) && ((ntotal % N_PAGE_ITEMS) != 0) )
               nthispage = ntotal % N_PAGE_ITEMS;   

            printPage(j, npages, ntotal, nthispage);
            
            keyprocessed = 1;
         }
      }

      else if (pad.Buttons & PSP_CTRL_CROSS)
      {
         clearDebug();
         playAT3File(at3files[i].path);
         keyprocessed = 1;
      }

      else if (pad.Buttons & PSP_CTRL_CIRCLE)
      {
         sceKernelDelayThread(200000);
         mainScreen();
      }      

      sceKernelDelayThread((keyprocessed) ? 200000 : 50000);
   }

   sceKernelExitGame();
}

int mainScreen()
{
   SceCtrlData pad;
   int i;

   pspDebugScreenClear();
   printHelpMessage();

   pspDebugScreenSetXY(0, START_Y_POSITION);

   for (i = 0; i < ROOT_STR_N; i++)
   {
      pspDebugScreenSetTextColor((i == 0) ? GREEN : WHITE);
      psprintf("%s\n", root_str[i]);
   }

   i = 0;

   sceCtrlSetSamplingCycle(0);
   sceCtrlSetSamplingMode(PSP_CTRL_MODE_DIGITAL);

   while (1)
   {
      int keyprocessed;

      keyprocessed = 0;
      
      sceCtrlReadBufferPositive(&pad, 1);

      if (pad.Buttons & PSP_CTRL_UP)
      {
         if (i != 0)
         {
            i--;

            pspDebugScreenSetXY(0, START_Y_POSITION+i);
            pspDebugScreenSetTextColor(GREEN);
            psprintf("%s\n", root_str[i]);

            pspDebugScreenSetTextColor(WHITE);
            psprintf("%s", root_str[i+1]);

            keyprocessed = 1;
            
         }
      }

      else if (pad.Buttons & PSP_CTRL_DOWN)
      {
         if (i != (ROOT_STR_N-1))
         {
            i++;
            
            pspDebugScreenSetXY(0, START_Y_POSITION+i-1);
            pspDebugScreenSetTextColor(WHITE);
            psprintf("%s\n", root_str[i-1]);

            pspDebugScreenSetTextColor(GREEN);
            psprintf("%s", root_str[i]);            

            keyprocessed = 1;
         }
      }

      else if (pad.Buttons & PSP_CTRL_CROSS)
      {
         sceKernelDelayThread(200000);
         selectScreen(i);
      }
      
      sceKernelDelayThread((keyprocessed) ? 200000 : 50000);
   }

   sceKernelExitGame();
   return 0;
}

/* Exit callback */
int exit_callback(int arg1, int arg2, void *common)
{
    sceKernelExitGame();

   return 0;
}

/* Callback thread */
int CallbackThread(SceSize args, void *argp)
{
    int cbid;
    cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
    sceKernelRegisterExitCallback(cbid);
    sceKernelSleepThreadCB();

   return 0;
}

/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void)
{
    int thid = 0;
    thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, THREAD_ATTR_USER, 0);
    if (thid >= 0)
   sceKernelStartThread(thid, 0, 0);
    return thid;
}

//Load and start prx:
int loadPRX()
{
    SceUID uidAudio;
   SceUID uidAtrac;
    uidAudio = pspSdkLoadStartModule("flash0:/kd/audiocodec.prx", PSP_MEMORY_PARTITION_KERNEL);
   if(uidAudio < 0)
    {
        printf("Couldn't load audiocodec %08X\n", uidAudio);
        return -1;
    }
    uidAtrac = pspSdkLoadStartModule("flash0:/kd/libatrac3plus.prx", PSP_MEMORY_PARTITION_USER);
   if(uidAtrac < 0)
    {
        printf("Couldn't load libatrac3plus %08X\n", uidAtrac);
        return -1;
    }
   sceKernelExitThread(0);
   return 0;
}


// Main:
int main() {
    pspDebugScreenInit();
    SetupCallbacks();

    SceUID loadPRXid = sceKernelCreateThread("LoadPRX", loadPRX, 0x16,
                  0x00010000, PSP_THREAD_ATTR_USER, NULL);
   if (loadPRXid < 0)
    {      
       return -1;
     }

   SceUID thid = sceKernelCreateThread("Atrac3Player", mainScreen, 0x16,
                 0x00010000, PSP_THREAD_ATTR_USER, NULL);

    if (thid < 0)
    {      
       return -1;
     }

    sceKernelStartThread(thid, 0, 0);
    sceKernelSleepThread();

    return 0;
}


Ciaooo
sakya
Back to top
View user's profile Send private message Visit poster's website
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Fri Sep 29, 2006 4:28 pm    Post subject: Reply with quote

A couple of things I noticed after a quick scan of your code.

You'll need kernel mode to load the modules from flash.

You create the loadPRX thread - but never actually start it.

I tried your code with the errors above corrected but I still receive the libraries not linked error.

Also tried it with loading the PRX off a UMD - same result.
Back to top
View user's profile Send private message
sakya



Joined: 28 Apr 2006
Posts: 190

PostPosted: Fri Sep 29, 2006 5:19 pm    Post subject: Reply with quote

Ciao! :)

Many thanks for your help. I've also tried kernel mode and before adding the thread (ooops I forgot to start it!) I loaded the prx in the main function, with the same error.
I'm very interested in atrac3 playback, I hope to find a solution. :)

Ciaooo
Sakya
Back to top
View user's profile Send private message Visit poster's website
fergie4000



Joined: 19 Jan 2007
Posts: 25

PostPosted: Thu Mar 22, 2007 12:02 am    Post subject: Reply with quote

is it just me being stupid or can this not play long at3 files like the radio stations in gta for example
Back to top
View user's profile Send private message
JoRDozZzz



Joined: 05 Apr 2007
Posts: 9

PostPosted: Thu Apr 05, 2007 6:36 am    Post subject: Reply with quote

hello everybody,
i came via google on this forum and i saw this thread about a Simpel Atrac3 Player. I'm coding in c/c++ for some weeks, so i'm a n00b.

but i've my first homebrew, but i really would like to hear music when in homebrew. If you know the program Flash Agent, made by Hallo007, yoou know what i mean.

Now is my thing, that i would like to know what the easiest way is to put music in your program.

i've downloaded moonlight's atrac3player, but i don't know if this is the easiest way.

Yesterday i tried to make this atrac3player with my own music in my own dir, i thought it was ok, but when i tested it, it doens't work and i didn't saw my own music in the program. and Yes i do have put the at3 file in the correct folder.

Please can someone help me with this atrac3player or maybe an other way to put music in your homebrew.

When I have music on the background in my own homebrew, i do some last codes en then i'll release it.

Yesterday i tried to put an image in my homebrew and that works, so music is the latest thing.

if you can help me please give a reaction here or send me an email:
jordozzzz@gmail.com

Sorry for my English,

Thanks you very very much for help,

JoRDozZzz
_________________
C/C++ Noob/Beginner
Back to top
View user's profile Send private message Visit poster's website
JoRDozZzz



Joined: 05 Apr 2007
Posts: 9

PostPosted: Thu Apr 05, 2007 8:04 am    Post subject: Reply with quote

someone else gave me a tutorial of adding sound
Link

i've done this and now i have music playback on the background in my homebrew.. xD xD

ty,
// JoRDozZzz[/url]
_________________
C/C++ Noob/Beginner
Back to top
View user's profile Send private message Visit poster's website
VGV



Joined: 12 Jun 2007
Posts: 3

PostPosted: Tue Jun 12, 2007 9:51 pm    Post subject: Reply with quote

hello from another newbe :)

i have same problem as sakya and found a solution.

1)
Code:
PSP_MODULE_INFO("SOUND_TEST", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER|PSP_THREAD_ATTR_VFPU);


2)
Code:
  pspSdkLoadStartModule("ms0:/audiocodec.prx", PSP_MEMORY_PARTITION_KERNEL);
   pspSdkLoadStartModule("ms0:/libatrac3plus.prx", PSP_MEMORY_PARTITION_USER);

it means u will need to extract our modules from some game.
Back to top
View user's profile Send private message
Vincent_M



Joined: 03 Apr 2007
Posts: 73

PostPosted: Fri Nov 02, 2007 2:40 am    Post subject: Reply with quote

You could run into legal issues because you are using software only licensed developers can 'have'. It is official software of Sony, and by having it on a personal storage medium not licensed by Sony would result in legal issues from what I've heard. It's been said before anyway, what I've seen others do is just have a UMD disk in the PSP, and load the modules off a legitimate game. I'm not playing good-cop, bad-cop, but I'm just saying that Sony is looking for all the little legal things to stop non-licensed developers. This would be a precaution. Having those raw files sitting on their memorystick could be bad legally.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group