Mixer objects provides access to the ALSA mixer API.
[control], [id], [cardname]) |
id - the id of the mixer control. Default is 0
cardname - specifies which card should be used (this is only relevant if you have more than one sound card). Omit to use the default sound card
Mixer objects have the following methods:
) |
) |
) |
) |
Switch | Description |
---|---|
This mixer can be muted | |
This mixer can mute all channels at the same time | |
This mixer can mute the playback output | |
Mute playback for all channels at the same time | |
Mute sound capture | |
Mute sound capture for all channels at a time | |
Not quite sure what this is |
To manipulate these swithes use the setrec or setmute methods
) |
Capability | Description |
---|---|
This mixer can control volume | |
This mixer can control volume for all channels at the same time | |
This mixer can manipulate the playback volume | |
Manipulate playback volumne for all channels at the same time | |
Manipulate sound capture volume | |
Manipulate sound capture volume for all channels at a time |
[direction]) |
The optional direction argument can be either 'playback' or 'capture', which is relevant if the mixer can control both playback and capture volume. The default value is 'playback' if the mixer has this capability, otherwise 'capture'
) |
This method will fail if the mixer has no playback switch capabilities.
) |
This method will fail if the mixer has no capture switch capabilities.
volume,[channel],[direction]) |
If the optional argument channel is present, the volume is set only for this channel. This assumes that the mixer can control the volume for the channels independently.
The optional direction argument can be either 'playback' or 'capture' is relevant if the mixer has independent playback and capture volume capabilities, and controls which of the volumes if changed. The default is 'playback' if the mixer has this capability, otherwise 'capture'.
mute, [channel]) |
The optional channel argument controls which channel is muted. The default is to set the mute flag for all channels.
This method will fail if the mixer has no playback mute capabilities
capture,[channel]) |
The optional channel argument controls which channel is changed. The default is to set the capture flag for all channels.
This method will fail if the mixer has no capture switch capabilities
A Note on the ALSA Mixer API
The ALSA mixer API is extremely complicated - and hardly documented at all. alsaaudio implements a much simplified way to access this API. In designing the API I've had to make some choices which may limit what can and cannot be controlled through the API. However, If I had chosen to implement the full API, I would have reexposed the horrible complexity/documentation ratio of the underlying API. At least the alsaaudio API is easy to understand and use.
If my design choises prevents you from doing something that the underlying API would have allowed, please let me know, so I can incorporate these need into future versions.
If the current state of affairs annoy you, the best you can do is to write a HOWTO on the API and make this available on the net. Until somebody does this, the availability of ALSA mixer capable devices will stay quite limited.
Unfortunately, I'm not able to create such a HOWTO myself, since I only understand half of the API, and that which I do understand has come from a painful trial and error process.