[audio] Rework alsa to use a pull model

This brings the alsa driver in line with the jack render (progress
towards #16), but breaks most of the other drivers (for now: one step at
a time). The idea is that once the pull model is working for at least
one other target, the jack renderer can become just another target like
it should have been in the first place (but I needed to get the pull
model working first, then forgot about it).

Correct state checking is not done yet, but testsound does produce what
seems to be fairly good sound when it starts up correctly (part of the
state checking (or lack thereof), I imagine).
This commit is contained in:
Bill Currie 2021-06-24 00:04:02 +09:00
parent c9319966ce
commit fc907e232f
13 changed files with 506 additions and 331 deletions

View file

@ -30,23 +30,15 @@
#include <QF/plugin.h>
#include <QF/qtypes.h>
/*
All sound plugins must export these functions
*/
typedef volatile struct dma_s *(*P_S_O_Init) (void);
typedef void (*P_S_O_Shutdown) (void);
typedef int (*P_S_O_GetDMAPos) (void);
typedef void (*P_S_O_Submit) (void);
typedef void (*P_S_O_BlockSound) (void);
typedef void (*P_S_O_UnblockSound) (void);
struct snd_s;
typedef struct snd_output_funcs_s {
P_S_O_Init pS_O_Init;
P_S_O_Shutdown pS_O_Shutdown;
P_S_O_GetDMAPos pS_O_GetDMAPos;
P_S_O_Submit pS_O_Submit;
P_S_O_BlockSound pS_O_BlockSound;
P_S_O_UnblockSound pS_O_UnblockSound;
int (*init) (struct snd_s *snd);
void (*shutdown) (struct snd_s *snd);
int (*get_dma_pos) (struct snd_s *snd);
void (*submit) (struct snd_s *snd);
void (*block_sound) (struct snd_s *snd);
void (*unblock_sound) (struct snd_s *snd);
} snd_output_funcs_t;
typedef struct snd_output_data_s {