English Amiga Board


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

 
 
Thread Tools
Old 30 March 2013, 18:18   #1
obiwanken
Registered User
 
Join Date: Jan 2013
Location: Slovakia
Posts: 27
Simple sample player (no DMA)

Hi
I want to play samples using no DMA.
is it possible ?

For example (not working):

;---------------------------------------------------------------------
lea Sound(pc),a0
move.l #(SoundEnd-Sound)/2,d0
move.w #$0040,$dff0a8 ; Aud0vol
move.w #$0080,$dff0a6 ; Aud0Per
Loop
move.w (a0)+,$dff0aa ; Aud0dat

move.w #$0100,d1 ; Pause
Wait
dbra d1,Wait

sub.l #$0001,d0
bne Loop
rts

Sound
incbin "dh1:work/samples/crom_16khz.snd"
SoundEnd
;--------------------------------------------------------------------
What's wrong, any suggestions ?
Thanks.
obiwanken is offline  
Old 30 March 2013, 18:32   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 23,912
You need to clear channel's interrupt request bit. Writing to AUDxDAT does nothing if interrupt request is set.

btw, much better method is to wait for channel's interrupt bit (poll INTREQR), clear it immediately, write next word to AUDxDAT and so on.
Toni Wilen is offline  
Old 30 March 2013, 18:38   #3
Asman
68k

Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 727
Quote:
Originally Posted by obiwanken View Post
What's wrong, any suggestions ?
Sound is in CHIP memory I guess. If not then use SECTION sfx,DATA_C.
Asman is offline  
Old 30 March 2013, 18:43   #4
obiwanken
Registered User
 
Join Date: Jan 2013
Location: Slovakia
Posts: 27
Many thanks , now working !

Just one line added and result is awesome.
obiwanken is offline  
Old 30 March 2013, 19:55   #5
Thorham
Computer Nerd

Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 44
Posts: 3,089
Quote:
Originally Posted by Asman View Post
Sound is in CHIP memory I guess. If not then use SECTION sfx,DATA_C.
Audio data only has to be in chipmem if you're going to use audio DMA. For CPU playback, data can be anywhere
Thorham is offline  
Old 30 March 2013, 20:46   #6
obiwanken
Registered User
 
Join Date: Jan 2013
Location: Slovakia
Posts: 27
Yes audio data is in FastMem.
Thanks.
obiwanken is offline  
Old 08 April 2013, 09:58   #7
leonard
Registered User
leonard's Avatar
 
Join Date: Apr 2013
Location: paris
Posts: 56
Quote:
Originally Posted by obiwanken View Post
Many thanks , now working !

Just one line added and result is awesome.
Hi!

I wonder why you need to play sample by polling and using CPU only. Is it only to "demonstrate" something, or is there a special interest? I'm curious about it.
leonard is offline  
Old 08 April 2013, 10:07   #8
CFOU!
Moderator
CFOU!'s Avatar
 
Join Date: Sep 2004
Location: France
Age: 47
Posts: 2,846
Quote:
Originally Posted by leonard View Post
Hi!

I wonder why you need to play sample by polling and using CPU only. Is it only to "demonstrate" something, or is there a special interest? I'm curious about it.
I'am interested too by the answer
CFOU! is offline  
Old 09 April 2013, 19:01   #9
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL
Posts: 1,691
Quote:
Originally Posted by leonard View Post
Hi!

I wonder why you need to play sample by polling and using CPU only. Is it only to "demonstrate" something, or is there a special interest? I'm curious about it.
Higher sampling rates, override CHIP limitations, increase number of the independent audio channels etc.
pandy71 is offline  
Old 10 April 2013, 14:13   #10
leonard
Registered User
leonard's Avatar
 
Join Date: Apr 2013
Location: paris
Posts: 56
Quote:
Originally Posted by pandy71 View Post
Higher sampling rates, override CHIP limitations, increase number of the independent audio channels etc.
Oh I see, but you just write two 8 bits samples with a 16bit write, right? why don't you write this to a small buffer, played by PAULA at the highest freq? So you keep have your own CPU mixing routine.

