English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language

 
 
Thread Tools
Old 04 December 2012, 18:28   #1
neoman
Registered User
 
Join Date: Dec 2012
Location: Bergkirchen / Germany
Posts: 38
Distorted sound with ptreplay

Hi there,

today I created a small development environment with vasm, vlink and vbcc on my windows machine. Also I added AgaOS to it (https://github.com/jsvennevid/agaos) which helps me a lot with initialization stuff and so on.

I came very far today, displayed my first copper list and wanted to integrate sound. Some time ago StingRay gave me a ptreplay.s which is fairly easy to integrate. I did that and indeed the sound starts (yes I do mt_music on every vertical blank or after WaitTOF) but it sounds highly distorted.

There is not much source to show except some de-/initialization stuff. Also I'm testing in WinUAE and everything else audio-related is working there.

I uploaded some sources + exe here: http://www.localmindprovider.com/help/

The intro.asm was compiled by vbcc btw, so have a look into intro.c.

I really don't know what's I'm doing wrong there

Thanks!

neoman/titan
neoman is offline  
Old 04 December 2012, 19:09   #2
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,383
Hi Neoman, it's been a while. I suppose it happens with all modules you tried?
StingRay is offline  
Old 04 December 2012, 19:14   #3
neoman
Registered User
 
Join Date: Dec 2012
Location: Bergkirchen / Germany
Posts: 38
StingRaaaay!

Yes, I tried it with sowhat-intro.mod, cebit90.mod and this one

I also tried to set DMA and IRQ stuff on my own but no change. It sounds distorted as if the data written into AUDxDAT gets clipped somehow.
neoman is offline  
Old 04 December 2012, 19:17   #4
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,383
It somehow sounds as if the samples aren't in chip ram but they are. Strange. Need to investigate. =)
StingRay is offline  
Old 04 December 2012, 19:19   #5
neoman
Registered User
 
Join Date: Dec 2012
Location: Bergkirchen / Germany
Posts: 38
Yeah I also checked that but when they were in fast RAM I just heard nothing :P
neoman is offline  
Old 04 December 2012, 20:17   #6
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,383
I checked, your replayer code is broken! Apparently your compiler/assembler optimised it and broke something in the process (probably jump table stuff). Try to disable any optimisations for the replay routine and it should work then. Yet another reason why I always hated opimising Assemblers/Compilers on Amiga!
StingRay is offline  
Old 04 December 2012, 23:06   #7
neoman
Registered User
 
Join Date: Dec 2012
Location: Bergkirchen / Germany
Posts: 38
Happy

StingRay my hero I'll give it a try and also answer back here. Thanks in advance!!
neoman is offline  
Old 04 December 2012, 23:38   #8
neoman
Registered User
 
Join Date: Dec 2012
Location: Bergkirchen / Germany
Posts: 38
Yeah, you were right. It's working now. The optimizer killed some stuff.
  • After mt_ghighpp the ble.s mt_ples
  • Modified many pea destinations here and there
  • After mt_nextpos the blt.s mt_nonewpos
  • After mt_appregio the beq.s mt_arp1 and bra.s mt_arp3

So I investigated that further and noticed that I was not using the current vasm version because I had an old one somewhere in my %PATH% With the current version it works now - even with optimizations. The newest vasm even got a module now to show the optimizations and which ones could be critical. There are none left now and it's working with vasm 1.5c. 1.3 wasn't working.

Thanks for finding that out, StingRay, I'm happy now
neoman is offline  
Old 05 December 2012, 07:34   #9
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,383
No problem. =) After checking your source and exe I couldn't find any reason why the music sounded so strange so I compared the replayers. First I ripped the replayer from your intro and tested it -> same strange sound without any extra code and also a different size compared to the original replayer binary -> replayer broken. Hooray for disassemblers.
StingRay is offline  
Old 05 December 2012, 10:13   #10
neoman
Registered User
 
Join Date: Dec 2012
Location: Bergkirchen / Germany
Posts: 38
I feel I little bit ashamed now because I should have noticed it! I tested some mods now and all are working. Issue solved.
neoman is offline  
Old 05 December 2012, 10:29   #11
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,383
No reason to feel ashamed, that's not really an obvious bug specially when you just started with Amiga coding. Good thing is, it's solved now.
StingRay is offline  
Old 05 December 2012, 12:34   #12
neoman
Registered User
 
Join Date: Dec 2012
Location: Bergkirchen / Germany
Posts: 38
Also, which disassembler do you use?
neoman is offline  
Old 05 December 2012, 13:15   #13
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,383
ReSource which is still the best for Amiga stuff. You can use IDA Pro on PC too but I prefer ReSource.
StingRay 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
Amiga 4000 Sound Distorted and low virge support.Hardware 28 15 July 2018 19:18
The Faerytale Adventure - Distorted Sound Rick Dangerous Retrogaming General Discussion 18 10 April 2013 00:30
[CD-32] [Noob] Distorted CD Audio 79LfL support.WinUAE 2 20 August 2011 14:18
Picasso II distorted output hese support.Hardware 7 17 February 2010 08:46
Distorted sound with Vsync enabled... PowerPie5000 support.WinUAE 37 11 November 2009 21:50

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 03:43.


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