On Sun, 10 Jan 2021 11:24:22 +0100 Takashi Iwai <tiwai@xxxxxxx> wrote: > > At first there was no nextpos, and _pointer() always reported pos. This > > didn't work, the core played through the audio at chipmunk speed. So > > there must be more that I don't understand here. > > Try to set the periods_min=2 and the integer periods hw constraint at > first, and change the pointer callback to return nextpos. Also, at > the push function, set runtime->delay = period_size as well. When I do all this, it still causes the chipmunk speed. Several seconds of audio gets played in 0.3s or so. Sorry if this is taking too much of your time, I'm a bit lost here at what the alsa core is expecting. Printks show the following repeats: start, period size 1024 push, bool irq=0 irq fired push, bool irq=1 pointer at 8192 stop It stops and starts again for some reason. This does not happen in the current pos/nextpos implementation. > > - the DMA unit has errata if (start + len) & 0x3fff == 0x2000, this > > must never happen > > Ditto. Can it really handle a constraint this complex? That'd be impressive. It'd remove the memcpy need if so. > > - the audio IRQ is not a timer, it fires when the card's internal > > buffers are empty and need immediate refill > > It's the current implementation, right? Yes, but I was wondering if a different setup would work better. The alsa setup is a bit confusing to me still. - Lauri