Author Topic: Audio issues - repeating/skipping  (Read 1040 times)

Apolis

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Audio issues - repeating/skipping
« on: February 23, 2018, 05:56:32 pm »
Hi all,

I'm new here. Firstly I want to say Jo Engine is awesome :D I'm so happy to find something like this giving the Sega Saturn scene a lift especially in the homebrew area.

Recently I've been working on a simple Space Invaders style game and I've run into an issue with playing audio files. At first I thought it was just me/my code or the way I'm converting the WAV files to PCM but this is what I've discovered:

When running the 'audio' demo (in the Jo Engine 'Samples' folder) on real hardware, the "blop" sound plays twice each time you press the 'A' button, instead of playing once like it's supposed to. This happens in my game too i.e. all of the sounds play twice instead of once whenever they're triggered (by button presses or by other actions in the game).

As for emulators, if you run the demo in Yabause then the issue isn't there. But if you run it in SSF then the issue exists just like it does on real hardware. Interestingly, if you run it in SSF with 'Auto Field Skip' disabled then the issue goes away (but, of course, games will run too fast).

Has anyone here tried to run the 'audio' demo on real hardware? Any ideas what's causing the issue?


XL2

  • Sr. Member
  • ****
  • Posts: 350
  • Karma: +81/-1
    • View Profile
Re: Audio issues - repeating/skipping
« Reply #1 on: February 23, 2018, 06:07:31 pm »
It's a PAL Saturn?

Apolis

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Audio issues - repeating/skipping
« Reply #2 on: February 23, 2018, 07:19:22 pm »
Yes it is, and I had SSF in Europe mode too. I'll see if switching regions does anything...

Apolis

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Audio issues - repeating/skipping
« Reply #3 on: February 23, 2018, 07:23:38 pm »
It's a PAL Saturn?

Well I'll be damned. In SSF, switching to "America, Canada, Brazil" gets rid of the problem! So what can I do to get sound working properly on PAL systems?...

XL2

  • Sr. Member
  • ****
  • Posts: 350
  • Karma: +81/-1
    • View Profile
Re: Audio issues - repeating/skipping
« Reply #4 on: February 23, 2018, 08:23:57 pm »
I'm not 100% sure, but try changing the makefile to pal and the resolution (in the conf.h) to something like 352x256 (or any pal specific resolution ). I guess it's an issue with the v-synch set at 1/60 instead of 1/50, since you need to DMA the PCM audio.

Apolis

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Audio issues - repeating/skipping
« Reply #5 on: February 23, 2018, 10:39:10 pm »
I'm not 100% sure, but try changing the makefile to pal and the resolution (in the conf.h) to something like 352x256 (or any pal specific resolution ). I guess it's an issue with the v-synch set at 1/60 instead of 1/50, since you need to DMA the PCM audio.

Damn, unfortunately it didn't work. I have the makefile (for the 'audio' demo) as follows:

Quote
JO_COMPILE_WITH_VIDEO_MODULE = 0
JO_COMPILE_WITH_BACKUP_MODULE = 0
JO_COMPILE_WITH_TGA_MODULE = 0
JO_COMPILE_WITH_AUDIO_MODULE = 1
JO_COMPILE_WITH_3D_MODULE = 0
JO_COMPILE_WITH_PSEUDO_MODE7_MODULE = 0
JO_COMPILE_WITH_EFFECTS_MODULE = 0
JO_NTSC = 0
JO_DEBUG = 1
SRCS=main.c
JO_ENGINE_SRC_DIR=../../jo_engine
COMPILER_DIR=../../Compiler
include $(COMPILER_DIR)/COMMON/jo_engine_makefile

and the conf.h file has been edited to change the PAL resolution as so:

Quote
/** @brief Sega Saturn PAL Screen resolution (internal use) */
# define JO_TV_RES                     (TV_352x256)
/** @brief PAL Screen width */
# define JO_TV_WIDTH                  (352)
/** @brief PAL Screen width divided by 2 (math optimization purpose) */
# define JO_TV_WIDTH_2                  (176)
/** @brief PAL Screen width divided by 4 (math optimization purpose) */
# define JO_TV_WIDTH_4                  (88)
/** @brief PAL Screen height */
# define JO_TV_HEIGHT                  (256)
/** @brief PAL Screen height divided by 2 (math optimization purpose) */
# define JO_TV_HEIGHT_2                  (128)
/** @brief PAL Screen height divided by 4 (math optimization purpose) */
# define JO_TV_HEIGHT_4                  (64)

with SSF set to 'Europe' but it's still having the sound issue. (I can burn the image to CD and play it on my Saturn to clarify but considering the results of my previous tests I'm confident SSF is accurate in this case). Additionally, according to nVidia's FPS counter, I can confirm the frame rate is 50 FPS as expected.

However, there is also a JO_FRAMERATE option but I can't find any documentation on it...

Anyway, I'll keep trying things but if you or anyone else has any further ideas please let me know and thanks for your help so far :)

XL2

  • Sr. Member
  • ****
  • Posts: 350
  • Karma: +81/-1
    • View Profile
Re: Audio issues - repeating/skipping
« Reply #6 on: April 08, 2018, 01:39:49 am »
I hope you didn't give up on your project, but using the tone editor on a mac emulator you could load your audio to the audio RAM, avoiding the PCM DMA transfer, which should fix your issues.
It's quite complicated to setup, but I can help you with it.

Apolis

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Audio issues - repeating/skipping
« Reply #7 on: April 12, 2018, 11:02:30 pm »
I hope you didn't give up on your project, but using the tone editor on a mac emulator you could load your audio to the audio RAM, avoiding the PCM DMA transfer, which should fix your issues.
It's quite complicated to setup, but I can help you with it.

Hi XL2,
No no, I didn't give up. I carried on working on it and just playing it in NTSC via an emulator. It would be really nice to get it working on a real PAL system. Unfortunately I'm not too confident I understand your solution but I'll give it a go if you're willing help, or at least get me started! :D

 

Sitemap 1 2 3 4 5 6 7 8 9 10 
SMF spam blocked by CleanTalk