JFIF$        dd7 

Viewing File: /usr/lib/python3.9/site-packages/tuned/plugins/__pycache__/plugin_audio.cpython-39.opt-1.pyc

a

���h��@snddlmZddlTddlZddlmZddlZddlZddl	Z	ddl
Z
ej��Z
e�ZGdd�dej�ZdS)�)�hotplug)�*�N)�commandsc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zed
d��Z	dd
�Z
dd�Zeddd�dd��Z
ed�ddd��Zeddd�dd��Zed�ddd��ZdS) �AudioPlugina�
	Sets audio cards power saving options. The plug-in sets the auto suspend
	timeout for audio codecs to the value specified by the [option]`timeout`
	option.

	Currently, the `snd_hda_intel` and `snd_ac97_codec` codecs are
	supported and the [option]`timeout` value is in seconds. To disable
	auto suspend for these codecs, set the [option]`timeout` value
	to `0`. To enforce the controller reset, set the option
	[option]`reset_controller` to `true`. Note that power management
	is supported per module. Hence, the kernel module names are used as
	device names.

	.Set the timeout value to 10s and enforce the controller reset
	====
	----
	[audio]
	timeout=10
	reset_controller=true
	----
	====
	cCsPd|_t�|_t�|_|j�d��d�D]"}|�|�}|dvr(|j�|�q(dS)NTZsoundzcard*)Z
snd_hda_intelZsnd_ac97_codec)	Z_devices_supported�setZ_assigned_devicesZ
_free_devicesZ_hardware_inventoryZget_devicesZmatch_sys_name�_device_module_name�add)�self�deviceZmodule_name�r�>/usr/lib/python3.9/site-packages/tuned/plugins/plugin_audio.py�
_init_devices&s
zAudioPlugin._init_devicescCsd|_d|_dS)NTF)Z_has_static_tuningZ_has_dynamic_tuning�r
�instancerrr
�_instance_init0szAudioPlugin._instance_initcCsdS�Nrrrrr
�_instance_cleanup4szAudioPlugin._instance_cleanupcCsz
|jjWSYdS0dSr)�parentZdriver�r
rrrr
r7s
zAudioPlugin._device_module_namecCs
ddd�S)NrT)�timeout�reset_controllerr)�clsrrr
�_get_config_options=s�zAudioPlugin._get_config_optionscCsd|S)Nz$/sys/module/%s/parameters/power_saverrrrr
�
_timeout_pathDszAudioPlugin._timeout_pathcCsd|S)Nz//sys/module/%s/parameters/power_save_controllerrrrrr
�_reset_controller_pathGsz"AudioPlugin._reset_controller_pathrT)Z
per_devicecCsrzt|�}Wn"ty.t�d|�YdS0|dkrj|�|�}|sftj|d||r^tjgndd�|SdSdS)Nz!timeout value '%s' is not integerrz%dF�Zno_error)	�int�
ValueError�log�errorr�cmd�
write_to_file�errno�ENOENT)r
�valuerr�sim�remover�sys_filerrr
�_set_timeoutJs
�zAudioPlugin._set_timeoutFcCs,|�|�}tj||d�}t|�dkr(|SdS)Nrr)rr!�	read_file�len�r
rrZignore_missingr(r%rrr
�_get_timeoutZs

zAudioPlugin._get_timeoutrcCsHt�|�}|�|�}tj�|�rD|s@tj|||r8tjgndd�|SdS)NFr)	r!�get_boolr�os�path�existsr"r#r$)r
r%rrr&r'�vr(rrr
�_set_reset_controllerbs

�z!AudioPlugin._set_reset_controllercCs:|�|�}tj�|�r6t�|�}t|�dkr6t�|�SdS)Nr)rr/r0r1r!r*r+r.r,rrr
�_get_reset_controllerms


z!AudioPlugin._get_reset_controllerN)F)F)�__name__�
__module__�__qualname__�__doc__rrrr�classmethodrrrZcommand_setr)Zcommand_getr-r3r4rrrr
rs"






r)�rZ
decoratorsZ
tuned.logsZtunedZtuned.utils.commandsrr/r#�struct�globZlogs�getrr!ZPluginrrrrr
�<module>s

Back to Directory  nL+D550H?Mx ,D"v]qv;6*Zqn)ZP0!1 A "#a$2Qr D8 a Ri[f\mIykIw0cuFcRı?lO7к_f˓[C$殷WF<_W ԣsKcëIzyQy/_LKℂ;C",pFA:/]=H  ~,ls/9ć:[=/#f;)x{ٛEQ )~ =𘙲r*2~ a _V=' kumFD}KYYC)({ *g&f`툪ry`=^cJ.I](*`wq1dđ#̩͑0;H]u搂@:~וKL Nsh}OIR*8:2 !lDJVo(3=M(zȰ+i*NAr6KnSl)!JJӁ* %݉?|D}d5:eP0R;{$X'xF@.ÊB {,WJuQɲRI;9QE琯62fT.DUJ;*cP A\ILNj!J۱+O\͔]ޒS߼Jȧc%ANolՎprULZ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