;; This is the main script for the pcm-dispatch tool ;; last main-arg nominates the configuration file (load "lsp-utils.lsp") ; load contexts libasound and ALSA (load "libasound.lsp") (setf CONFIGFILE (println (main-args -1)) CONFIGTEXT (read-file CONFIGFILE) CONFIG (println (read-expr CONFIGTEXT)) PCM-LIST (println (rest (assoc "PCM-LIST" CONFIG))) ) (define (open-pcm PCM) (ALSA:snd_pcm_open PCM libasound:SND_PCM_STREAM_PLAYBACK 0)) ;; Find first usable PCM (setf PCM (unless (dolist (PCM PCM-LIST (open-pcm PCM))) (die 1 "No PCM available"))) (println (list 'PCM PCM))