English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 08 February 2023, 09:53   #1
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
Schedule an interrupt upon IO completion

I'm making an app where it needs to play audio and display graphics, near-constantly, at the same time.

The graphics just need their
MainLoop()
function to be called often enough and they'll work, the audio is double buffered so it only needs action once the audio is complete, but that action needs to be near instant.

How do I schedule an interrupt to occur once the audio's IO request completes?
Steam Ranger is offline  
Old 08 February 2023, 13:35   #2
Niklas
Registered User
 
Join Date: Apr 2018
Location: Stockholm / Sweden
Posts: 129
Quote:
Originally Posted by Steam Ranger View Post
I'm making an app where it needs to play audio and display graphics, near-constantly, at the same time.

The graphics just need their
MainLoop()
function to be called often enough and they'll work, the audio is double buffered so it only needs action once the audio is complete, but that action needs to be near instant.

How do I schedule an interrupt to occur once the audio's IO request completes?
audio.device will do ReplyMsg() on the IOAudio request once audio.device is done playing that request's data. You can configure your reply port so that it either 1. sets a signal for your task (using PA_SIGNAL) and then use a regular Wait() event loop, or 2. triggers a soft interrupt (using PA_SOFTINT).

If you use CreatePort() to create the reply port then it will allocate a task signal and set PA_SIGNAL for you (https://github.com/noname22/NeoDICE/...b/createport.c). If you want to use PA_SOFTINT instead I think you will have to create the reply port yourself.
Niklas is offline  
Old 08 February 2023, 15:00   #3
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,231
Maybe to clarify this a bit: An audio IOrequest completes once the audio device could successfully load your request into the hardware. That is, it completes when the sample you requested starts playing - not when it ends playing it. Otherwise, what Niklas said is correct of course. Signals are usually easier to handle than the interrupt business.
Thomas Richter 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
Bootblock completion function hop Coders. System 15 05 June 2022 13:07
Blitter interrupt during VERTB interrupt phx Coders. Asm / Hardware 38 01 October 2021 19:54
Tab Completion in AmigaDOS robotriot support.Apps 5 04 January 2019 12:33
New release schedule Cassiel project.TOSEC (amiga only) 11 19 July 2012 22:20
EMPL Schedule TCD EAB's competition 5 05 June 2009 10: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 02:37.

Top

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