From 622cd9d94390a1a68623ea776eafd2d5697209aa Mon Sep 17 00:00:00 2001 From: Luke D Jones Date: Thu, 24 Sep 2020 07:53:34 +1200 Subject: [PATCH] Fix timeout for GFX switching --- Cargo.lock | 6 +++--- asus-nb-ctrl/Cargo.toml | 2 +- asus-nb-ctrl/src/main.rs | 2 +- asus-nb/Cargo.toml | 2 +- asus-nb/src/core_dbus.rs | 26 +++++++++++++------------- asus-notify/Cargo.toml | 2 +- ctrl-gfx/src/lib.rs | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7dbf76bb..d2be0fd1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -29,7 +29,7 @@ checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" [[package]] name = "asus-nb" -version = "2.0.2" +version = "2.0.4" dependencies = [ "ctrl-gfx", "dbus", @@ -46,7 +46,7 @@ dependencies = [ [[package]] name = "asus-nb-ctrl" -version = "2.0.3" +version = "2.0.4" dependencies = [ "asus-nb", "ctrl-gfx", @@ -69,7 +69,7 @@ dependencies = [ [[package]] name = "asus-notify" -version = "1.0.1" +version = "2.0.4" dependencies = [ "asus-nb", "asus-nb-ctrl", diff --git a/asus-nb-ctrl/Cargo.toml b/asus-nb-ctrl/Cargo.toml index 8bc9407d..d0cbd23b 100644 --- a/asus-nb-ctrl/Cargo.toml +++ b/asus-nb-ctrl/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "asus-nb-ctrl" -version = "2.0.3" +version = "2.0.4" license = "MPL-2.0" readme = "README.md" authors = ["Luke "] diff --git a/asus-nb-ctrl/src/main.rs b/asus-nb-ctrl/src/main.rs index fd0a3821..1bb3db3f 100644 --- a/asus-nb-ctrl/src/main.rs +++ b/asus-nb-ctrl/src/main.rs @@ -107,7 +107,7 @@ fn do_gfx( ) -> Result<(), Box> { if let Some(mode) = command.mode { println!("Updating settings, please wait..."); - println!("If this takes longer than 30s, ctrl+c then check journalctl"); + println!("If this takes longer than 30s, ctrl+c then check `journalctl -b -u asusd`"); writer.write_gfx_mode(mode)?; let res = writer.wait_gfx_changed()?; diff --git a/asus-nb/Cargo.toml b/asus-nb/Cargo.toml index 753c66cb..eb7eb10e 100644 --- a/asus-nb/Cargo.toml +++ b/asus-nb/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "asus-nb" -version = "2.0.2" +version = "2.0.4" license = "MPL-2.0" readme = "README.md" authors = ["Luke "] diff --git a/asus-nb/src/core_dbus.rs b/asus-nb/src/core_dbus.rs index 48b6452b..600da2e7 100644 --- a/asus-nb/src/core_dbus.rs +++ b/asus-nb/src/core_dbus.rs @@ -37,7 +37,7 @@ impl CtrlSignals { let proxy = connection.with_proxy( "org.asuslinux.Daemon", "/org/asuslinux/Gfx", - Duration::from_millis(5000), + Duration::from_secs(2), ); let gfx_vendor_signal = Arc::new(Mutex::new(None)); @@ -68,7 +68,7 @@ impl CtrlSignals { let proxy = connection.with_proxy( "org.asuslinux.Daemon", "/org/asuslinux/Profile", - Duration::from_millis(5000), + Duration::from_secs(2), ); let profile_signal = Arc::new(Mutex::new(None)); @@ -87,7 +87,7 @@ impl CtrlSignals { let proxy = connection.with_proxy( "org.asuslinux.Daemon", "/org/asuslinux/Led", - Duration::from_millis(5000), + Duration::from_secs(2), ); let ledmode_signal = Arc::new(Mutex::new(None)); @@ -108,7 +108,7 @@ impl CtrlSignals { let proxy = connection.with_proxy( "org.asuslinux.Daemon", "/org/asuslinux/Charge", - Duration::from_millis(5000), + Duration::from_secs(2), ); let charge_signal = Arc::new(Mutex::new(None)); @@ -168,7 +168,7 @@ impl AuraDbusClient { pub fn wait_gfx_changed(&self) -> Result> { loop { - self.connection.process(Duration::from_micros(500))?; + self.connection.process(Duration::from_millis(1))?; if let Ok(lock) = self.signals.gfx_action_signal.lock() { if let Some(stuff) = lock.as_ref() { return Ok(stuff.to_string()); @@ -185,7 +185,7 @@ impl AuraDbusClient { let proxy = self.connection.with_proxy( "org.asuslinux.Daemon", "/org/asuslinux/Led", - Duration::from_millis(5000), + Duration::from_secs(2), ); proxy.set_led_mode(&serde_json::to_string(&mode)?)?; Ok(()) @@ -224,7 +224,7 @@ impl AuraDbusClient { let proxy = self.connection.with_proxy( "org.asuslinux.Daemon", "/org/asuslinux/Led", - Duration::from_millis(5000), + Duration::from_secs(2), ); proxy.set_led_mode(&serde_json::to_string(mode)?)?; Ok(()) @@ -235,7 +235,7 @@ impl AuraDbusClient { let proxy = self.connection.with_proxy( "org.asuslinux.Daemon", "/org/asuslinux/Gfx", - Duration::from_millis(5000), + Duration::from_secs(2), ); let x = proxy.power()?; Ok(x) @@ -246,7 +246,7 @@ impl AuraDbusClient { let proxy = self.connection.with_proxy( "org.asuslinux.Daemon", "/org/asuslinux/Gfx", - Duration::from_millis(5000), + Duration::from_secs(2), ); let x = proxy.vendor()?; Ok(x) @@ -257,7 +257,7 @@ impl AuraDbusClient { let proxy = self.connection.with_proxy( "org.asuslinux.Daemon", "/org/asuslinux/Gfx", - Duration::from_millis(5000), + Duration::from_secs(30), ); proxy.set_vendor(<&str>::from(&vendor))?; Ok(()) @@ -268,7 +268,7 @@ impl AuraDbusClient { let proxy = self.connection.with_proxy( "org.asuslinux.Daemon", "/org/asuslinux/Profile", - Duration::from_millis(5000), + Duration::from_secs(2), ); proxy.set_profile(&serde_json::to_string(&ProfileEvent::ChangeMode(level))?)?; Ok(()) @@ -282,7 +282,7 @@ impl AuraDbusClient { let proxy = self.connection.with_proxy( "org.asuslinux.Daemon", "/org/asuslinux/Profile", - Duration::from_millis(5000), + Duration::from_secs(2), ); proxy.set_profile(&serde_json::to_string(cmd)?)?; Ok(()) @@ -293,7 +293,7 @@ impl AuraDbusClient { let proxy = self.connection.with_proxy( "org.asuslinux.Daemon", "/org/asuslinux/Charge", - Duration::from_millis(5000), + Duration::from_secs(2), ); proxy.set_limit(level)?; Ok(()) diff --git a/asus-notify/Cargo.toml b/asus-notify/Cargo.toml index 4edbd96d..e61ae457 100644 --- a/asus-notify/Cargo.toml +++ b/asus-notify/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "asus-notify" -version = "1.0.1" +version = "2.0.4" authors = ["Luke D Jones "] edition = "2018" diff --git a/ctrl-gfx/src/lib.rs b/ctrl-gfx/src/lib.rs index a7e1e96e..293beb39 100644 --- a/ctrl-gfx/src/lib.rs +++ b/ctrl-gfx/src/lib.rs @@ -9,7 +9,7 @@ pub mod system; const PRIME_DISCRETE_PATH: &str = "/etc/prime-discrete"; const MODPROBE_PATH: &str = "/etc/modprobe.d/asusd.conf"; const INITRAMFS_PATH: &str = "/usr/sbin/update-initramfs"; -//const DRACUT_PATH: &str = "/usr/bin/dracut"; +// const DRACUT_PATH: &str = "/usr/bin/dracut"; static MODPROBE_NVIDIA: &[u8] = MODPROBE_HYBRID;