+
     Gi  c                   s    ^RI Ht ^RI5 ^ RIt^ RIHt ^ RIt^ RIt^ RI	t	^ RI
t
]P                  P                  4       t]! 4       t ! R R]P                  4      tR# )i   )hotplug)Z*N)commandsc                   s   a  ] tR t^t o RtR tR tR tR t]	R 4       t
R tR t]! R	R
R7      R 4       t]! R	4      RR l4       t]! RR
R7      R 4       t]! R4      RR l4       tRtV tR# )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
----
====
c                s   R V n         \        4       V n        \        4       V n        V P                  P                  R4      P                  R4       F8  pV P                  V4      pVR9   g   K  V P                  P                  V4       K:  	  R# )TZsoundzcard*N)Zsnd_hda_intelZsnd_ac97_codec)	_devices_supportedZset_assigned_devices_free_devicesZ_hardware_inventoryZget_devicesZmatch_sys_name_device_module_nameZadd)selfdeviceZmodule_names   &  ?/usr/lib/python3.14/site-packages/tuned/plugins/plugin_audio.py_init_devicesZAudioPlugin._init_devices&   sr     $5$u$((44W=LLWUf))&1;88;' V    c                s"    R Vn         RVn        R# )TFN)Z_has_static_tuningZ_has_dynamic_tuningr   instance   &&r	   _instance_initZAudioPlugin._instance_init0   s     $(!&(r   c                s    R # N r   r   r	   _instance_cleanupZAudioPlugin._instance_cleanup4   s    r   c                s@     VP                   P                  #     R # ; ir   )ZparentZdriverr   r   r   r	   r   ZAudioPlugin._device_module_name7   s!    
--


s    c                s    R ^ RR/# )timeoutreset_controllerTr   )Zclss   &r	   _get_config_optionsZAudioPlugin._get_config_options=   s     qt
 r   c                    R V,          # )z$/sys/module/%s/parameters/power_saver   r   r   r	   _timeout_pathZAudioPlugin._timeout_pathD   s    	/&	88r   c                r   )z//sys/module/%s/parameters/power_save_controllerr   r   r   r	   _reset_controller_pathZ"AudioPlugin._reset_controller_pathG   s    	:V	CCr   r   T)Z
per_devicec                s.    \        V4      pT^ 8  dT   T P	                  T4      pT'       g9   \
        P                  TRT,          T'       d   \        P                  .MRR7       T# R#   \         d!    \        P                  R T,          4        R# i ; i)z!timeout value '%s' is not integerNz%dFZno_error)	ZintZ
ValueErrorlogZerrorr   cmdwrite_to_fileerrnoENOENT)r   valuer   r   simremover   sys_file   &&&&&&  r	   _set_timeoutZAudioPlugin._set_timeoutJ   s    Z7 \  (8
hw"(e  5
>
 
 990589
s   A) )'BBc                sx    V P                  V4      p\        P                  WCR 7      p\        V4      ^ 8  d   V# R# )r   N)r   r   	read_filelenr   r   r   Zignore_missingr#   r       &&&&  r	   _get_timeoutZAudioPlugin._get_timeoutZ   s5    '(
---
:%Z!^
<	r   r   c                s   \         P                  V4      pV P                  V4      p\        P                  P                  V4      '       d;   V'       g1   \         P                  YvV'       d   \        P                  .MR R7       V# R# )Fr   N)	r   get_boolr   ospathexistsr   r   r   )r   r    r   r   r!   r"   Zvr#   r$   r	   _set_reset_controllerZ!AudioPlugin._set_reset_controllerb   s`    	ll5!((0(WW^^H
h"(e  5
8	r   c                s    V P                  V4      p\        P                  P                  V4      '       d;   \        P                  V4      p\        V4      ^ 8  d   \        P                  V4      # R# )i    N)r   r,   r-   r.   r   r&   r'   r+   r(   r)   r	   _get_reset_controllerZ!AudioPlugin._get_reset_controllerm   sP    ((0(WW^^H=="5	%j1n<<	r   )r   r   r   N)F)Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__r
   r   r   r   Zclassmethodr   r   r   Zcommand_setr%   Zcommand_getr*   r/   r0   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r	   r   r      s     .('  9D id+ , i   t4 5  ! "r   r   )Z r    Z
decoratorsZ
tuned.logsZtunedZtuned.utils.commandsr   r,   r   ZstructZglobZlogsZgetr   r   ZPluginr   r   r   r	   <module>r1      sF       ) 	   jjnnjf'.. fr   