Xref: utzoo comp.sys.amiga.programmer:2335 comp.sys.amiga.audio:507 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!sunic!ugle.unit.no!eik.ii.uib.no!lilje.uib.no!newshost.hsr.no!newshost.hsr.no!leikvoll From: leikvoll@newshost.hsr.no (Morten Leikvoll) Newsgroups: comp.sys.amiga.programmer,comp.sys.amiga.audio Subject: Re: playing samples using audio h/w Message-ID: <1991Apr4.105643.3567@hsr.no> Date: 4 Apr 91 10:56:43 GMT References: <2325@m1.cs.man.ac.uk> <8203@crash.cts.com> Sender: news@hsr.no Reply-To: leikvoll@newshost.hsr.no (Morten Leikvoll) Organization: Rogaland University Center Lines: 42 In article you write: |> Here's a quick look at how to do this: |> |> ; Brief excerpt showing how to stop DMA sound and play another. |> ; Although this example busy waits, it's still faster than the |> ; audio.device. An interrupt scheme is faster (and more elegant). |> 01|> move.w d2,intena(a0) ; disable 7-10 (aud) interrupts 02|> move.w d2,intreq(a0) ; clear any 7-10 interrupts 03|> 04|> move.w d6,dmacon(a0) ; shut off dma for channel 05|> move.w #0,ac_dat(a3) ; write directly to output (to stop) 06|> move.w #1,ac_per(a3) ; fast period (less waiting) 07|> move.w #$c000,intena(a0) ; enable 08|> wasteloop 09|> move.w intreqr(a0),d5 ; wait for interrupt 10|> and.w d2,d5 ; test against current mask 11|> cmp.w d2,d5 12|> bne.b wasteloop ; not yet occurred 13|> ; Interrupt has occured, channel is stopped. 14|> move.w d2,intreq(a0) ; clear 7-10 interrupt |> |> ; Write values to regs here, then turn on dma... |> |> John I tried to make my own music player once (gave it up), and I did almost the same you do here. I hope anybody knows the answer to some of these questions: - Do you know if it's really necessary to have line 05? The DMA writes to this register and I thought it gave an interrupt just after writing the last word. Does the interrupt cycle take too long ? - Do you need line 07 ? You do disable the audio interrupts (line 01) - My routine gave frequently double interrupts. Have you got any idea what could be the reason for that? ------------------------------------------------------------------------------- Morten Leikvoll | leikvoll@hsr.no | (empty space) | -------------------------------------------------------------------------------