Is DuskOS planning to support sound for uxn applications?
I've been reading through the documentation and the mailing list
archives and audio isn't discussed much, if at all.
> Is DuskOS planning to support sound for uxn applications?> I've been reading through the documentation and the mailing list> archives and audio isn't discussed much, if at all.
I don't think that DuskOS proper has audio support yet! If you want, you
could theoretically implement it :>
--
Arcade Wise (they/them)
<arcades.agency>
> I don't think that DuskOS proper has audio support yet! If you want, > you could theoretically implement it :>
I'd like to, but I don't know where I would start.
I have little experience with systems programming, and have no
experience with developing an audio stack. I'm just starting to
get comfortable with FORTH. Does anyone recommend any resources?
I've found a book and a video from a stackoverflow post.
https://openlibrary.org/books/OL683184M/A_programmer%27s_guide_to_soundhttps://xiph.org/video/vid1.shtml
On Thu, May 11, 2023, at 12:30 AM, eril wrote:
>> I don't think that DuskOS proper has audio support yet! If you want, >> you could theoretically implement it :>> I'd like to, but I don't know where I would start.> I have little experience with systems programming, and have no > experience with developing an audio stack. I'm just starting to> get comfortable with FORTH. Does anyone recommend any resources?> I've found a book and a video from a stackoverflow post.> https://openlibrary.org/books/OL683184M/A_programmer%27s_guide_to_sound> https://xiph.org/video/vid1.shtml
I don't know anything on the topic of sound on a computer, but if you're
interested in such development within Dusk, the door is wide open!
Regards,
Virgil
Hello eril,
Am 11.05.2023 um 20:11 schrieb Virgil Dupras:
> On Thu, May 11, 2023, at 12:30 AM, eril wrote:>>> I don't think that DuskOS proper has audio support yet! If you want,>>> you could theoretically implement it :>>> I'd like to, but I don't know where I would start.>> I have little experience with systems programming, and have no>> experience with developing an audio stack. I'm just starting to>> get comfortable with FORTH. Does anyone recommend any resources?>> I've found a book and a video from a stackoverflow post.>> https://openlibrary.org/books/OL683184M/A_programmer%27s_guide_to_sound>> https://xiph.org/video/vid1.shtml>> I don't know anything on the topic of sound on a computer, but if you're> interested in such development within Dusk, the door is wide open!
BIOS does not provide any sound abstractions (nor does UEFI) if you want
to make more fancy sound than just beeps through the PC speaker.
So if you want to add sound support to Dusk OS you would have to target
a specific sound card.
Sound Blaster 16 was a pretty ubiquitous sound card, which is also
emulated in lots of emulation/virtualization software, and comes with
the benefit that it uses fixed (jumper-configured) hardware resources,
so you don't have to do any Plug'n'Play enumeration to find it.
Generally, to play sampled sound on PC platform, you need to talk to
different chips:
Set up the DMA controller to send a specific memory region repeatedly to
the DMA channel that your sound card uses. I don't think that Dusk OS
already uses the DMA controller for anything.
Set up the sound card to play the sound it receives (and configure audio
format, bit rate, mono/stereo).
Whenever the sound card has played half of the DMA buffer, it will
trigger an interrupt/IRQ which will be responsible to fill the half of
the buffer which was just played with new data, or tell the sound card
to stop at the end of the already filled buffer.
The data is not MP3 or anything fancy, but just raw samples (i.e. in
case of 8-bit audio, single bytes which represent the wave form). In
case of stereo, left and right channel have their samples interleaved.
You will probably find articles on how to program the Sound Blaster 16
to play a simple sample or wave file.
But if you e.g. want to play music (like MOD files or the Varvara audio
device) you will also have to take care about how you can transpose the
sample and adjust the volume. You will have to do that in software in
the code that "copies" the sample into the DMA buffer.
Unfortunately, I don't know of any good tutorials (I learned it from a
German book that I read in the '90s when I was a kid).
Hope that helps,
Michael