HomeForumsWhat's newResources 
 
 
SND_ChgMap(0) problem
vbt - Jun 7, 2006
   vbt Jun 7, 2006 
I'm trying to run SBL samples and it seems it stays stucked in SND_ChgMap function. It stays in an infinite loop any idea why ?

   vbt Jun 8, 2006 
Nobody ?

   vbt Jun 19, 2006 

   mrkotfw Jun 29, 2006 
Stop using SBL

   vbt Jul 3, 2006 

  
Originally posted by Piratero@Thu, 2006-06-29 @ 09:57 AM

Stop using SBL

[post=146831]Quoted post[/post]




well nobody wants to help.

   vbt Oct 8, 2006 
Well I've finally something working Not sure what was wrong in the sample but there was something ...

   vbt Oct 11, 2006 
Well I'm trying now to read pcm data with some problems, can someone help ? What is the way to read a waveform ?

   vbt Oct 11, 2006 
Code:
  
//-------------------------------------------------------------------------------------------------------------- void displayMenu(void) { slInitSystem(TV_320x224,NULL,1); SetVblank(); SndIniDt snd_init; SndPcmStartPrm pcm_start; SndPcmChgPrm pcm_chg; SYS_CHGUIPR(pri_tbl); /* 轄槹D先xマ更 */ move_pcm_adr = (Uint16 *)0x06030000; /* E`l]ウ */ l_move_pcm_adr = (Uint16 *)0x06065000; /* 左`l]ウ */ set_imask(0); INT_ChgMsk(INT_MSK_NULL, INT_MSK_SND); /* TEh願込ン */ INT_SetScuFunc(INT_SCU_SND, PcmIntr); /* 願込ン傷o^ */ INT_ChgMsk(INT_MSK_SND,INT_MSK_NULL); /* TEh願込ン */ CDC_CdInit(0x00,0x00,0x05,0x0f); GFS_DIRTBL_TYPE(&dirtbl) = GFS_DIR_NAME; GFS_DIRTBL_DIRNAME(&dirtbl) = dirname; GFS_DIRTBL_NDIR(&dirtbl) = MAX_DIR; GFS_Init(MAX_OPEN, lib_work, &dirtbl); slSynch(); int fid = GFS_NameToId(SDDRV_NAME); char toto[80]; int ii=0; for (ii = 0; ii<12; ii++) { sprintf(toto,"fid=%d 1 :%s",fid,GFS_IdToName(ii)); DBG_SetCursol( 15, ii+5 ); DBG_Printf(toto); } GFS_Load(GFS_NameToId(SDDRV_NAME),0,(void *) SDDRV_ADDR,SDDRV_SIZE); GFS_Load(GFS_NameToId(SDMAP_NAME),0,(void *) SDMAP_ADDR,SDMAP_SIZE); if (GFS_Load(GFS_NameToId(SDDRV_NAME),0,(void *) SDDRV_ADDR,SDDRV_SIZE)<0) DBG_Printf("drv not loaded"); if (GFS_Load(GFS_NameToId(SDMAP_NAME),0,(void *) SDMAP_ADDR,SDMAP_SIZE)<0) DBG_Printf("map not loaded"); move_pcm_adr = (Uint16 *)0x6020000; /* E`l]ウ */ set_imask(0); INT_ChgMsk(INT_MSK_NULL, INT_MSK_SND); /* TEh願込ン */ INT_SetScuFunc(INT_SCU_SND, PcmIntr); /* 願込ン傷o^ */ INT_ChgMsk(INT_MSK_SND,INT_MSK_NULL); /* TEh願込ン */ SND_INI_PRG_ADR(snd_init) = (Uint16 *)SDDRV_ADDR; SND_INI_PRG_SZ(snd_init) = (Uint16) SDDRV_SIZE; SND_INI_ARA_ADR(snd_init) = (Uint16 *)SDMAP_ADDR; SND_INI_ARA_SZ(snd_init) = (Uint16) SDMAP_SIZE; SND_Init(&snd_init); SND_ChgMap(0); SND_Init(&snd_init); // FNT_Print256_2bpp((volatile Uint8 *)SCL_VDP2_VRAM_A1, // (Uint8 *)"init done",40,2,colors); //SCL_DisplayFrame(); SND_ChgMap(0); slSynch(); SND_RESET_INT(); /* 轄槹Xeー^X鎧bg */ SND_SET_ENA_INT(SND_INT_PCM_ADR); /* PCM轄槹(TEh) */ move_bnk = 0; l_move_bnk = 0; /* RIGHT`l */ r_PcmIntr(); /* E`l] */ r_PcmIntr(); /* E`l] */ /* LEFT`l */ l_PcmIntr(); /* 左`l] */ l_PcmIntr(); /* 左`l] */ SND_PRM_MODE(pcm_start) = SND_MD_STEREO | SND_MD_16; SND_PRM_SADR(pcm_start) = 0x1000; SND_PRM_SIZE(pcm_start) = 0x2000; SND_PRM_NUM(pcm_chg) = 2; SND_PRM_LEV(pcm_chg) = 7; SND_PRM_PAN(pcm_chg) = 0; SND_PRM_PICH(pcm_chg) = 0; SND_L_EFCT_IN(pcm_chg) = 0; SND_L_EFCT_LEV(pcm_chg) = 7; SND_R_EFCT_IN(pcm_chg) = 0; SND_R_EFCT_LEV(pcm_chg) = 7; //CyberWarriorX> It's basically like a kind of lookup table for the driver //<CyberWarriorX> You tell it what parts of sound ram are tone bank, sequence banks, dsp program, #define SND_KD_TONE 0x0 // ケ色 #define SND_KD_SEQ 0x1 // VーPX #define SND_KD_DSP_PRG 0x2 // DSPv弘 if (GFS_Load(GFS_NameToId("AUDIO2.PCM"),0,(void *) 0x6030000,0x40000)<0) DBG_Printf("AUDIO2.PCM B not loaded"); SND_StartPcm(&pcm_start, &pcm_chg); /* PCM開始 */ while(1){ if(l_move_pcm_adr > (Uint16 * volatile)0x06080000 || move_pcm_adr > (Uint16 * volatile)0x06080000 ){ SND_StopPcm(2); DBG_Printf("Finished"); } } } #ifndef ACTION_REPLAY //------------------------------------------------------------------------------------------------------------------------------------- void ClrVram(volatile Uint8 *buff) { Uint32 i; for(i=0;i<(512 * 512);i++) buff[i]=0x00; } void wait(long wait) { long i=0; while(i<wait) { i++; } } #endif void SndIntr(void) { SND_RESET_INT(); } static Uint16 dummy_pad=0; void GameVblankIn(void){ /* rfkーh場 */ BlankIn(); } void GameVblankOut(void){ /* rfkーh場 */ BlankOut(); /* pbhfー^取セ */ // PER_GetPort(PortData); } void SetVblank(void){ /* V-Blank願込ンー`o^ */ INT_ChgMsk(INT_MSK_NULL,INT_MSK_VBLK_IN | INT_MSK_VBLK_OUT); INT_SetScuFunc(INT_SCU_VBLK_IN,GameVblankIn); INT_SetScuFunc(INT_SCU_VBLK_OUT,GameVblankOut); INT_ChgMsk(INT_MSK_VBLK_IN | INT_MSK_VBLK_OUT,INT_MSK_NULL); DBG_Initial(&dummy_pad,RGB16_COLOR(31,31,31),0); DBG_DisplayOn(); /* DBG_SetCursol(9, 3 ); DBG_Printf("SBL6 SAMPLE GAME XXX"); */ // PortData = PER_OpenPort(); } /*****************************************************************************/ /* TEh願込ン傷 */ /*****************************************************************************/ void PcmIntr(void) { SND_RESET_INT(); /* 轄槹Xeー^X鎧bg */ if(SND_GET_FCT_INT() == SND_FCT_PCM_ADR){ /* PCM adress更新轄槹ゥ? */ if(SND_GET_INT_STAT() == 0x4){ r_PcmIntr(); l_PcmIntr(); } } } /*****************************************************************************/ /* E`l] */ /*****************************************************************************/ void r_PcmIntr(void) { SND_MoveData(move_pcm_adr, // PCMfー^] (Uint32)0x2000, // 32bitアイン SND_KD_TONE, move_bnk); move_bnk = ~move_bnk & 1; move_pcm_adr += 0x1000; } void l_PcmIntr(void) { SND_MoveData(l_move_pcm_adr, // PCMfー^] (Uint32)0x2000, // 32bitアイン SND_KD_TONE, l_move_bnk + 2); l_move_bnk = ~l_move_bnk & 1; l_move_pcm_adr += 0x1000; }

   vbt Oct 14, 2006 
