anchor.diff:  
   (defclass pcm-stream ()
     ((handle :reader handle :initform (foreign-alloc :pointer :initial-contents (list (null-pointer))))
  +   (device :reader device :initarg :device)
      (params :reader params :initform (foreign-alloc :pointer :initial-contents (list (null-pointer))))
      (swparams :reader swparams :initform (foreign-alloc :pointer :initial-contents (list (null-pointer))))
      (pcm-format :reader pcm-format :initarg :pcm-format :initform :snd-pcm-format-s16-le)
  
positive.code: 	((equalp type '(signed-byte 16)) :int16)
  	(t (error "Invalid base type ~A" type))))
  
  (defun alsa-open (device buffer-size element-type &key direction (sample-rate 44100) (channels-count 2) start-threshold)
    (let ((pcs (make-instance 'pcm-stream
  			    :direction (case direction
  					 (:input :snd-pcm-stream-capture)
  					 (:output :snd-pcm-stream-playback))
  			    :element-type element-type
  			    :buffer (foreign-alloc (alsa-element-type element-type)
  						   :count (* (cffi:foreign-type-size (alsa-element-type element-type)) buffer-size channels-count))
  			    :buffer-size (* buffer-size channels-count) ;number of samples really
  			    :channels-count channels-count
  			    :sample-rate sample-rate
  			    :pcm-format (cond ((eql element-type 'single-float) :snd-pcm-format-float-le)
  					      ((eql element-type 'double-float) :snd-pcm-format-float64-le)
  					      ((equalp element-type '(unsigned-byte 8)) :snd-pcm-format-u8-le)
  					      ((equalp element-type '(signed-byte 8)) :snd-pcm-format-s8-le)
  					      ((equalp element-type '(unsigned-byte 16)) :snd-pcm-format-u16-le)
  					      ((equalp element-type '(signed-byte 16)) :snd-pcm-format-s16-le)
  					      (t (error "Invalid base type ~A" element-type))))))
      
      (ensure-success (snd-pcm-open (handle pcs) device (direction pcs) 0))
      (ensure-success (snd-pcm-hw-params-malloc (params pcs)))
      (ensure-success (snd-pcm-hw-params-any (deref (handle pcs)) (deref (params pcs))))
      (ensure-success (snd-pcm-hw-params-set-access (deref (handle pcs)) (deref (params pcs)) :snd-pcm-access-rw-interleaved))
  
negative.code:   (setf (mem-aref (buffer pcm) (alsa-element-type (element-type pcm)) position) value))
  
  (defmethod alsa-close ((pcm pcm-stream))
    (when (eq (status pcm) :open)
      (snd-pcm-drain (deref (handle pcm)))
      (snd-pcm-close (deref (handle pcm))))
    (setf (status pcm) :closed)
    pcm)
  
  (defmethod alsa-write ((pcm pcm-stream))
  