From 0ed2bf5ca517ba1e4cab3b5978c4b3aee12fbb1c Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Wed, 26 Apr 2023 22:44:36 +1000 Subject: [PATCH] Add imports for simple playback access. --- lsp-alsa/libasound-pcm.lsp | 71 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/lsp-alsa/libasound-pcm.lsp b/lsp-alsa/libasound-pcm.lsp index 7862b1c..3ccb827 100644 --- a/lsp-alsa/libasound-pcm.lsp +++ b/lsp-alsa/libasound-pcm.lsp @@ -6,6 +6,11 @@ 'SND_PCM_NONBLOCK 0x00000001 ;; Async notification 'SND_PCM_ASYNC 0x00000002 + ;; enum _snd_pcm_format (some) + 'SND_PCM_FORMAT_S16_LE 2 + ;; enum _snd_pcm_access (some) + 'SND_PCM_ACCESS_RW_INTERLEAVED 3 + 'SND_PCM_ACCESS_RW_NONINTERLEAVED 4 ) (import LIB "snd_pcm_open" "int" @@ -15,4 +20,70 @@ "int" ; int mode ) +(import LIB "snd_pcm_writei" "long" ; snd_pcm_uframes_t + "void*" ; snd_pcm_t *pcm + "void*" ; const void *buffer + "long" ; snd_pcm_uframes_t size + ) + +(import LIB "snd_pcm_prepare" "int" ; int + "void*" ; snd_pcm_t *pcm + ) + +(import LIB "snd_pcm_start" "int" ; int + "void*" ; snd_pcm_t *pcm + ) + +;;typedef struct _snd_pcm_hw_params snd_pcm_hw_params_t +# "unsigned" ; unsigned int flags; +# struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - +# SNDRV_PCM_HW_PARAM_FIRST_MASK + 1]; +# struct snd_mask mres[5]; /* reserved masks */ +# struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - +# SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1]; +# struct snd_interval ires[9]; /* reserved intervals */ +# unsigned int rmask; /* W: requested masks */ +# unsigned int cmask; /* R: changed masks */ +# unsigned int info; /* R: Info flags for returned setup */ +# unsigned int msbits; /* R: used most significant bits */ +# unsigned int rate_num; /* R: rate numerator */ +# unsigned int rate_den; /* R: rate denominator */ +# snd_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */ +# unsigned char reserved[64]; /* reserved for future */ + +#(import LIB "snd_pcm_hw_params_current" "int" +# "void*" ; snd_pcm_t *pcm +# "void*" ; snd_pcm_hw_params_t *params +# ) + +(import LIB "snd_pcm_state" "int" ; snd_pcm_state_t snd_pcm_state + "void*" ; snd_pcm_t *pcm + ) + +(import LIB "snd_pcm_start" "int" ; snd_pcm_state_t snd_pcm_start + "void*" ; snd_pcm_t *pcm + ) + +(import LIB "snd_pcm_wait" "int" + "void*" ; snd_pcm_t *pcm + "int" ; int timeout + ) + +(import LIB "snd_pcm_set_params" "int" + "void*" ; snd_pcm_t *pcm + "int" ; snd_pcm_format_t format + "int" ; snd_pcm_access_t access + "unsigned int" ; unsigned int channels + "unsigned int" ; unsigned int rate + "int" ;int soft_resample + "unsigned int" ; unsigned int latency + ) + +(import LIB "snd_pcm_drain" "int" + "void*" ; snd_pcm_t *pcm + ) + +(import LIB "snd_pcm_close" "int" + "void*" ; snd_pcm_t *pcm + ) -- 2.39.2