AmigaOS3: selected audio channel is out of range

Find quick help here to get you started with Hollywood
Post Reply
amyren
Posts: 361
Joined: Thu May 02, 2019 11:53 am

AmigaOS3: selected audio channel is out of range

Post by amyren »

I have this game, where my previous version just played its samples without specifying an audio channel.
Then I ran into issues with the android version, so I did change this so they all had audio channel specified.
like this:

Code: Select all

PlaySample(2, {Channel = 2})
This worked well for android and windows versions.
But now when compiling the OS3 version, it will exit with an error: "selected audio channel is out of range"
For debugging, I did use the GetChannels() and etxtout, so I see that there are 8 channels available before the error happens.
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: AmigaOS3: selected audio channel is out of range

Post by airsoftsoftwair »

This is because of the legacy audio driver that is still the default one on AmigaOS 3. The legacy audio driver reserves the first 4 channels for Protracker playback because of the limited CPU power on 68k, Protracker modules aren't mixed down to one channel (as it is done on all other platforms) but they're played through 4 channels as it is usually done on original, Paula-based hardware. This has the advantage that not many CPU cycles are wasted on Protracker playback.

The disadvantage is that you can only use channels 5 to 8 for sample playback on OS3. Alternatively, you can also disable the legacy audio driver by using the "-nolegacyaudio" argument in which case Hollywood on OS3 will behave like on all other platforms (but sound playback might be slower then).
amyren
Posts: 361
Joined: Thu May 02, 2019 11:53 am

Re: AmigaOS3: selected audio channel is out of range

Post by amyren »

That explains the error. But why does getchannels report that there are 8 available channels?
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: AmigaOS3: selected audio channel is out of range

Post by airsoftsoftwair »

amyren wrote: Sat May 09, 2020 10:37 pm That explains the error. But why does getchannels report that there are 8 available channels?
Because there are 8 channels :) It's just that the first 4 are reserved for the legacy Protracker player...
amyren
Posts: 361
Joined: Thu May 02, 2019 11:53 am

Re: AmigaOS3: selected audio channel is out of range

Post by amyren »

Ah. I see now. I should use HaveFreeChannel to check if the channel can be used.
Perhaps it could be mentioned in the docs that those channels are reserved?
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: AmigaOS3: selected audio channel is out of range

Post by airsoftsoftwair »

amyren wrote: Mon May 11, 2020 8:46 pm Ah. I see now. I should use HaveFreeChannel to check if the channel can be used.
Perhaps it could be mentioned in the docs that those channels are reserved?
Yes, that's a good idea. Actually, I thought it was in the doc already but apparently that's not the case. Will add it.
Post Reply