Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - LackofTrack

Pages: [1] 2
1
Project announcement / Re: Sonic Z-Treme
« on: August 19, 2018, 09:31:20 am »
I'm using SBL for the audio.
You mean only the left or right speaker is outputting cd audio?

No I mean both channels are being "squished" into the center as if the audio was mono. Also If you are using SBL I think the correct command is:
Code: [Select]
SND_SetCdDaPan(-15, 15);

2
Project announcement / Re: Sonic Z-Treme
« on: August 19, 2018, 07:45:11 am »
Hey XL2, kind of a little late but, listening to your SAGE preview video I just realized that your CD audio is mono. I think it is because you have your slCDDAOn Command like this:
Code: [Select]
slCDDAOn(127, 127, 0, 0);
When it should look this:
Code: [Select]
slCDDAOn(127, 127, -127, 127);
Please correct me if I'm wrong though.

3
General Jo Engine Help / Re: Request for real hardware tests
« on: July 05, 2018, 09:11:17 am »
I tested the iso on my Japanese Model 2. On all the 3 test tries I did, at about 1 minute and 42 seconds in static began to appear in the song.
Also the song doesn't stop correctly and keeps repeating the last second of itself. A brief look at the code and it looks fine.
I wonder why the problem occurs only on real hardware.

4
Yeah. Rockin'B's sound player definitely proves that mixing the two libraries is possible, but when I looked through the source code I found the player only plays AIF and Adpcm that already have a header. I think for now you should see if you can get AIFs to play as that seems a lot easier to playback compared to XA audio, but that's for you to decide.  :)

5
After looking at your code I noticed a few things off about it. So I made some adjustments to it. Please review it.
Code: [Select]
#ifndef __AUDIO_H__
#define __AUDIO_H__

#define SECTOR_SIZE     (2324L)
#define RING_BUF_SIZE  (2324L*10)
#define PCM_ADDR  ((void*)0x25a20000)
#define PCM_SIZE  (4096L*4)

#define SMP_1TASK_SAMPLE (1024)
#define SMP_TR_MODE_CD (PCM_TRMODE_SCU)
#define SMP_LOAD_NUM (10)

#define SND_RAM (94371840)
#define LW_RAM (2097152)

//Functions go here
void adpcm_load(void);



#endif

//audio.c
//this file is compiled separately
#include <jo/jo.h>
#include "audio.h"

//goals:
//Apparently, this file is CD-ROM XA.
void adpcm_load(void){
/* Work  */
PcmWork  pcm_work;
PcmCreatePara para;
/* Ring Buffer  */
Uint32  ring_buf[RING_BUF_SIZE / sizeof(Uint32)];
// Handles
StmHn       stm;
PcmHn       pcm;
StmGrpHn stmfpcm;
StmKey key;
PcmInfo info;
Sint8* name = "SHELL.ADP";
Sint32 fid = GFS_NameToId(name);

//Data of read in process
Sint32 rdsize;

/* Set Interrupt Process */
// Use
 // INT_???
// and set V-Blank IN interrupt.
// Call
 // PCM_VblIn();
// within V-Blank IN interrupt.

/* File initialization */
stmfpcm = STM_OpenGrp();
STM_SetExecGrp(stmfpcm);
STM_KEY_FN(&key) = STM_KEY_CN(&key) = STM_KEY_SMMSK(&key) =
STM_KEY_SMVAL(&key) = STM_KEY_CIMSK(&key) = STM_KEY_CIVAL(&key) =
STM_KEY_NONE;
//FOR CDROM XA
STM_KEY_SMMSK(&key) = STM_KEY_SMVAL(&key) = 0x04;/* Audio Sector */
STM_KEY_CN(&key) = 0; /* channel No. */

/* Open Stream */
stm = STM_OpenFid(stmfpcm, fid, &key, STM_LOOP_NOREAD);

/* Create Handle */
PCM_PARA_WORK(&para) = &pcm_work;
PCM_PARA_RING_ADDR(&para) = ring_buf;
PCM_PARA_RING_SIZE(&para) = RING_BUF_SIZE;
PCM_PARA_PCM_ADDR(&para) = PCM_ADDR;
PCM_PARA_PCM_SIZE(&para) = PCM_SIZE;
pcm = PCM_CreateStmHandle(&para, stm);
//SET PCM INFO FOR ADPCM
typedef struct  {
    PCM_INFO_FILE_TYPE;
    PCM_INFO_DATA_TYPE;
    //  Sint32 file_size;           how big is your file in bytes?
    //  Sint32 channel;             how many channels does your file have? '1' if mono '2' if stereo.
    //  Sint32 sampling_bit;        based on your comment I think this is 16.
    //  Sint32 sampling_rate;       in your case this is 18900.
    //  Sint32 sample_file;         I think this is asking for how many samples are in your file. In order to check this
    //                                         use a program like audacity.
    //  Sint32 compression_type;    I don't actually know what this is asking for and have no idea what to put here. 
}   PcmInfo;
PCM_INFO_FILE_TYPE(&info) = PCM_FILE_TYPE_NO_HEADER;
PCM_INFO_DATA_TYPE(&info) = PCM_DATA_TYPE_ADPCM_SCT;
PCM_SetVolume(pcm, 7);
PCM_SetInfo(pcm, &info);
PCM_SetLoadNum(pcm, SMP_LOAD_NUM);
PCM_SetTrModeCd(pcm, SMP_TR_MODE_CD);
PCM_Set1TaskSample(pcm, SMP_1TASK_SAMPLE);
PCM_ChangePcmPara(pcm);
/* Start Playback */
PCM_Start(pcm);
while(TRUE) {
STM_ExecServer();
rdsize = STM_GetNumCdbuf(stm);
jo_printf(0, 0, "(%i)", rdsize);
/* Playback task processing */
PCM_Task(pcm);
/* End condition */
if (PCM_GetPlayStatus(pcm) == PCM_STAT_PLAY_END) break;
if(jo_is_pad1_key_pressed(JO_KEY_A)){
break;
}
}
/* Destroy Handle */
PCM_DestroyStmHandle(pcm);
/* Close stream */
STM_Close(stm);
/* End Processing */
PCM_Finish();

}

