244. Sound

Sound data

244.1. Summary of Module Globals

List of Global Functions

  • Changed - Status of configuration

  • CollectOptions - 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"]

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

  • DetectHardware - do hardware detection

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

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

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

  • GetJoystickSettings - Get joystick settings from sound database

  • GetModified - Functions which returns if the settings were modified

  • GetSoundCardList - returns list of configured/proposed sound cards.

  • GetSoundCardListWithJoy - Return list of configured/proposed sound cards which support joystick

  • HasJoystick - Test whether sound card supports joystick

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

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

  • LoadDatabase - opens alsa sound cards database

  • LoadPackageDatabase - opens alsa sound cards database

  • ProbeOldChip - Probe one card with alsaconf call

  • Propose - create a proposal

  • Read - Read all sound settings from the SCR

  • ReadModulesConf - searches for sound alias in /etc/modules.conf

  • RequiredKernelModules - Get list of all kernel modules which are requied by the configured cards

  • RestoreSettings - restore settings from backup variables

  • Set - Just Set module data

  • SetModified - Function sets internal variable, which indicates, that any settings were modified, to "true"

  • SetVolume - sets the channel volume to value [0..100]

  • Sound - sound module constructor

  • StoreMixer - store mixer settings

  • StoreSettings - copy settings to backup variables

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

  • Summary - returns html formated configuration summary

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

  • Write - Update the SCR according to sound settings

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

List of Global Variables

  • STRINGS - text constants for sound module

  • card_id - id of current card

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

  • curr_driver - currently used card driver (pointer to table)

  • curr_model - currently used card model (pointer to table)

  • curr_vendor - currently used card vendor (pointer to table)

  • db_indices -

  • db_module_index -

  • db_modules - module details

  • db_vendors - map of card vendors

  • default_volume - default value of volume for new card

  • detected_cards - list for storing detected cards

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

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

  • modules_conf_b - backup structures for sound settings

  • proposal_created - was the proposal already generated?

  • rc_vars - rc settings

  • removed_info - list for storing information about removed cards

  • save_entry - configuration map of current card

  • skip_detection - Do not detect sounc cards, skip hardware probing

  • unconfigured_cards - list of detected and unconfigured cards

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

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

  • used_modprobe_conf - 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

  • volume_settings - settings to save using .audio.alsa ... mixer

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

244.2. Global Functions

244.2.1. Changed

Status of configuration

Return value

  • boolean - true if configuration was changed

244.2.2. CollectOptions

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"]

Function parameters

  • string modname

Return value

  • map - Map with collected options

244.2.3. CreateModprobeCommands

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

Return value

  • list - of shell commands

244.2.4. DetectHardware

do hardware detection

Return value

  • boolean - success/failure

244.2.5. DetectOldCards

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

Return value

  • boolean - success

244.2.6. Export

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

Return value

  • map - Dumped settings (later acceptable by Import())

244.2.7. ForceReset

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

Return value

  • void

244.2.8. GetJoystickSettings

Get joystick settings from sound database

Function parameters

  • string modname

Return value

  • map - map with options

244.2.9. GetModified

Functions which returns if the settings were modified

Return value

  • boolean - settings were modified

244.2.10. GetSoundCardList

returns list of configured/proposed sound cards.

Return value

  • list - of maps: [$["name": "ASDASD", "card_no": 0]...]

244.2.11. GetSoundCardListWithJoy

Return list of configured/proposed sound cards which support joystick

Return value

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

244.2.12. HasJoystick

Test whether sound card supports joystick

Function parameters

  • integer c_id

Return value

  • boolean - True if sound card c_id supports joystick

244.2.13. Import

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

Function parameters

  • map settings

Return value

  • boolean - True on success

244.2.14. InitMixer

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

Function parameters

  • integer c_id

  • string modname

Return value

  • void

244.2.15. LoadDatabase

opens alsa sound cards database

Function parameters

  • boolean use_ui

Return value

  • void

244.2.16. LoadPackageDatabase

opens alsa sound cards database

Return value

  • void

244.2.17. ProbeOldChip

Probe one card with alsaconf call

Function parameters

  • string chip

Return value

  • string - non-empty string with card options when card is present

244.2.18. Propose

create a proposal

Return value

  • boolean - success/failure

244.2.19. Read

Read all sound settings from the SCR

Function parameters

  • boolean interactive

Return value

  • boolean - True on success

244.2.20. ReadModulesConf

searches for sound alias in /etc/modules.conf

Return value

  • void

244.2.21. RequiredKernelModules

Get list of all kernel modules which are requied by the configured cards

Return value

  • list<string> - Unique list of modules

244.2.22. RestoreSettings

restore settings from backup variables

Return value

  • void

244.2.23. Set

Just Set module data

Function parameters

  • map settings

Return value

  • void

244.2.24. SetModified

Function sets internal variable, which indicates, that any settings were modified, to "true"

Return value

  • void

244.2.25. SetVolume

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

Function parameters

  • integer c_id

  • string channel

  • integer value

Return value

  • boolean - success

244.2.26. Sound

sound module constructor

Return value

  • void

244.2.27. StoreMixer

store mixer settings

Return value

  • void

244.2.28. StoreSettings

copy settings to backup variables

Return value

  • void

244.2.29. StoreUniqueKeys

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

Return value

  • void

244.2.30. Summary

returns html formated configuration summary

Return value

  • string - Summary string

244.2.31. UpdateUnconfiguredCards

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

Return value

  • void

244.2.32. Write

Update the SCR according to sound settings

Return value

  • boolean - True on success

244.2.33. getConfigurableCards

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

Function parameters

  • list<map> save_info

Return value

  • list<map> - of unconfigured cards

244.3. Global Variables

244.3.1. STRINGS

text constants for sound module

244.3.2. card_id

id of current card

244.3.3. configure_detected

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

244.3.4. curr_driver

currently used card driver (pointer to table)

244.3.5. curr_model

currently used card model (pointer to table)

244.3.6. curr_vendor

currently used card vendor (pointer to table)

244.3.7. db_indices

244.3.8. db_module_index

244.3.9. db_modules

module details

244.3.10. db_vendors

map of card vendors

244.3.11. default_volume

default value of volume for new card

244.3.12. detected_cards

list for storing detected cards

244.3.13. installation

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

244.3.14. modules_conf

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

244.3.15. modules_conf_b

backup structures for sound settings

244.3.16. proposal_created

was the proposal already generated?

244.3.17. rc_vars

rc settings

244.3.18. removed_info

list for storing information about removed cards

244.3.19. save_entry

configuration map of current card

244.3.20. skip_detection

Do not detect sounc cards, skip hardware probing

244.3.21. unconfigured_cards

list of detected and unconfigured cards

244.3.22. use_alsa

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

244.3.23. use_ui

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

244.3.24. used_modprobe_conf

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

244.3.25. volume_settings

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

244.3.26. write_only

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

244.4. Module Requirements

244.4.1. Module Imports

  • Arch
  • Crash
  • Label
  • Mode
  • Package
  • Progress
  • String
  • Summary

244.4.2. Module Includes

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