anchor.diff:  ;;; A very basic Advanced Linux Sound Architecture interface
   
   (in-package #:also-alsa)
  +
  +(eval-when (:compile-toplevel)
  +  (defconstant +epipe+ 32))
   
   (define-foreign-library libasound
     (:unix "libasound.so.2")
  
positive.code:   (assert (eql (direction pcm) :snd-pcm-stream-playback))
    (let ((result (snd-pcm-writei (deref (handle pcm)) (buffer pcm) (buffer-size pcm))))
      (unless (= result (buffer-size pcm))
        (error "ALSA error: ~A" result))))
  
  (defmethod alsa-read ((pcm pcm-stream))
    (assert (eql (direction pcm) :snd-pcm-stream-capture))
    (let ((result (snd-pcm-readi (deref (handle pcm)) (buffer pcm) (buffer-size pcm))))
      (unless (= result (buffer-size pcm))
        (error "ALSA error: ~A" result))
      pcm))
  
  (defmethod contents-to-lisp ((pcm pcm-stream))
  
negative.code: 
  (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))
  