English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 26 March 2020, 18:55   #1
MacSpain
Registered User

 
Join Date: Jan 2020
Location: Poland
Posts: 7
Problem with MOD playback in game on real Amiga

Hi everyone!

I'm developing a game in the C language, using GCC, and KaiN's ACE engine https://github.com/AmigaPorts/ACE. I do have a mod with music to play in-game, and managed to implement both ptplayer, and p61 routines for that purpose, to compare them. When testing the game on WinUAE the music plays fine and smooth. However, when I try and test it on my A1200, the music is glitchy. The timing is fine, but every like half a second it seems to "lose" a random channel for a moment, and it's that way using both routines.

Any help will be appreciated.
MacSpain is offline  
Old 26 March 2020, 19:17   #2
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,598
This sounds like the same problem which Slamy first reported to me from a beta tester for his "Tiny Little Slug". It was an A1200 as well. Seems that the hardware is strange...

The problem turned out to be that a delay of 496 ticks is not enough for the lowest notes, before audio-DMA is reenabled. So we settled for 576 ticks now, which fixed it.

The new ptplayer version 5.4 is not yet released, but you can fix that locally by replacing the two occurences of "496" in ptplayer.asm with "576".

I really should do the release now...
Code:
5.4:
- New function _mt_samplevol may be used to redefine a sample's volume.
- Wait 576 ticks for audio DMA instead of 496, which fixes issues with
  low notes on a few A1200 configurations. (No, this doesn't harm the
  player's performance, as it is a timer interrupt.)
- Minor optimizations.
(UNRELEASED)
phx is offline  
Old 26 March 2020, 19:29   #3
MacSpain
Registered User

 
Join Date: Jan 2020
Location: Poland
Posts: 7
Quote:
Originally Posted by phx View Post
This sounds like the same problem which Slamy first reported to me from a beta tester for his "Tiny Little Slug". It was an A1200 as well. Seems that the hardware is strange...

The problem turned out to be that a delay of 496 ticks is not enough for the lowest notes, before audio-DMA is reenabled. So we settled for 576 ticks now, which fixed it.

The new ptplayer version 5.4 is not yet released, but you can fix that locally by replacing the two occurences of "496" in ptplayer.asm with "576".

I really should do the release now...
Code:
5.4:
- New function _mt_samplevol may be used to redefine a sample's volume.
- Wait 576 ticks for audio DMA instead of 496, which fixes issues with
  low notes on a few A1200 configurations. (No, this doesn't harm the
  player's performance, as it is a timer interrupt.)
- Minor optimizations.
(UNRELEASED)
Tried it, didn't help. Should I increase this even further or is it pointless?
MacSpain is offline  
Old 26 March 2020, 19:42   #4
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,598
576 is already a lot. It doesn't hurt to try, but then it is probably a different problem.

The next step would be to find out if it always happens at the same positions in the song and try to isolate them. Maybe the song was written on a PC-tracker and uses features which are simply not supported by Protracker?

Last edited by phx; 26 March 2020 at 19:46. Reason: Some more hints.
phx is offline  
Old 26 March 2020, 21:30   #5
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 48
Posts: 3,629
576 is how many vertical beam counts BTW? I'm using a raster delay in my fixes. i'm using 7 raster waits.

Do you have to wait when enabling audio DMA or just when disabling it?
jotd is online now  
Old 26 March 2020, 22:31   #6
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,598
Quote:
Originally Posted by jotd View Post
576 is how many vertical beam counts BTW? I'm using a raster delay in my fixes. i'm using 7 raster waits.
That's much too little! You will have problems with notes in the lowest octave. The standard always was around 10 raster lines, which is approximately 496 ticks. Now 576 ticks is more than 12 and a half line on a PAL screen.


Quote:
Do you have to wait when enabling audio DMA or just when disabling it?
The procedure is:
  • disable audio DMA (set new period and sample)
  • reenable audio DMA after the delay
  • set new sample pointer for repeat/idle after the same delay
phx is offline  
Old Yesterday, 00:18   #7
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 48
Posts: 3,629
Roadkill doesn't use any delays, and when it uses some, it uses 3 raster lines! no wonder why some people report that the sound is completely broken. Thanks
jotd is online now  
Old Yesterday, 19:06   #8
MacSpain
Registered User

 
Join Date: Jan 2020
Location: Poland
Posts: 7
Ok, some update. I tried playing different mods in my game, and the work without a hitch, so there's most likely a problem with the particular MOD that I'm trying to use. What are the possible reasons for such issue that are MOD related?

EDIT: Nevermind. Found one with the same problem.

Last edited by MacSpain; Yesterday at 19:12.
MacSpain is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
"EaglePlayer" playback VS "real" playback chip support.Other 30 06 January 2020 20:46
Using this forum on real Amiga problem lukassid project.EAB 8 10 November 2013 14:44
ClassicWB OS3.9 problem on Real Amiga Echelon project.ClassicWB 16 31 March 2009 23:17
CIA timer interrupt handler called twice during mod playback absence Coders. General 5 16 March 2009 19:55
Playback problem from recording RickyC support.Other 0 31 May 2007 14:38

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:52.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.08138 seconds with 14 queries