403Webshell
Server IP : 23.254.227.96  /  Your IP : 216.73.216.7
Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64
User : viralblo ( 1001)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.6/site-packages/tuned/plugins/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.6/site-packages/tuned/plugins/__pycache__/plugin_audio.cpython-36.pyc
3

��c��@sfddlmZddlTddlZddlmZddlZddlZddl	Z	ej
j�Ze�Z
Gdd�dej�ZdS)�)�hotplug)�*�N)�commandsc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zed
d��Z	dd
�Z
dd�Zeddd�dd��Z
ed�ddd��Zeddd�dd��Zed�ddd��ZdS) �AudioPlugina�
	`audio`::
	
	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
	----
	====
	cCsTd|_t�|_t�|_x8|jjd�jd�D]"}|j|�}|dkr*|jj|�q*WdS)NTZsoundzcard*�
snd_hda_intel�snd_ac97_codec)rr)	Z_devices_supported�setZ_assigned_devicesZ
_free_devicesZ_hardware_inventoryZget_devicesZmatch_sys_name�_device_module_name�add)�self�deviceZmodule_name�r�"/usr/lib/python3.6/plugin_audio.py�
_init_devices's
zAudioPlugin._init_devicescCsd|_d|_dS)NTF)Z_has_static_tuningZ_has_dynamic_tuning)r�instancerrr�_instance_init1szAudioPlugin._instance_initcCsdS)Nr)rrrrr�_instance_cleanup5szAudioPlugin._instance_cleanupc	Csy|jjSdSdS)N)�parentZdriver)rr
rrrr
8szAudioPlugin._device_module_namecCs
ddd�S)NrF)�timeout�reset_controllerr)�clsrrr�_get_config_options>szAudioPlugin._get_config_optionscCsd|S)Nz$/sys/module/%s/parameters/power_saver)rr
rrr�
_timeout_pathEszAudioPlugin._timeout_pathcCsd|S)Nz//sys/module/%s/parameters/power_save_controllerr)rr
rrr�_reset_controller_pathHsz"AudioPlugin._reset_controller_pathrT)Z
per_devicecCsbyt|�}Wn"tk
r.tjd|�dSX|dkrZ|j|�}|sVtj|d|�|SdSdS)Nz!timeout value '%s' is not integerrz%d)�int�
ValueError�log�errorr�cmd�
write_to_file)r�valuer
�simr�sys_filerrr�_set_timeoutKs
zAudioPlugin._set_timeoutFcCs,|j|�}tj||d�}t|�dkr(|SdS)N)Zno_errorr)rr�	read_file�len)rr
�ignore_missingr#r!rrr�_get_timeoutZs

zAudioPlugin._get_timeoutrcCs8tj|�}|j|�}tjj|�r4|s0tj||�|SdS)N)r�get_boolr�os�path�existsr )rr!r
r"�vr#rrr�_set_reset_controllerbs

z!AudioPlugin._set_reset_controllercCs:|j|�}tjj|�r6tj|�}t|�dkr6tj|�SdS)Nr)rr*r+r,rr%r&r))rr
r'r#r!rrr�_get_reset_controllerls


z!AudioPlugin._get_reset_controllerN)F)F)�__name__�
__module__�__qualname__�__doc__rrrr
�classmethodrrrZcommand_setr$Zcommand_getr(r.r/rrrrr
s

r)�rZ
decoratorsZ
tuned.logsZtunedZtuned.utils.commandsrr*�structZglobZlogs�getrrZPluginrrrrr�<module>s


Youez - 2016 - github.com/yon3zu
LinuXploit