libtinyalsa-mixer(3)
๐ libtinyalsa-mixer(3) ๐
okay so bestie, this is the libtinyalsa-mixer page from the Library Functions Manual โ it's literally the mixer interface tea โโจ.
๐ NAME ๐
libtinyalsa-mixer โ Mixer Interface ๐
- all the macros, structures, and functions that make up the mixer interface, no cap ๐ซถ
โจ SYNOPSIS โจ
okay so here's the cast list, main character energy only ๐
๐งธ Data Structures
struct mixer_ctlโ a mixer control ๐๏ธstruct mixerโ a mixer handle โ
๐ธ Enumerations
enum mixer_ctl_typeโ mixer control type.
enum mixer_ctl_type { MIXER_CTL_TYPE_BOOL, MIXER_CTL_TYPE_INT,
MIXER_CTL_TYPE_ENUM, MIXER_CTL_TYPE_BYTE, MIXER_CTL_TYPE_IEC958,
MIXER_CTL_TYPE_INT64, MIXER_CTL_TYPE_UNKNOWN, MIXER_CTL_TYPE_MAX }
โญ Functions
void mixer_close (struct mixer *mixer)โ closes a mixer that came frommixer_openโ bye-bye handle ๐จstruct mixer * mixer_open (unsigned int card)โ opens a mixer for a givencard๐ดconst char * mixer_get_name (const struct mixer *mixer)โ gets the name of the mixer's card ๐ท๏ธunsigned int mixer_get_num_ctls (const struct mixer *mixer)โ gets the number of mixer controls for a given mixer ๐ขunsigned int mixer_get_num_ctls_by_name (const struct mixer *mixer, const char *name)โ gets the number of mixer controls that go by a specifiedname, for a given mixer โ count 'em ๐int mixer_subscribe_events (struct mixer *mixer, int subscribe)โ subscribes for the mixer events ๐ฌint mixer_wait_event (struct mixer *mixer, int timeout)โ waits for mixer events, lowkey patient vibes โณint mixer_consume_event (struct mixer *mixer)โ consumes a mixer event ๐ฝ๏ธint mixer_read_event (struct mixer *mixer, struct mixer_ctl_event *event)โ reads a mixer control event ๐const struct mixer_ctl * mixer_get_ctl_const (const struct mixer *mixer, unsigned int id)โ gets a mixer control handle by the mixer control'sid๐struct mixer_ctl * mixer_get_ctl (struct mixer *mixer, unsigned int id)โ gets a mixer control handle by the mixer control'sid๐struct mixer_ctl * mixer_get_ctl_by_name (struct mixer *mixer, const char *name)โ gets the first instance of a mixer control handle by the mixer control'sname๐ฅstruct mixer_ctl * mixer_get_ctl_by_name_and_index (struct mixer *mixer, const char *name, unsigned int index)โ gets an instance of a mixer control handle by the mixer control'snameandindex๐ฏvoid mixer_ctl_update (struct mixer_ctl *ctl)โ updates the control's info ๐int mixer_ctl_is_access_tlv_rw (const struct mixer_ctl *ctl)โ checks the control for TLV Read/Write access ๐ต๏ธunsigned int mixer_ctl_get_id (const struct mixer_ctl *ctl)โ gets the control's ID ๐const char * mixer_ctl_get_name (const struct mixer_ctl *ctl)โ gets the name of the control ๐ท๏ธenum mixer_ctl_type mixer_ctl_get_type (const struct mixer_ctl *ctl)โ gets the value type of the control ๐งฌconst char * mixer_ctl_get_type_string (const struct mixer_ctl *ctl)โ gets the string that describes the value type of the control ๐คunsigned int mixer_ctl_get_num_values (const struct mixer_ctl *ctl)โ gets the number of values in the control ๐ขint mixer_ctl_get_percent (const struct mixer_ctl *ctl, unsigned int id)โ gets a percentage representation of a specified control value ๐ฏint mixer_ctl_set_percent (struct mixer_ctl *ctl, unsigned int id, int percent)โ sets the value of a control bypercent, specified by the valueid๐๏ธint mixer_ctl_get_value (const struct mixer_ctl *ctl, unsigned int id)โ gets the value of a control ๐๏ธint mixer_ctl_get_array (const struct mixer_ctl *ctl, void *array, size_t count)โ gets the contents of a control's value array ๐งบint mixer_ctl_set_value (struct mixer_ctl *ctl, unsigned int id, int value)โ sets the value of a control, specified by the valueid๐๏ธint mixer_ctl_set_array (struct mixer_ctl *ctl, const void *array, size_t count)โ sets the contents of a control's value array ๐งบint mixer_ctl_get_range_min (const struct mixer_ctl *ctl)โ gets the minimum value of a control โฌ๏ธint mixer_ctl_get_range_max (const struct mixer_ctl *ctl)โ gets the maximum value of a control โฌ๏ธunsigned int mixer_ctl_get_num_enums (const struct mixer_ctl *ctl)โ gets the number of enumerated items in the control ๐ขconst char * mixer_ctl_get_enum_string (struct mixer_ctl *ctl, unsigned int enum_id)โ gets the string representation of an enumerated item ๐คint mixer_ctl_set_enum_by_string (struct mixer_ctl *ctl, const char *string)โ sets an enumeration value by string value ๐ช
๐ซ Detailed Description ๐ซ
okay so fr fr, this is all the macros, structures, and functions that make up the mixer interface โ the whole friend group, together ๐.
๐ Enumeration Type Documentation ๐
๐ฆ enum mixer_ctl_type ๐ฆ
mixer control type, periodt. the way that this enum just labels every control vibe? iconic ๐
๐ Enumerator
MIXER_CTL_TYPE_BOOLโ boolean control type โMIXER_CTL_TYPE_INTโ integer control type ๐ขMIXER_CTL_TYPE_ENUMโ an enumerated control type ๐MIXER_CTL_TYPE_INT64โ a 64 bit integer control type ๐งฎMIXER_CTL_TYPE_UNKNOWNโ unknown control type โMIXER_CTL_TYPE_MAXโ end of the enumeration (not a control type) ๐
๐ธ Function Documentation ๐ธ
okay bestie, this is the function-by-function tour. every signature, parameter, return value, and weird little typo is staying exactly where it belongs โ we're just making it cute ๐
๐งน mixer_close
void mixer_close (struct mixer * mixer)
Closes a mixer returned by mixer_open. she's done, she's logging off, bye ๐
- mixer โ A mixer handle.
Returns: nothing, it's void โ she just leaves.
๐ง mixer_consume_event
int mixer_consume_event (struct mixer * mixer)
Consume a mixer event. If mixer_subscribe_events has been called, mixer_wait_event will identify when a control value has changed. This function will clear a single event from the mixer so that further events can be alerted. one event at a time, no cap โจ
- mixer โ A mixer handle.
Returns: 1 on success. 0, if no pending event. -errno on failure.
๐ mixer_ctl_get_array
int mixer_ctl_get_array (const struct mixer_ctl * ctl, void * array, size_t count)
Gets the contents of a control's value array. very "give me the whole squad" energy ๐ซถ
- ctl โ An initialized control handle.
- array โ A pointer to write the array data to. The size of this array must be equal to the number of items in the array multiplied by the size of each item.
- count โ The number of items in the array. This parameter must match the number of items in the control. The number of items in the control may be accessed via
mixer_ctl_get_num_values.
Returns: On success, zero. On failure, non-zero.
๐ mixer_ctl_get_enum_string
const char * mixer_ctl_get_enum_string (struct mixer_ctl * ctl, unsigned int enum_id)
Gets the string representation of an enumerated item. it's giving "translate the enum for me please" ๐
- ctl โ An initialized control handle.
- enum_id โ The index of the enumerated value.
Returns: A string representation of the enumerated item.
๐ mixer_ctl_get_id
unsigned int mixer_ctl_get_id (const struct mixer_ctl * ctl)
Gets the control's ID. every control needs a little name tag, iykyk โจ
- ctl โ An initialized control handle.
Returns: On success, the control's ID is returned. On error, UINT_MAX is returned instead.
๐ฆ mixer_ctl_get_name
const char * mixer_ctl_get_name (const struct mixer_ctl * ctl)
Gets the name of the control. main character identification moment ๐
- ctl โ An initialized control handle.
Returns: On success, the name of the control. On error, NULL.
๐ mixer_ctl_get_num_enums
unsigned int mixer_ctl_get_num_enums (const struct mixer_ctl * ctl)
Get the number of enumerated items in the control. counting the enum girlies one by one ๐ข
- ctl โ An initialized control handle.
Returns: The number of enumerated items in the control.
๐ง mixer_ctl_get_num_values
unsigned int mixer_ctl_get_num_values (const struct mixer_ctl * ctl)
Gets the number of values in the control. how many little values are we working with? let's find out ๐ซ
- ctl โ An initialized control handle.
Returns: The number of values in the mixer control.
๐ธ mixer_ctl_get_percent
int mixer_ctl_get_percent (const struct mixer_ctl * ctl, unsigned int id)
Gets a percentage representation of a specified control value. turning the vibe into a %, iconic ๐
- ctl โ An initialized control handle.
- id โ The index of the value within the control.
Returns: On success, the percentage representation of the control value. On failure, -EINVAL is returned.
๐ฅ mixer_ctl_get_range_max
int mixer_ctl_get_range_max (const struct mixer_ctl * ctl)
Gets the maximum value of an control. The control must have an integer type. The type of the control can be checked with mixer_ctl_get_type. yes, "an control" โ she said what she said ๐
- ctl โ An initialized control handle.
Returns: On success, the maximum value of the control. On failure, -EINVAL.
๐ mixer_ctl_get_range_min
int mixer_ctl_get_range_min (const struct mixer_ctl * ctl)
Gets the minimum value of an control. The control must have an integer type. The type of the control can be checked with mixer_ctl_get_type. the lower bound bestie, the floor, the starting line โจ
- ctl โ An initialized control handle.
Returns: On success, the minimum value of the control. On failure, -EINVAL.
๐ mixer_ctl_get_type
enum mixer_ctl_type mixer_ctl_get_type (const struct mixer_ctl * ctl)
Gets the value type of the control. type check, but make it mixer ๐
- ctl โ An initialized control handle.
Returns: On success, the type of mixer control. On failure, it returns MIXER_CTL_TYPE_UNKNOWN.
๐ฆ mixer_ctl_get_type_string
const char * mixer_ctl_get_type_string (const struct mixer_ctl * ctl)
Gets the string that describes the value type of the control. same type info, but in a string outfit ๐
- ctl โ An initialized control handle.
Returns: On success, a string describing type of mixer control.
โญ mixer_ctl_get_value
int mixer_ctl_get_value (const struct mixer_ctl * ctl, unsigned int id)
Gets the value of a control. the moment we've all been waiting for: the actual value ๐ฅ
- ctl โ An initialized control handle.
- id โ The index of the control value.
Returns: On success, the specified value is returned. On failure, -EINVAL is returned.
๐ mixer_ctl_is_access_tlv_rw
int mixer_ctl_is_access_tlv_rw (const struct mixer_ctl * ctl)
Checks the control for TLV Read/Write access. is she TLV read/write coded? let's check ๐
- ctl โ An initialized control handle.
Returns: On success, non-zero. On failure, zero.
๐ mixer_ctl_set_array
int mixer_ctl_set_array (struct mixer_ctl * ctl, const void * array, size_t count)
Sets the contents of a control's value array. dropping the whole array in, no crumbs left behind ๐ซถ
- ctl โ An initialized control handle.
- array โ The array containing control values.
- count โ The number of values in the array. This must match the number of values in the control. The number of values in a control may be accessed via
mixer_ctl_get_num_values.
Returns: On success, zero. On failure, non-zero.
๐ mixer_ctl_set_enum_by_string
int mixer_ctl_set_enum_by_string (struct mixer_ctl * ctl, const char * string)
Set an enumeration value by string value. name the enum and set it, cute and direct โจ
- ctl โ An enumerated mixer control.
- string โ The string representation of an enumeration.
Returns: On success, zero. On failure, zero. yes bestie, both zero โ that's literally what the page says ๐
๐ธ mixer_ctl_set_percent
int mixer_ctl_set_percent (struct mixer_ctl * ctl, unsigned int id, int percent)
Sets the value of a control by percent, specified by the value index. setting the vibe level from 0 to 100 ๐๏ธ
- ctl โ An initialized control handle.
- id โ The index of the value to set.
- percent โ A percentage value between
0and100.
Returns: On success, zero is returned. On failure, non-zero is returned.
๐ฅ mixer_ctl_set_value
int mixer_ctl_set_value (struct mixer_ctl * ctl, unsigned int id, int value)
Sets the value of a control, specified by the value index. one value, one index, one moment ๐
- ctl โ An initialized control handle.
- id โ The index of the value within the control.
- value โ The value to set. This must be in a range specified by
mixer_ctl_get_range_minandmixer_ctl_get_range_max.
Returns: On success, zero is returned. On failure, non-zero is returned.
๐ง mixer_ctl_update
void mixer_ctl_update (struct mixer_ctl * ctl)
Updates the control's info. This is useful for a program that may be idle for a period of time. refresh her info, she's been sitting here for a minute ๐ฐ๏ธ
- ctl โ An initialized control handle.
Returns: nothing, void era.
๐ง mixer_get_ctl
struct mixer_ctl * mixer_get_ctl (struct mixer * mixer, unsigned int id)
Gets a mixer control handle, by the mixer control's id. For const access, see mixer_get_ctl_const. ID girlies rise ๐ซถ
- mixer โ An initialized mixer handle.
- id โ The control's id in the given mixer.
Returns: A handle to the mixer control.
๐ฆ mixer_get_ctl_by_name
struct mixer_ctl * mixer_get_ctl_by_name (struct mixer * mixer, const char * name)
Gets the first instance of mixer control handle, by the mixer control's name. first match only, bestie โ don't get it twisted โจ
- mixer โ An initialized mixer handle.
- name โ The control's name in the given mixer.
Returns: A handle to the mixer control.
๐ mixer_get_ctl_by_name_and_index
struct mixer_ctl * mixer_get_ctl_by_name_and_index (struct mixer * mixer, const char * name, unsigned int index)
Gets an instance of mixer control handle, by the mixer control's name and index. For instance, if two controls have the name of 'Volume', then and index of 1 would return the second control. (yes, "then and index" โ the page said it, not me ๐ญ)
- mixer โ An initialized mixer handle.
- name โ The control's name in the given mixer.
- index โ The control's index.
Returns: A handle to the mixer control.
๐ mixer_get_ctl_const
const struct mixer_ctl * mixer_get_ctl_const (const struct mixer * mixer, unsigned int id)
Gets a mixer control handle, by the mixer control's id. For non-const access, see mixer_get_ctl. const-correct queen ๐
- mixer โ An initialized mixer handle.
- id โ The control's id in the given mixer.
Returns: A handle to the mixer control.
๐ mixer_get_name
const char * mixer_get_name (const struct mixer * mixer)
Gets the name of the mixer's card. not the control, the card โ read her properly ๐ณ
- mixer โ An initialized mixer handle.
Returns: The name of the mixer's card.
โญ mixer_get_num_ctls
unsigned int mixer_get_num_ctls (const struct mixer * mixer)
Gets the number of mixer controls for a given mixer. counting the controls like they're้้ edition ๐
- mixer โ An initialized mixer handle.
Returns: The number of mixer controls for the given mixer.
๐ mixer_get_num_ctls_by_name
unsigned int mixer_get_num_ctls_by_name (const struct mixer * mixer, const char * name)
Gets the number of mixer controls, that go by a specified name, for a given mixer. all the same-name girlies accounted for ๐
- mixer โ An initialized mixer handle.
- name โ The name of the mixer control.
Returns: The number of mixer controls, specified by name, for the given mixer.
๐ฅ mixer_open
struct mixer * mixer_open (unsigned int card)
Opens a mixer for a given card. new mixer, new me, let's gooo โจ
- card โ The card to open the mixer for.
Returns: An initialized mixer handle.
๐ง mixer_read_event
int mixer_read_event (struct mixer * mixer, struct mixer_ctl_event * event)
Read a mixer control event. Try to read an control event from mixer. event output goes into the event parameter โ if there is an event read form the mixer, this function will fill the event data into it. "form" is their word, we're keeping it ๐
- mixer โ A mixer handle.
- event โ Output parameter. If there is an event read form the mixer, this function will fill the event data into it.
Returns: 1 on success. 0, if no pending event. -errno on failure.
๐ธ mixer_subscribe_events
int mixer_subscribe_events (struct mixer * mixer, int subscribe)
Subscribes for the mixer events. get on the event list, bestie ๐ฌ
- mixer โ A mixer handle.
- subscribe โ value indicating subscribe or unsubscribe for events.
Returns: On success, zero. On failure, non-zero.
๐ฆ mixer_wait_event
int mixer_wait_event (struct mixer * mixer, int timeout)
Wait for mixer events. the waiting room, but for mixer events โณ
- mixer โ A mixer handle.
- timeout โ timout value (their spelling, not mine).
Returns: On success, 1. On failure, -errno. On timeout, 0.
๐ Author ๐
Generated automatically by Doxygen for TinyALSA from the source code. automated icon behavior, honestly ๐คโจ
source/version: TinyALSA, Version 1.1.0 ยท page: libtinyalsa-mixer(3) ยท date: not in this footer, so we're calling her timeless ๐
stay hydrated, go check your mixer controls, and remember: every event deserves to be consumed responsibly ๐๐
๐ฆ where this page comes from
- alpine 3.24: tinyalsa-doc 2.0.0-r4 ยท BSD-3-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms