YaST2 Developers Documentation: Sound configuration



functions
files
intro

Sound configuration

modules/Sound.ycp
Sound data

Imports

  • Arch
  • Confirm
  • Crash
  • Label
  • Mode
  • Progress
  • Summary

Includes

  • sound/read_routines.ycp
  • sound/routines.ycp
  • sound/texts.ycp

Global Variables

Global Functions

Local Variables

global use_alsa -> boolean

what sound system we're using (true=alsa, false=oss)

global card_id -> integer

id of current card

global save_entry -> map

configuration map of current card

global STRINGS -> map

text constants for sound module

global installation -> boolean

flag for letting the module know, that it's launched from then hardware installation screen

global proposal_created -> boolean

was the proposal already generated?

global write_only -> boolean

write only mode? (-> do not restart services during writing)

global detected_cards -> list<map>

list for storing detected cards

global unconfigured_cards -> list<map>

list of detected and unconfigured cards

global modules_conf -> list<map>

settings to save to /etc/modules.conf (only those concerning to sound)

global volume_settings -> list

settings to save using .audio.alsa ... mixer

global rc_vars -> map

rc settings

Info:

alsa sound card database

global db_modules -> map

module details

global db_indices -> map

global db_vendors -> map

map of card vendors

global db_module_index -> map

global use_ui -> boolean

flag for showing/not showing ui stuff (eg when loading alsa database)

global curr_vendor -> string

currently used card vendor (pointer to table)

global curr_driver -> string

currently used card driver (pointer to table)

global curr_model -> string

currently used card model (pointer to table)

global default_volume -> integer

default value of volume for new card

global used_modprobe_conf -> boolean

This is true, if sound data were read from /etc/modprobe.conf On write, they shoud be removed and written only to /etc/modprobe.d/sound

global configure_detected -> boolean

When true: During autoinstallation, detected cards will be added automaticaly even if they are not defined in control file

global modules_conf_b -> list<map>

backup structures for sound settings

local use_snd_prefix -> boolean

Is "snd_" prefix used for sound module parameter names? (ALSA only) Variable must be nil for first, will be initialized when needed

global snd_prefix_used () -> boolean

Checks (via 'modinfo snd') if "snd_" prefix is used for module parameters (ALSA only)

Return value:
true/false TODO remove this for new kernels...

global snd_prefix () -> string

Returns current prefix of module parameters (ALSA only)

Return value:
"snd_" or empty string

global Sound () -> void

sound module constructor

global ProbeOldChip (string chip) -> string

Probe one card with alsaconf call

Parameters:
chip chip name
Return value:
non-empty string with card options when card is present

global DetectOldCards () -> boolean

Detect old ISA cards (which hwinfo doesn't know) using alsaconf

Return value:
success

global DetectHardware () -> boolean

do hardware detection

Return value:
success/failure

global ReadModulesConf () -> void

searches for sound alias in /etc/modules.conf

global getConfigurableCards (list<map> save_info) -> list<map>

returns list of autodetected sound cards that haven't been already configured

Parameters:
save_info list of already configured cards
Return value:
of unconfigured cards

global UpdateUnconfiguredCards () -> void

update list of unconfigured cards (necessary when deleting configured card)

global LoadDatabase (boolean use_ui) -> void

opens alsa sound cards database

Parameters:
use_ui

global Read (boolean interactive) -> boolean

Read all sound settings from the SCR

Parameters:
interactive if user could be asked for actions (currently only for detecting with alsaconf)
Return value:
True on success

global Set (map settings) -> void

Just Set module data

Parameters:
settings Sound configuration settings @return: void

global Import (map settings) -> boolean

Get all sound settings from the first parameter (For autoinstallation use.)

Parameters:
settings settings to import
Return value:
True on success

global Export () -> map

Dump the sound settings to a single map. self explaining (For use by autoinstallation.)

Return value:
Dumped settings (later acceptable by Import())

global Write () -> boolean

Update the SCR according to sound settings

Return value:
True on success

global Summary () -> string

returns html formated configuration summary

Return value:
Summary string

global CollectOptions (string modname) -> map

this function converts options for modules from 'modules_conf' data structure to another - it is needed for writing options to /etc/modules conf. eg. we have these configured cards: [ $["model": "sblive", "module":"snd-emu10k1", "options" :$["opt1": "a", "opt2": "b"]], $["model": "sblive", "module":"snd-emu10k1", "options": $["opt2": "c"]], $["model": "other", "module":"mod2", "options": $["opt1": "a", "opt2": "b"]] ] CollectOptions ("snd-emu10k1") returns $["opt1":"a,", "opt2":"b,c"]

Parameters:
modname module name
Return value:
Map with collected options

global CreateModprobeCommands () -> list

creates list of command that will be used for sound system start (emulates 'rcalsasound start' somehow)

Return value:
of shell commands

global ForceReset () -> void

reset settings. used at installation time when user invokes 'reset to original proposal'

global Propose () -> boolean

create a proposal

Return value:
success/failure

global StoreSettings () -> void

copy settings to backup variables

global RestoreSettings () -> void

restore settings from backup variables

global Changed () -> boolean

Status of configuration

Return value:
true if configuration was changed

global GetSoundCardList () -> list

returns list of configured/proposed sound cards.

Return value:
of maps: [$["name": "ASDASD", "card_no": 0]...]

global StoreUniqueKeys () -> void

stores unique keys. this function is not part of sound_write module because it should not be called during autoinstallation

global GetJoystickSettings (string modname) -> map

Get joystick settings from sound database

Parameters:
modname name of sound module
Return value:
map with options

global StoreMixer () -> void

store mixer settings

global SetVolume (integer c_id, string channel, integer value) -> boolean

sets the channel volume to value [0..100]

Parameters:
c_id card #
channel channel name
value volume of channel [0..100]
Return value:
success

global InitMixer (integer c_id, string modname) -> void

initialises volume after adding a new card. unmutes and sets volume for some channels

Parameters:
c_id card id.
modname name of sound module

global HasJoystick (integer c_id) -> boolean

Test whether sound card supports joystick

Parameters:
c_id id of sound card
Return value:
True if sound card c_id supports joystick

global GetSoundCardListWithJoy () -> list

Return list of configured/proposed sound cards which support joystick

Return value:
list of maps: [$["card_no":0, "name":"Sound Blaster Live!"]]

YaST2 Developers Documentation