Re: ASC/EASC audio device

Mark Cave-Ayland <[email protected]> Wed, 1 Mar 2023 07:14:50 +0000
Newsgroups gmane.os.netbsd.ports.mac68k
Message-ID <[email protected]>
On 18/02/2023 16:03, Nathanial Sloss wrote:

> Greetings,
> 
> Please see the diff at: ftp://ftp.netbsd.org/pub/NetBSD/misc/nat/asc-audio.diff
> 
> it sould be applied via patch within the sys/arch directory.
> 
> It allows the Enhanced Apple Sound Chip (easc) to be used as an audio device.
> 
> The asc0 bell driver would not attach to the easc as it does not support wave
> table mode.
> 
> With this driver a wsbell is provided for WSFB* kernels
> 
> Currently recording does not work.
> 
> This should also work for the asc as well but I don't have the hardware to
> test so community feedback would be helpful.
> 
> There are currently to compile time options (for which one will be chosen
> pending your feedback) in ascaud.c USE_INTRS.
> 
> If USE_INTRS is set to 1 the default is to use interrupts to keep the devices
> sound buffers full.
> 
> If USE_INTRS is set to 0 the sound buffers are kept full via scheduling a
> callout.
> 
> Please let me know (I'm not subscrbed to the list) if this works on machines
> with the asc as well and what setting of USE_INTRS yields the best result.

I don't have access to real hardware either, however my QEMU series at 
https://github.com/mcayland/qemu/tree/q800.upstream3 has EASC emulation that is good 
enough for MacOS. I can't say it is 100% accurate but it may help with some testing 
and initial bring-up - at least you should be able to get some basic sound working, 
and confirm the interrupt routing.

With that branch you can also switch the EASC to standard ASC mode using the machine 
parameter "easc" e.g. -M q800,easc=off on the command line which causes the EASC 
device to return the ASC ID byte, removes the EASC-only features, and also implements 
wavetable synthesis which isn't present on the EASC.

In my testing here ASC mode works fine in MacOS, and using NetBSD 9 it enabled the 
keyboard beep to work with a WSFB kernel which as you already know currently requires 
ASC wavetable mode.


ATB,

Mark.