Port-mac68k archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ASC/EASC audio device (take 3) (was take 2)



On 17/01/2024 05:51, Nat Sloss wrote:

On Wed, 17 Jan 2024 12:59:52 John Klos wrote:
I've found that I'd mucked up the interrupt handler and two register
definitions.

The new patch to be applied to a clean tree is found at:
ftp://ftp.netbsd.org/pub/NetBSD/misc/nat/ascaudio-take3.diff

I've tried these on a Quadra 605:

[     1.000000] ascaudio0 at obio0: Apple Sound Chip
[     1.000000] audio0 at ascaudio0: playback, capture, half duplex,
independent [     1.000000] audio0: slinear_be:16 1ch 22254Hz, blk 8192
bytes (368.1ms) for playback [     1.000000] audio0: slinear_be:16 1ch
11025Hz, blk 8192 bytes (743ms) for recording [     1.000000] spkr0 at
audio0: PC Speaker (synthesized)
[     1.000000] wsbell0 at spkr0 mux 1

cat ~john/beethoven7th.wav > /dev/sound0
cat: stdout: Resource temporarily unavailable

[   990.244170] audio0(ascaudio0): audio_write: device timeout, seq=0,
usrbuf=64936/H64936, outbuf=32768/32768 [   993.260963] audio0(ascaudio0):
audio_write: device timeout, seq=0, usrbuf=64936/H64936,
outbuf=32768/32768 [   996.344458] audio0(ascaudio0): audio_drain: device
timeout, seq=0, usrbuf=64936/H64936, outbuf=32768/32768 [  1014.080159]
audio0(ascaudio0): audio_write: device timeout, seq=0,
usrbuf=64790/H64790, outbuf=32768/32768 [  1017.097002] audio0(ascaudio0):
audio_write: device timeout, seq=0, usrbuf=64790/H64790,
outbuf=32768/32768 [  1020.180487] audio0(ascaudio0): audio_drain: device
timeout, seq=0, usrbuf=64790/H64790, outbuf=32768/32768

What else can I try?


Try adding:

	mutex_enter(&sc->sc_intr_lock);
	do {
		status = bus_space_read_1(&sc->sc_tag, sc->sc_handle,
					FIFOSTATUS);
+static int m;
+if (m < 3) {
+	printf("status %x\n", status);
+	m++;
+
	again = false;
	count = 0;
	if ((status & A_HALF) == 0)

to ascaudio_intr to see if the interrupt actually fires.

I took the ASCIRQ value of 5 from the qemu emulation and this may be wrong.

If nothing is printed, rebuild the kernel with options DEBUG and see if
anything is printed to the console about the IRQ number.

A couple of comments here as it was me that worked on the QEMU ASC device:

- NetBSD switches the Q800 into so-called "A/UX" mode which as you note routes the EASC interrupt to a level 5 interrupt on the CPU instead of the generic VIA2 level 2 interrupt. I'm not sure which Quadra models support this mode, so worth a quick check to see if this is present on the Quadra 605.

- The FIFO "half empty" interrupt is enabled via the extregs (extended) register block which is only present when the Q800 is configured in EASC mode, which is the default. If you use "-M q800,easc=false" on the command line to switch the EASC to legacy ASC mode, this register is not accessible: in this case QEMU enables the "half empty" interrupt by default, but it is possible that this logic in asc_reset_hold() is incorrect and this is not true on real hardware (I have no real hardware to compare with).

- It might be that switching the EASC to legacy ASC mode may force the ASC to deliver its interrupt in non-A/UX mode. I remember from testing that MacOS was happy to receive the EASC interrupt from either the VIA2 interrupt or the level 5 interrupt i.e. both IRQs were routed correctly.


ATB,

Mark.



Home | Main Index | Thread Index | Old Index