diff --git a/asusctl/src/main.rs b/asusctl/src/main.rs index 2f5e18a0..618ff904 100644 --- a/asusctl/src/main.rs +++ b/asusctl/src/main.rs @@ -74,7 +74,15 @@ fn main() { println!("\nError: {e}\n"); print_info(); }) { - let asusd_version = platform_proxy.version().unwrap(); + let asusd_version = platform_proxy + .version() + .map_err(|e| { + error!( + "Could not get asusd version: {e:?}\nIs asusd.service running? {}", + check_service("asusd") + ); + }) + .unwrap(); if asusd_version != self_version { println!("Version mismatch: asusctl = {self_version}, asusd = {asusd_version}"); return; diff --git a/asusd/src/aura_anime/mod.rs b/asusd/src/aura_anime/mod.rs index 66fc920e..e2bec070 100644 --- a/asusd/src/aura_anime/mod.rs +++ b/asusd/src/aura_anime/mod.rs @@ -8,7 +8,7 @@ use std::sync::Arc; use std::thread::sleep; use config_traits::StdConfig; -use log::{error, info, warn}; +use log::{debug, error, info, warn}; use rog_anime::usb::{ pkt_flush, pkt_set_brightness, pkt_set_enable_display, pkt_set_enable_powersave_anim, pkts_for_init, Brightness @@ -59,6 +59,8 @@ impl AniMe { config.rename_file_old(); *config = AniMeConfig::new(); config.write(); + } else { + debug!("Initialised AniMe cache"); } } else { error!("AniMe Matrix could not init cache") @@ -70,7 +72,9 @@ impl AniMe { self.do_init_cache().await; let pkts = pkts_for_init(); self.write_bytes(&pkts[0]).await?; - self.write_bytes(&pkts[1]).await + self.write_bytes(&pkts[1]).await?; + debug!("Succesfully initialised AniMe matrix display"); + Ok(()) } pub async fn lock_config(&self) -> MutexGuard { diff --git a/asusd/src/aura_anime/trait_impls.rs b/asusd/src/aura_anime/trait_impls.rs index 74c683c2..85ed703c 100644 --- a/asusd/src/aura_anime/trait_impls.rs +++ b/asusd/src/aura_anime/trait_impls.rs @@ -1,7 +1,7 @@ use std::sync::atomic::Ordering; use config_traits::StdConfig; -use log::{error, warn}; +use log::{debug, error, warn}; use logind_zbus::manager::ManagerProxy; use rog_anime::usb::{ pkt_set_brightness, pkt_set_builtin_animations, pkt_set_enable_display, @@ -51,8 +51,11 @@ impl AniMeZbus { .object_server() .at(path.clone(), self) .await - .map_err(|e| error!("Couldn't add server at path: {path}, {e:?}")) - .ok(); + .map_err(|e| { + error!("Couldn't add server at path: {path}, {e:?}"); + e + })?; + debug!("start_tasks was successful"); Ok(()) } } diff --git a/asusd/src/aura_manager.rs b/asusd/src/aura_manager.rs index 7f7db4dc..6746a941 100644 --- a/asusd/src/aura_manager.rs +++ b/asusd/src/aura_manager.rs @@ -319,11 +319,17 @@ impl DeviceManager { if let DeviceHandle::AniMe(anime) = dev_type.clone() { let path = dbus_path_for_anime(); let ctrl = AniMeZbus::new(anime); - ctrl.start_tasks(connection, path.clone()).await.unwrap(); - devices.push(AsusDevice { - device: dev_type, - dbus_path: path - }); + if ctrl + .start_tasks(connection, path.clone()) + .await + .map_err(|e| error!("Failed to start tasks: {e:?}, not adding this device")) + .is_ok() + { + devices.push(AsusDevice { + device: dev_type, + dbus_path: path + }); + } } } else { info!("Tested device was not AniMe Matrix"); @@ -364,7 +370,9 @@ impl DeviceManager { pub async fn new(connection: Connection) -> Result { let conn_copy = connection.clone(); - let devices = Arc::new(Mutex::new(Self::find_all_devices(&conn_copy).await)); + let devices = Self::find_all_devices(&conn_copy).await; + info!("Found {} valid devices on startup", devices.len()); + let devices = Arc::new(Mutex::new(devices)); let manager = Self { _dbus_connection: connection }; @@ -372,8 +380,6 @@ impl DeviceManager { // TODO: The /sysfs/ LEDs don't cause events, so they need to be manually // checked for and added - // detect all plugged in aura devices (eventually) - // only USB devices are detected for here std::thread::spawn(move || { let mut monitor = MonitorBuilder::new()?.listen()?; let mut poll = Poll::new()?; @@ -420,7 +426,10 @@ impl DeviceManager { { index } else { - warn!("No device for dbus path: {path:?}"); + if dev_prop_matches(&event.device(), "ID_VENDOR_ID", "0b05") + { + warn!("No device for dbus path: {path:?}"); + } return Ok(()); }; info!("removing: {path:?}"); diff --git a/asusd/src/daemon.rs b/asusd/src/daemon.rs index 2b63efb8..cce422d5 100644 --- a/asusd/src/daemon.rs +++ b/asusd/src/daemon.rs @@ -100,6 +100,7 @@ async fn start_daemon() -> Result<(), Box> { // Request dbus name after finishing initalizing all functions server.request_name(DBUS_NAME).await?; + info!("Startup success, begining dbus server loop"); loop { // This is just a blocker to idle and ensure the reator reacts server.executor().tick().await; diff --git a/rog-control-center/src/main.rs b/rog-control-center/src/main.rs index 32874563..1d1b2871 100644 --- a/rog-control-center/src/main.rs +++ b/rog-control-center/src/main.rs @@ -49,7 +49,12 @@ async fn main() -> Result<()> { let self_version = env!("CARGO_PKG_VERSION"); let zbus_con = zbus::blocking::Connection::system()?; let platform_proxy = rog_dbus::zbus_platform::PlatformProxyBlocking::new(&zbus_con)?; - let asusd_version = platform_proxy.version().unwrap(); + let asusd_version = platform_proxy + .version() + .map_err(|e| { + println!("Could not get asusd version: {e:?}\nIs asusd.service running?"); + }) + .unwrap(); if asusd_version != self_version { println!("Version mismatch: asusctl = {self_version}, asusd = {asusd_version}"); return Ok(()); diff --git a/rog-control-center/src/tray.rs b/rog-control-center/src/tray.rs index b099a33f..0e4e6ab3 100644 --- a/rog-control-center/src/tray.rs +++ b/rog-control-center/src/tray.rs @@ -208,7 +208,15 @@ pub fn init_tray(_supported_properties: Vec, config: Arc warn!("Couldn't get mode form supergfxd: {e:?}") + Err(e) => match e { + zbus::Error::MethodError(_, _, message) => { + warn!( + "Couldn't get mode from supergfxd: {message:?}, the supergfxd service \ + may not be running or installed" + ) + } + _ => warn!("Couldn't get mode from supergfxd: {e:?}") + } } info!("Started ROGTray"); diff --git a/rog-control-center/translations/en/rog-control-center.po b/rog-control-center/translations/en/rog-control-center.po index 6fd37c7c..f1e1fcfa 100644 --- a/rog-control-center/translations/en/rog-control-center.po +++ b/rog-control-center/translations/en/rog-control-center.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2025-01-19 10:35+0000\n" +"POT-Creation-Date: 2025-01-20 00:43+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -88,7 +88,7 @@ msgid "POST boot sound" msgstr "" #: rog-control-center/ui/pages/system.slint:224 -msgctxt "no_asus_armoury_driver_2" +msgctxt "no_asus_armoury_driver_1" msgid "The asus-armoury driver is not loaded" msgstr "" diff --git a/rog-control-center/ui/pages/system.slint b/rog-control-center/ui/pages/system.slint index 4bdcd8cd..2aa4fd94 100644 --- a/rog-control-center/ui/pages/system.slint +++ b/rog-control-center/ui/pages/system.slint @@ -221,7 +221,7 @@ export component PageSystem inherits Rectangle { max-height: 30px; VerticalBox { Text { - text: @tr("no_asus_armoury_driver_2" => "The asus-armoury driver is not loaded"); + text: @tr("no_asus_armoury_driver_1" => "The asus-armoury driver is not loaded"); font-size: 16px; horizontal-alignment: TextHorizontalAlignment.center; }