anchor.diff:  
   (defcfun "snd_pcm_hw_params_set_channels" :int (pcm :pointer) (params :pointer) (val :int))
   
  +(defcfun "snd_pcm_hw_params_get_period_size" :int (pcm :pointer) (valp (:pointer :ulong)) (dir :pointer))
  +
   (defcfun "snd_pcm_hw_params" :int (pcm :pointer) (params :pointer))
   
   (defcfun "snd_pcm_hw_params_free" :int (params :pointer))
  
positive.code: ;;; A very basic Advanced Linux Sound Architecture interface
  
  (in-package #:also-alsa)
  
  (define-foreign-library libasound
    (:unix "libasound.so.2")
  
negative.code:     (ensure-success (snd-pcm-hw-params-set-rate (deref (handle pcs)) (deref (params pcs)) (sample-rate pcs) 0))
      (ensure-success (snd-pcm-hw-params-set-channels (deref (handle pcs)) (deref (params pcs)) (channels-count pcs)))
      (ensure-success (snd-pcm-hw-params (deref (handle pcs)) (deref (params pcs))))
  
      (cffi:with-foreign-object (period :uint)
        (ensure-success (snd-pcm-hw-params-get-period-size (deref (handle pcs)) period (cffi:null-pointer)))
        (format t "Period size: ~D" period))
  
      (snd-pcm-hw-params-free (deref (params pcs)))
      (ensure-success (snd-pcm-prepare (deref (handle pcs))))
      
      (ensure-success (snd-pcm-sw-params-malloc (swparams pcs)))
      (ensure-success (snd-pcm-sw-params-current (deref (handle pcs)) (deref (swparams pcs))))
      (when start-threshold
  