Alsa Utilities

De Wikijoan
Dreceres ràpides: navegació, cerca

The ALSA Utilities package contains various utilities which are useful for controlling your sound card.

Short Descriptions

Contingut

aconnect

is a utility for connecting and disconnecting two existing ports in the ALSA sequencer system.

ja l'he utilitzat profusament per connectar clients ALSA

alsaconf

alsactl

is used to control advanced settings for the ALSA sound card drivers.

$ alsa --help

El fitxer de configuració està per defecte a: /var/lib/alsa/asound.state

$ cat /var/lib/alsa/asound.state
state.ICH6 {
	control.1 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'Master Playback Switch'
		value true
	}
	control.2 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
...
  store   <card #> save current driver setup for one or each soundcards
                   to configuration file
  restore <card #> load current driver setup for one or each soundcards
                   from configuration file
  init	  <card #> initialize driver to a default state
  names   <card #> dump information about all the known present (sub-)devices
                   into configuration file (DEPRECATED)
$ sudo alsactl store 0

guarda la configuració del driver de la targeta #0 al fitxer /var/lib/alsa/asound.state

Per carregar la configuració del driver:

$ alsactl restore 0

alsamixer

is an ncurses-based mixer program for use with the ALSA sound card drivers.

$ alsamixer --help
AlsaMixer v1.0.18
Usage: alsamixer [-h] [-c <card: 0...7>] [-D <mixer device>] [-g] [-s] [-V <view>] [-a <abst>]

$ alsamixer

Apareix una interfície gràfica basada amb ncurses, i amb el cursor es pot canviar els valors.

amidi

$ amidi --help
Usage: amidi options

-h, --help             this help
-V, --version          print current version
-l, --list-devices     list all hardware ports
-L, --list-rawmidis    list all RawMIDI definitions
-p, --port=name        select port by name
-s, --send=file        send the contents of a (.syx) file
-r, --receive=file     write received data into a file
-S, --send-hex="..."   send hexadecimal bytes
-d, --dump             print received data as hexadecimal bytes
-t, --timeout=seconds  exits when no data has been received
                       for the specified duration
-a, --active-sensing   don't ignore active sensing bytes

Està documentat a Amidi:_enviar_missatges_MIDI_des_de_la_shell, on s'aprèn a enviar missatges MIDI des de la línia de comandes. A més, s'explica què són els ports midi virtuals i se'n configura un per fer sonar el que envio a través de la línia de comandes al fluidsynth.

amixer

allows command-line control of the mixers for the ALSA sound card drivers.

$ amixer --help
Usage: amixer <options> [command]

Available options:
  -h,--help       this help
  -c,--card N     select the card
  -D,--device N   select the device, default 'default'
  -d,--debug      debug mode
  -n,--nocheck    do not perform range checking
  -v,--version    print version of this program
  -q,--quiet      be quiet
  -i,--inactive   show also inactive controls
  -a,--abstract L select abstraction level (none or basic)
  -s,--stdin      Read and execute commands from stdin sequentially

Available commands:
  scontrols       show all mixer simple controls
  scontents	  show contents of all mixer simple controls (default command)
  sset sID P      set contents for one mixer simple control
  sget sID        get contents for one mixer simple control
  controls        show all controls for given card
  contents        show contents of all controls for given card
  cset cID P      set control contents for one control
  cget cID        get control contents for one control

TBD

aplay

is a command-line soundfile player for the ALSA sound card drivers. TBD

aplaymidi

is a command-line utility that plays the specified MIDI file(s) to one or more ALSA sequencer ports.

$ aplaymidi --help
Usage: aplaymidi -p client:port[,...] [-d delay] midifile ...
-h, --help                  this help
-V, --version               print current version
-l, --list                  list all possible output ports
-p, --port=client:port,...  set port(s) to play to
-d, --delay=seconds         delay after song ends

$ aplaymidi -l
 Port    Client name                      Port name
 14:0    Midi Through                     Midi Through Port-0
128:0    TiMidity                         TiMidity port 0
128:1    TiMidity                         TiMidity port 1
128:2    TiMidity                         TiMidity port 2
128:3    TiMidity                         TiMidity port 3

Fem sonar un MIDI:

$ aplaymidi -p128:0 /home/joan/midis/beatles-carrythatweight.mid

i efectivament sona.

arecord

is a command-line soundfile recorder for the ALSA sound card drivers.

TBD

arecordmidi

is a command-line utility that records a standard MIDI file from one or more ALSA sequencer ports.

TBD

aseqdump

is a command-line utility that prints the sequencer events it receives as text.

TBD

aseqnet

is an ALSA sequencer client which sends and receives event packets over a network.

TBD

iecset

is a small utility to set or dump the IEC958 (or so-called “S/PDIF”) status bits of the specified sound card via the ALSA control API.

TBD

speaker-test

is a command-line speaker test tone generator for ALSA.

$ speaker-test

speaker-test 1.0.18

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 192 to 2097152
Period size range from 64 to 699051
Using max buffer size 2097152
Periods = 4
was set period_size = 524288
was set buffer_size = 2097152
 0 - Front Left
Time per period = 10,978441
 0 - Front Left

Se sent un soroll de fregit. Per fer un test dels dos canals (esquerra i dreta):

$ speaker-test -c2 -D plughw:UA25EX -twav

creat per Joan Quintana Compte, maig 2009

Eines de l'usuari
Espais de noms
Variants
Accions
Navegació
Institut Jaume Balmes
Màquines recreatives
CNC
Informàtica musical
joanillo.org Planet
Eines