+ (ALSA:snd_pcm_open PCM libasound:SND_PCM_STREAM_PLAYBACK 0 ))
+
+(define (setup-pcm PCM)
+ (libasound:snd_pcm_set_params
+ PCM
+ libasound:SND_PCM_FORMAT_S16_LE
+ libasound:SND_PCM_ACCESS_RW_INTERLEAVED
+ 2 ; channels
+ 48000 ; rate
+ 1 ; soft resample (0/1)
+ 10000 ; latency (microseconds)
+ ))
+
+;(! (format "ls -l /proc/%d/fd" (sys-info 7)))
+(let ((REDIR (open "/dev/null" "append"))) ; "/tmp/test1"
+ (when (< REDIR) (exit 1))
+ (when (< (libc:dup2 REDIR 2)) (exit 1))
+ (when (< (libc:dup2 REDIR 1)) (exit 1))
+ (close REDIR)
+)
+;; Change ALSA configuration for this process
+(setf KEY "pcm.out1.device" VALUE "20:74:CF:C0:22:81")
+(when (!= (setf E (ALSA:set_config_string KEY VALUE)))
+ (die 1 "set_config_string " E))