I just realized you can use the same trick as with ATARI-ST digisound: you can use several PAULA voices to play a "more than 8bits" sample.
leonard is offline  
Old 10 April 2013, 14:15   #11
CFOU!
Moderator
CFOU!'s Avatar
 
Join Date: Sep 2004
Location: France
Age: 47
Posts: 2,846
Quote:
Originally Posted by pandy71 View Post
Higher sampling rates, override CHIP limitations, increase number of the independent audio channels etc.
i had not thougth to that!!! very interesting
CFOU! is offline  
Old 10 April 2013, 16:34   #12
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL
Posts: 1,691
Quote:
Originally Posted by leonard View Post
Oh I see, but you just write two 8 bits samples with a 16bit write, right? why don't you write this to a small buffer, played by PAULA at the highest freq? So you keep have your own CPU mixing routine.

I just realized you can use the same trick as with ATARI-ST digisound: you can use several PAULA voices to play a "more than 8bits" sample.
As Paula have limited amount DMA time slots there is no way to reproduce more than 4 voices in hardware unless you accept lower sampling speed (worse quality) - with CPU however time interleaving should be possible thus more "independent" channels.

Higher sampling rate means or ECS/AGA or tricks in OCS with horizontal line shortening or CPU (Copper) software driven AUDxDAT.

Higher resolution than 8 bit imply use 2 DMA channels + calibration (never perform any measurements what kind of accuracy can be achieved in this way - i assume something between 10 and 12 bits should be possible - with modern PC sound card used as a audio analyzer perhaps this calibration can be performed even better than previously and 12 - 13 bits sounds reasonable).

Still i believe that 8 bit with dithering and noiseshaping can provide higher quality than combined 2 Paula channels with pseudo 14 bit mode.

If CPU can be replaced by synchronous and cycle accurate Copper then most of the Paula (Agnus) limitations can be override.
pandy71 is offline  
Old 17 April 2013, 13:50   #13
8bitbubsy
Registered User

8bitbubsy's Avatar
 
Join Date: Sep 2009
Location: Norway
Posts: 1,385
Quote:
Originally Posted by leonard View Post
[...]
I just realized you can use the same trick as with ATARI-ST digisound: you can use several PAULA voices to play a "more than 8bits" sample.
How?
8bitbubsy is offline  
Old 18 April 2013, 20:17   #14
obiwanken
Registered User
 
Join Date: Jan 2013
Location: Slovakia
Posts: 27
Quote:
Originally Posted by leonard View Post
Hi!

I wonder why you need to play sample by polling and using CPU only. Is it only to "demonstrate" something, or is there a special interest? I'm curious about it.
Yes, for "demostrate", I want to play "Africa by Toto" song (4650 kb lenght).
obiwanken is offline  
Old 17 May 2013, 14:24   #15
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL
Posts: 1,691
Sorry for using this topic but can be closely related - i have strange idea how to play in non-DMA mode with DMA active.

General principle how Paula works is quite clear:

If period value is to low - last data stored in AUDxDAT register are repeated.

Is there any chance to set 1 word DMA in AUDxLEN, data for example $0000 word (or similar) in CHIP RAM location addressed by ADUxLCH/L, set period higher than maximum supported by normal DMA, then manually (CPU - Copper) write to ADUxDAT data words in regular time slots to increase sampling frequency?
pandy71 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
BZR Player - a new music player for Win bLAZER Retrogaming General Discussion 968 14 July 2020 23:49
FAT Player MikMod v5 (amiga mod player for Nintendo DS) spajdr Amiga scene 0 14 August 2008 21:55
Simple two player games ? eternalcrusader Retrogaming General Discussion 25 24 April 2007 11:50
DMA Cards alewis support.Hardware 11 12 January 2007 15:01
AMIGA1200 as a Sample-Player? Ebster support.Apps 0 19 November 2006 13:05

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 04:46.


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