English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 18 April 2021, 12:23   #1
Csoft
Registered User
 
Join Date: Apr 2021
Location: Italy
Posts: 21
Exclamation Audio emulation fidelity on FS-Uae

Hello folks,

my first message here. I'm developing a little Amiga game in full 68k assembly. I've always coded on real hardware, this time for the first time I cross compiled targeting fs-uae under MacOS.

I'm puzzled with a really weird problem: sound playback. As you know, stopping a sound after you started playing is a bit brutal on Amiga, you have to wait scanlines and then set the audiopointer to a zero buffer in memory (there are other methods involving interrupts but I didn't tried it yet, actually I start audio playback then point to zero buffer the next vbl). I did it in this way and it works perfectly under fs-uae, but it doesn't work under a real Amiga 1200 and under WinUAE.

It's clear that I'm doing something wrong on my implementation (since it doesn't work on real hardware), but the fact that in fs-uae this works misled me to think that it was fine.

This makes me think that fs-uae is not perfectly exact on audio hardware behaviour, because it doesn't show the bug in my code but it make my code work even when it shouldn't.

Obviously I have to fix my code, but I'd love to do it with fs-uae, is there some configuration I can set to make fs-uae more "cycle exact"?

Thank you

Lorenzo
Csoft is offline  
Old 18 April 2021, 13:56   #2
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
Quote:
Originally Posted by Csoft View Post
have to wait scanlines and then set the audiopointer to a zero buffer in memory
How man scanlines?

Quote:
I did it in this way and it works perfectly under fs-uae, but it doesn't work under a real Amiga 1200 and under WinUAE.
When I did my ptplayer I calculated using the HRM that 496 CIA ticks should be sufficient for an Audio DMA to occur, even with the lowest playback frequencies.
In reality that failed on some A1200 models. They required up to 550 ticks. No idea why. So maybe you just have to increase your delay for this A1200. I settled on 576 ticks.
phx is offline  
Old 18 April 2021, 20:21   #3
Csoft
Registered User
 
Join Date: Apr 2021
Location: Italy
Posts: 21
Thank you for your response.

Quote:
Originally Posted by phx View Post
How man scanlines?
Don't know, I wait for the next vertical blank to point to the zero buffer.

Quote:
When I did my ptplayer I calculated using the HRM that 496 CIA ticks should be sufficient for an Audio DMA to occur, even with the lowest playback frequencies.
In reality that failed on some A1200 models. They required up to 550 ticks. No idea why. So maybe you just have to increase your delay for this A1200. I settled on 576 ticks.
Ok, I'll give it a try. But the other question remains: why fs-uae makes my (bad) code work even if it shouldn't?

I have always thought that the emulation of fs-uae was perfectly cycle exact!
Csoft 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
Looking for the most accurate Paula audio emulation craig64 support.Other 69 23 July 2023 19:36
Configuration for best sound fidelity? Leandro Jardim support.WinUAE 7 29 November 2019 17:32
Possible enhancements to Paula audio emulation Dr.Venom support.WinUAE 18 20 January 2019 15:02
how to prevent windows audio cd playpack during emulation? honx support.WinUAE 24 11 December 2018 10:48
Erratic CD Audio in CD32 Emulation sean_skroht support.WinUAE 9 11 May 2012 16:57

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 05:32.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.06824 seconds with 15 queries