Also if ADPCM doesn't work out for you in the end I'd probably just try to play AIFF files(Seems a lot easier to play compared to ADPCM) or even CD-DA files if your project allows it.

6
I don't think the CD needs to be formatted as Mode 2 Form 2. I'm pretty sure this is only for Photo/Video CDs.
When you say commenting out one of the XA key lines makes the program work in SSF, does that mean it plays sound?

7
General Jo Engine Help / Re: CD-DA Audio in Jo is broken...?
« on: June 26, 2018, 12:10:47 am »
That's weird. Mednafen should work with Windows 7. Did you download it from the official site?
Also I recommend you use the Mednaffe GUI. It's what I personally use and it works great for me.

8
 :) That is the Sega XA ADPCM encoder I'm taking about. It outputs a XA audio file with no header. So you are using XA audio. Also CD-XA has nothing to do with the fact that you are using an iso.
CD-XA will work perfectly fine in a iso.(CD-XA is within the iso itself. CD-DA is not actually in the iso. You have to use a cue file in order to tell the iso to use your CD-DA files.)

9
Are you using the XA ADPCM audio encoder by Sega for Mac? If So then you need to use the function 'PCM_SetInfo'. The files the XA encoder outputs doesn't have a header
so you need to specify the audio information. Also I'm pretty sure you can only use Stream playback mode when using XA audio.

10
I thought the CPU overhead they were referring to was one of the SH2 processors.
It would be a relief if they were talking about the M68k processor, but if that's the case then what's stopping you from doing 44khz ADPCM? It is only has about 30% CPU overhead.(What else would the M68k processor be doing besides this?)

11
22 khz ADPCM is pretty impressive. You save quite a lot of space with it compared to Redbook audio and it doesn't sound that bad either.
Only problem with it is the amount of CPU overhead it takes.

12
Awesome work ponut64! Hopefully this will be able to make more people use the SBL ADPCM library now.

13
General Jo Engine Help / Re: CD-DA Audio in Jo is broken...?
« on: June 21, 2018, 06:49:12 am »
Have you guys tried the emulator Mednafen? I just downloaded the latest release of Jo engine and used mednafen and the audio demo worked perfectly for me.

14
Project announcement / Re: Sonic Z-Treme
« on: April 06, 2018, 12:38:22 am »
Burning Rangers uses ADX audio which is able to play multiple tracks at once. How many I don't know.
Looking at the files it seems most of the music in BR is definitely not "Redbook Audio" quality. Most of them are only 22500hz which is also the sample rate for speech used in the game.
The sample rate's probably low to reduce the CPU workload. There are however some 44000hz (RedBook) songs in there. They seem to be only used for non CPU intensive areas (Menus, Title screen, etc).

Thanks.
But if anyone wants to do it, it would be more than welcome for the whole community!
I need to finish the model converter I promised and continue working on the engine for a long overdue update.

Edit : Just added an image of PCM-ADPCM CPU overhead. Note that playing small sounds from memory is less expensive since you don't need to transfer data from the CD, but it still requires DMA and hogs the B-Bus.

I know this table data. :)

But I have a doubt. The overhead are for 1x SH2, for 2x. For the M68000? For all?

And more. The formula use it to calculate this value % is this: R = (100 X Ttask) / Tplay

Whit this, really not know, which CPU refer, or quantity of cycles used for DMA transfers or decompress the ADPCM data... And another doubt is, use it DMA transfers via SCU or directly SH2 to 68EC000 or SCSP. Or both.


Last. ADX form CRI, is possible better implementation of ADPCM for SS. Burning Rangers or Deep Fear, play BGM all time, and use it also for speech or dialogues. I don’t know if is possible play more than one stream or more, play directly from RAM and mix "like" PSX. I cant find the SS library functions form ADX in the web.

Greetings!

Corvusd is definitely right. The data chart doesn't really do a good job at explaining what's happening to what.
Although I assume when it refers to CPU overhead it refers to the M68000. This is just a guess though.

15
Project announcement / Re: Sonic Z-Treme
« on: April 05, 2018, 12:47:34 am »
Ah. Gotcha. Well I hope you succeed in doing so. It would be really impressive for a Saturn homebrew to feature sequences.
I don't think that's ever been accomplished before. Good Luck!

Pages: [1] 2
SMF spam blocked by CleanTalk