The also-alsa Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The also-alsa Reference Manual

This is the also-alsa Reference Manual, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 07:36:22 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

Basic ALSA bindings for Common Lisp

A small subset of ALSA interface for Common Lisp.

PCM streams are encapsulated in ALSO-ALSA:PCM-STREAM instances.

To play random noise on default stereo device:

(defconstant +buffer-size+ 256)
(defconstant +sample-rate+ 8000)
(defconstant +channels+ 2)


(also-alsa:with-alsa-device (pcm "default" +buffer-size+ '(signed-byte 16) :direction :output
	                                          :channels-count +channels+ :sample-rate +sample-rate+)
	(loop repeat 10 do
		(loop for pos from 0 below (* +channels+ (also-alsa:buffer-size pcm)) do
		(setf (also-alsa:ref pcm pos) (coerce (- (random 65535) 32767) '(signed-byte 16)))
		(also-alsa:alsa-write pcm))))


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 also-alsa

Author

Eugene Zaikonnikov <eugene@funcall.org>

License

LGPL

Description

Basic ALSA bindings for Common Lisp

Dependency

cffi

Source

also-alsa.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 also-alsa.asd

Location

also-alsa.asd

Systems

also-alsa (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 also-alsa/package.lisp

Parent

also-alsa (system)

Location

package.lisp

Packages

also-alsa


Previous: , Up: Lisp files   [Contents][Index]

3.1.3 also-alsa/also-alsa.lisp

Dependency

package.lisp (file)

Parent

also-alsa (system)

Location

also-alsa.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 also-alsa

Source

package.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Macros

Macro: with-alsa-device (STREAM DEVICE BUFFER-SIZE ELEMENT-TYPE &key DIRECTION SAMPLE-RATE CHANNELS-COUNT) &body BODY
Package

also-alsa

Source

also-alsa.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Functions

Function: alsa-element-type TYPE
Package

also-alsa

Source

also-alsa.lisp (file)

Function: alsa-open DEVICE BUFFER-SIZE ELEMENT-TYPE &key DIRECTION SAMPLE-RATE CHANNELS-COUNT
Package

also-alsa

Source

also-alsa.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Generic functions

Generic Function: alsa-close PCM
Package

also-alsa

Methods
Method: alsa-close (PCM pcm-stream)
Source

also-alsa.lisp (file)

Generic Function: alsa-read PCM
Package

also-alsa

Methods
Method: alsa-read (PCM pcm-stream)
Source

also-alsa.lisp (file)

Generic Function: alsa-reopen PCS DEVICE BUFFER-SIZE ELEMENT-TYPE &key DIRECTION SAMPLE-RATE CHANNELS-COUNT

Reopens the stream. If all parameters are the same, just keeps the exiting one.

Package

also-alsa

Source

also-alsa.lisp (file)

Methods
Method: alsa-reopen (PCS pcm-stream) DEVICE BUFFER-SIZE ELEMENT-TYPE &key DIRECTION SAMPLE-RATE CHANNELS-COUNT
Generic Function: alsa-write PCM
Package

also-alsa

Methods
Method: alsa-write (PCM pcm-stream)
Source

also-alsa.lisp (file)

Generic Function: buffer OBJECT
Package

also-alsa

Methods
Method: buffer (PCM-STREAM pcm-stream)

automatically generated reader method

Source

also-alsa.lisp (file)

Generic Function: buffer-size OBJECT
Package

also-alsa

Methods
Method: buffer-size (PCM-STREAM pcm-stream)

automatically generated reader method

Source

also-alsa.lisp (file)

Generic Function: contents-to-lisp PCM
Package

also-alsa

Methods
Method: contents-to-lisp (PCM pcm-stream)
Source

also-alsa.lisp (file)

Generic Function: direction OBJECT
Package

also-alsa

Methods
Method: direction (PCM-STREAM pcm-stream)

automatically generated reader method

Source

also-alsa.lisp (file)

Generic Function: element-type OBJECT
Package

also-alsa

Methods
Method: element-type (PCM-STREAM pcm-stream)

automatically generated reader method

Source

also-alsa.lisp (file)

Generic Function: pcm-format OBJECT
Package

also-alsa

Methods
Method: pcm-format (PCM-STREAM pcm-stream)

automatically generated reader method

Source

also-alsa.lisp (file)

Generic Function: ref PCM POSITION
Generic Function: (setf ref) VALUE PCM POSITION
Package

also-alsa

Methods
Method: ref (PCM pcm-stream) POSITION
Method: (setf ref) VALUE (PCM pcm-stream) POSITION
Source

also-alsa.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.4 Classes

Class: pcm-stream ()
Package

also-alsa

Source

also-alsa.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: handle
Initform

(cffi:foreign-alloc :pointer :initial-contents (list (cffi-sys:null-pointer)))

Readers

handle (generic function)

Slot: device
Initargs

:device

Readers

device (generic function)

Slot: params
Initform

(cffi:foreign-alloc :pointer :initial-contents (list (cffi-sys:null-pointer)))

Readers

params (generic function)

Slot: swparams
Initform

(cffi:foreign-alloc :pointer :initial-contents (list (cffi-sys:null-pointer)))

Readers

swparams (generic function)

Slot: pcm-format
Initargs

:pcm-format

Initform

:snd-pcm-format-s16-le

Readers

pcm-format (generic function)

Slot: buffer
Initargs

:buffer

Readers

buffer (generic function)

Slot: buffer-size
Initargs

:buffer-size

Readers

buffer-size (generic function)

Slot: element-type
Initargs

:element-type

Readers

element-type (generic function)

Slot: sample-rate
Initargs

:sample-rate

Initform

44100

Readers

sample-rate (generic function)

Slot: direction
Initargs

:direction

Readers

direction (generic function)

Slot: channels-count
Initargs

:channels-count

Readers

channels-count (generic function)

Slot: status
Type

(or :initial :open :closed)

Initform

:initial

Readers

status (generic function)

Writers

(setf status) (generic function)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Constants

Constant: +epipe+
Package

also-alsa

Source

also-alsa.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: alsa-open-2 PCS
Package

also-alsa

Source

also-alsa.lisp (file)

Function: deref VAR
Package

also-alsa

Source

also-alsa.lisp (file)

Function: ensure-success VALUE
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-close PCM
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-delay PCM DELAYP
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-drain PCM
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-drop PCM
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-hw-params PCM PARAMS
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-hw-params-any PCM PARAMS
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-hw-params-free PARAMS
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-hw-params-get-period-size PCM VALP DIR
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-hw-params-malloc DPTR
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-hw-params-set-access PCM PARAMS ACCESS
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-hw-params-set-channels PCM PARAMS VAL
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-hw-params-set-format PCM PARAMS FORMAT
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-hw-params-set-rate PCM PARAMS VAL DIR
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-open PCM NAME STREAM MODE
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-prepare PCM
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-readi PCM BUFFER SIZE
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-start PCM
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-state PCM
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-sw-params PCM SWPARAMS
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-sw-params-current PCM SWPARAMS
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-sw-params-get-start-threshold PCM SWPARAMS PVAL
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-sw-params-malloc DPTR
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-sw-params-set-avail-min PCM SWPARAMS VAL
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-sw-params-set-start-threshold PCM SWPARAMS VAL
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-pcm-writei PCM BUFFER SIZE
Package

also-alsa

Source

also-alsa.lisp (file)

Function: snd-strerror VAL
Package

also-alsa

Source

also-alsa.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Generic functions

Generic Function: channels-count OBJECT
Package

also-alsa

Methods
Method: channels-count (PCM-STREAM pcm-stream)

automatically generated reader method

Source

also-alsa.lisp (file)

Generic Function: device OBJECT
Package

also-alsa

Methods
Method: device (PCM-STREAM pcm-stream)

automatically generated reader method

Source

also-alsa.lisp (file)

Generic Function: handle OBJECT
Package

also-alsa

Methods
Method: handle (PCM-STREAM pcm-stream)

automatically generated reader method

Source

also-alsa.lisp (file)

Generic Function: params OBJECT
Package

also-alsa

Methods
Method: params (PCM-STREAM pcm-stream)

automatically generated reader method

Source

also-alsa.lisp (file)

Generic Function: sample-rate OBJECT
Package

also-alsa

Methods
Method: sample-rate (PCM-STREAM pcm-stream)

automatically generated reader method

Source

also-alsa.lisp (file)

Generic Function: status OBJECT
Generic Function: (setf status) NEW-VALUE OBJECT
Package

also-alsa

Methods
Method: status (PCM-STREAM pcm-stream)

automatically generated reader method

Source

also-alsa.lisp (file)

Method: (setf status) NEW-VALUE (PCM-STREAM pcm-stream)

automatically generated writer method

Source

also-alsa.lisp (file)

Generic Function: swparams OBJECT
Package

also-alsa

Methods
Method: swparams (PCM-STREAM pcm-stream)

automatically generated reader method

Source

also-alsa.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   A   F   L  
Index Entry  Section

A
also-alsa.asd: The also-alsa<dot>asd file
also-alsa/also-alsa.lisp: The also-alsa/also-alsa<dot>lisp file
also-alsa/package.lisp: The also-alsa/package<dot>lisp file

F
File, Lisp, also-alsa.asd: The also-alsa<dot>asd file
File, Lisp, also-alsa/also-alsa.lisp: The also-alsa/also-alsa<dot>lisp file
File, Lisp, also-alsa/package.lisp: The also-alsa/package<dot>lisp file

L
Lisp File, also-alsa.asd: The also-alsa<dot>asd file
Lisp File, also-alsa/also-alsa.lisp: The also-alsa/also-alsa<dot>lisp file
Lisp File, also-alsa/package.lisp: The also-alsa/package<dot>lisp file

Jump to:   A   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
A   B   C   D   E   F   G   H   M   P   R   S   W  
Index Entry  Section

(
(setf ref): Exported generic functions
(setf ref): Exported generic functions
(setf status): Internal generic functions
(setf status): Internal generic functions

A
alsa-close: Exported generic functions
alsa-close: Exported generic functions
alsa-element-type: Exported functions
alsa-open: Exported functions
alsa-open-2: Internal functions
alsa-read: Exported generic functions
alsa-read: Exported generic functions
alsa-reopen: Exported generic functions
alsa-reopen: Exported generic functions
alsa-write: Exported generic functions
alsa-write: Exported generic functions

B
buffer: Exported generic functions
buffer: Exported generic functions
buffer-size: Exported generic functions
buffer-size: Exported generic functions

C
channels-count: Internal generic functions
channels-count: Internal generic functions
contents-to-lisp: Exported generic functions
contents-to-lisp: Exported generic functions

D
deref: Internal functions
device: Internal generic functions
device: Internal generic functions
direction: Exported generic functions
direction: Exported generic functions

E
element-type: Exported generic functions
element-type: Exported generic functions
ensure-success: Internal functions

F
Function, alsa-element-type: Exported functions
Function, alsa-open: Exported functions
Function, alsa-open-2: Internal functions
Function, deref: Internal functions
Function, ensure-success: Internal functions
Function, snd-pcm-close: Internal functions
Function, snd-pcm-delay: Internal functions
Function, snd-pcm-drain: Internal functions
Function, snd-pcm-drop: Internal functions
Function, snd-pcm-hw-params: Internal functions
Function, snd-pcm-hw-params-any: Internal functions
Function, snd-pcm-hw-params-free: Internal functions
Function, snd-pcm-hw-params-get-period-size: Internal functions
Function, snd-pcm-hw-params-malloc: Internal functions
Function, snd-pcm-hw-params-set-access: Internal functions
Function, snd-pcm-hw-params-set-channels: Internal functions
Function, snd-pcm-hw-params-set-format: Internal functions
Function, snd-pcm-hw-params-set-rate: Internal functions
Function, snd-pcm-open: Internal functions
Function, snd-pcm-prepare: Internal functions
Function, snd-pcm-readi: Internal functions
Function, snd-pcm-start: Internal functions
Function, snd-pcm-state: Internal functions
Function, snd-pcm-sw-params: Internal functions
Function, snd-pcm-sw-params-current: Internal functions
Function, snd-pcm-sw-params-get-start-threshold: Internal functions
Function, snd-pcm-sw-params-malloc: Internal functions
Function, snd-pcm-sw-params-set-avail-min: Internal functions
Function, snd-pcm-sw-params-set-start-threshold: Internal functions
Function, snd-pcm-writei: Internal functions
Function, snd-strerror: Internal functions

G
Generic Function, (setf ref): Exported generic functions
Generic Function, (setf status): Internal generic functions
Generic Function, alsa-close: Exported generic functions
Generic Function, alsa-read: Exported generic functions
Generic Function, alsa-reopen: Exported generic functions
Generic Function, alsa-write: Exported generic functions
Generic Function, buffer: Exported generic functions
Generic Function, buffer-size: Exported generic functions
Generic Function, channels-count: Internal generic functions
Generic Function, contents-to-lisp: Exported generic functions
Generic Function, device: Internal generic functions
Generic Function, direction: Exported generic functions
Generic Function, element-type: Exported generic functions
Generic Function, handle: Internal generic functions
Generic Function, params: Internal generic functions
Generic Function, pcm-format: Exported generic functions
Generic Function, ref: Exported generic functions
Generic Function, sample-rate: Internal generic functions
Generic Function, status: Internal generic functions
Generic Function, swparams: Internal generic functions

H
handle: Internal generic functions
handle: Internal generic functions

M
Macro, with-alsa-device: Exported macros
Method, (setf ref): Exported generic functions
Method, (setf status): Internal generic functions
Method, alsa-close: Exported generic functions
Method, alsa-read: Exported generic functions
Method, alsa-reopen: Exported generic functions
Method, alsa-write: Exported generic functions
Method, buffer: Exported generic functions
Method, buffer-size: Exported generic functions
Method, channels-count: Internal generic functions
Method, contents-to-lisp: Exported generic functions
Method, device: Internal generic functions
Method, direction: Exported generic functions
Method, element-type: Exported generic functions
Method, handle: Internal generic functions
Method, params: Internal generic functions
Method, pcm-format: Exported generic functions
Method, ref: Exported generic functions
Method, sample-rate: Internal generic functions
Method, status: Internal generic functions
Method, swparams: Internal generic functions

P
params: Internal generic functions
params: Internal generic functions
pcm-format: Exported generic functions
pcm-format: Exported generic functions

R
ref: Exported generic functions
ref: Exported generic functions

S
sample-rate: Internal generic functions
sample-rate: Internal generic functions
snd-pcm-close: Internal functions
snd-pcm-delay: Internal functions
snd-pcm-drain: Internal functions
snd-pcm-drop: Internal functions
snd-pcm-hw-params: Internal functions
snd-pcm-hw-params-any: Internal functions
snd-pcm-hw-params-free: Internal functions
snd-pcm-hw-params-get-period-size: Internal functions
snd-pcm-hw-params-malloc: Internal functions
snd-pcm-hw-params-set-access: Internal functions
snd-pcm-hw-params-set-channels: Internal functions
snd-pcm-hw-params-set-format: Internal functions
snd-pcm-hw-params-set-rate: Internal functions
snd-pcm-open: Internal functions
snd-pcm-prepare: Internal functions
snd-pcm-readi: Internal functions
snd-pcm-start: Internal functions
snd-pcm-state: Internal functions
snd-pcm-sw-params: Internal functions
snd-pcm-sw-params-current: Internal functions
snd-pcm-sw-params-get-start-threshold: Internal functions
snd-pcm-sw-params-malloc: Internal functions
snd-pcm-sw-params-set-avail-min: Internal functions
snd-pcm-sw-params-set-start-threshold: Internal functions
snd-pcm-writei: Internal functions
snd-strerror: Internal functions
status: Internal generic functions
status: Internal generic functions
swparams: Internal generic functions
swparams: Internal generic functions

W
with-alsa-device: Exported macros

Jump to:   (  
A   B   C   D   E   F   G   H   M   P   R   S   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   +  
B   C   D   E   H   P   S  
Index Entry  Section

+
+epipe+: Internal constants

B
buffer: Exported classes
buffer-size: Exported classes

C
channels-count: Exported classes
Constant, +epipe+: Internal constants

D
device: Exported classes
direction: Exported classes

E
element-type: Exported classes

H
handle: Exported classes

P
params: Exported classes
pcm-format: Exported classes

S
sample-rate: Exported classes
Slot, buffer: Exported classes
Slot, buffer-size: Exported classes
Slot, channels-count: Exported classes
Slot, device: Exported classes
Slot, direction: Exported classes
Slot, element-type: Exported classes
Slot, handle: Exported classes
Slot, params: Exported classes
Slot, pcm-format: Exported classes
Slot, sample-rate: Exported classes
Slot, status: Exported classes
Slot, swparams: Exported classes
status: Exported classes
swparams: Exported classes

Jump to:   +  
B   C   D   E   H   P   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   A   C   P   S  
Index Entry  Section

A
also-alsa: The also-alsa system
also-alsa: The also-alsa package

C
Class, pcm-stream: Exported classes

P
Package, also-alsa: The also-alsa package
pcm-stream: Exported classes

S
System, also-alsa: The also-alsa system

Jump to:   A   C   P   S