aif play works but not pcm, still searching

   vbt Oct 14, 2006 
i'll try SMPPCM13.C tomorrow

   dibz Oct 14, 2006 
Cool, keep us updated. I'd help, but I have no idea how to help you with this.

   vbt Oct 15, 2006 
thanks for support


Actually it is stucked in the status start wand never go to the status play_time. Something must be wrong in my settings.


Code:
  
#define PCM_ADDR_1 ((void*)0x25a20000) #define PCM_ADDR_2 ((void*)0x25a40000) #define PCM_SIZE (4096L*2) /* 2.. */ #define RING_BUF_SIZE (1024L*1024L*8) #define MOVIE_BUF_1 ((Sint8 *)0x6030000) PcmCreatePara g_para[1] = { { (struct PcmWork *)&g_movie_work_1, MOVIE_BUF_1, RING_BUF_SIZE, PCM_ADDR_1, PCM_SIZE } }; pcm[0] = createHandle(&g_para[0]); PcmStatus *st = &g_movie_work_1.status; st->ignore_header=ON; st->need_ci = PCM_ON; PCM_INFO_DATA_TYPE(&st->info) = PCM_DATA_TYPE_RLRLRL; PCM_INFO_FILE_TYPE(&st->info) = PCM_FILE_TYPE_NO_HEADER; PCM_INFO_SAMPLING_BIT(&st->info)=16; PCM_INFO_SAMPLING_RATE(&st->info)=(44100L);

   vbt Oct 15, 2006 
Still stucked really nobody can help ?

   vbt Oct 16, 2006 
It seems I have something working I don't see what was wrong my only real change would be the driver version.

   vbt Oct 20, 2006 
file stream works I move to mem stream test

   vbt Oct 21, 2006 
just a question what is the good way to calculate sample_file for a pcm ? It seems it affects the play speed of the pcm.