YaST2 Developers Documentation: Sound

Sound

routines.ycp
Routines for sound card configuration

This module has an unstable interface.

Imports

  • Directory
  • Label
  • Mode
  • Popup
  • Sound

Local Functions

local mount_device (string device) -> string

Mount specified device

Parameters:
device device name to mount
Return value:
mount point where device was mounted (in /tmp subdirectory) or nil when mount failed
local get_card_names (string key, string keys) -> list<string>

returns cards manufactured by given vendor (ALSA only) or driver

Parameters:
key vendor or driver; if "all" returns all models
keys in which set is the key: "vendors" or "modules"
Return value:
with sound card models
local get_running_cards () -> list

Returns list of already running cards (oss is nasty hacked, because it's not trivial to check this)

local get_module_params (string modname) -> map

returns the 'params' section from sndcards.ycp of the given module

Parameters:
modname module name
Return value:
with params and their descriptions
local add_alias (map entry, integer card_id) -> map

adds alias to save_info entry

Parameters:
entry card config
card_id card id
Return value:
modified card entry with filled alias value
local add_common_options (map entry, integer card_id) -> map

adds common options for module. for alsa it is 'snd_index=${card_id}'

Parameters:
entry card config
card_id card id
Return value:
modified save_entry
local alsa_oss (integer number) -> list

Simply returns list with ALSA OSS/Free emulation modules

Parameters:
number number of sound cards
Return value:
of oss-alsa aliases
local get_module_names () -> list

returns list of all available sound modules (OSS only)

Return value:
as above
local get_vol_settings () -> list

get_vol_settings creates a list of stored values of volume and mute for each channel of each card. example: [ [ ["PCM", 32, false], ["Master", 100, true]], [ [....], ..... ] ]

Return value:
as above
local set_vol_settings (list vol_settings) -> boolean

stores values generated by get_vol_settings

Parameters:
vol_settings volume settings
Return value:
success/failure
local hardware_name (map hardware_entry) -> string

common function to extract 'name' of hardware

Parameters:
hardware_entry map
Return value:
readable name of the card
local filter_configured (list<map> save_info, list<map> cards) -> list<map>

filters out already configured cards

Parameters:
save_info info from modules.conf
cards autodetected cards
Return value:
of entries of not configured cards
local get_card_label (map card) -> string

for a given card detected by libhd this function creates a label

Parameters:
card map entry from .probe.audio
Return value:
card label
local is_snd_alias (string alias) -> boolean

returns true if given string is valid sound alias (snd-card-1 .. snd-card-16)

Parameters:
alias string
Return value:
is/is not
local isa_uniq () -> string

unique key for non-pci/pnp cards or virtual cards

Return value:
key for legacy isa cards
local read_rc_vars () -> map

reads variables listed in 'vars' from rc.config

Return value:
optname: value
local SaveUniqueKeys (list configured, list unconfigured) -> boolean

saves uniq keys to .probe.status

Parameters:
configured list of strings of configured cards uniq keys
unconfigured list of string of unconfigured cards uniq keys
Return value:
true
local search_card_id (string name) -> integer

Used for searching. returns index of the card in the database identified by name (more exactly: returns index of first name matching the given substring)

Parameters:
name card name (or its substring)
Return value:
position of the card
local itemize_list (list l, integer default_value) -> list

Itemize list for selection box

Parameters:
l list with values
default_value value to select as default
Return value:
items to be shown in list widget
local nm256hack (string modname) -> boolean

show a warning popup for nm256 snd cards if needed

Parameters:
modname string module name
Return value:
continue/abort
local get_module (map card) -> map

Looks up in the database for the module

Parameters:
card map read from .probe.sound
Return value:
relevant card info found in db
local unmute (list devices, integer card_id) -> void

umnute channel 'devide' of the 'card_id'-th sound card. alsa only

Parameters:
devices list of channels to be unmuted
card_id of the card
local check_module (map save_entry, integer card_id) -> string

Checks whether the module has been successfully loaded

Parameters:
save_entry card config map
card_id card id
Return value:
empty on success/ error message on failure
local restore_mod_params (map params, map values) -> map

inserts values to already set options

Parameters:
params list with available options for module
values values that have been already set
Return value:
with refreshed options
local FontsInstalled () -> boolean

checks whether sound fonts have already been installed

Return value:
already installed/not installed
local HasFonts (map save_entry) -> boolean

return true if the sound card supports sound fonts

Parameters:
save_entry save entry
Return value:
card supports fonts/it doesn't
local InstallFonts (string symlink, boolean dontask) -> void

this small wizard will install sound fonts for soundblaster live/awe

Parameters:
symlink is path to default.sf2 that is to be created
dontask if true, skip the first messagebox
local need_nm256_opl3sa2_warn (list sound_cards) -> boolean

does this machine need a nm256/opl3sa warning?

Parameters:
sound_cards sound cards
Return value:
see as above
local nm256_opl3sa2_warn (list sound_cards) -> void

shows warning message when both nm265 and opl3sa2 cards are present

Parameters:
sound_cards list of sound cards
local Thinkpad600E_cs4236_hack (integer card_id) -> void

Hack for Thinkpad 600E notebook - it need cs4236 module instead of cs4610

Parameters:
card_id card number
local recalc_save_entries (list<map> save_info) -> list<map>

removes entries from save_info listed by indices in id_list

Parameters:
save_info list
Return value:
new save_info