Meumeu / ZephyrusBling

A utility to display images on the LEDs on the back of the Zephyrus G14 laptop
69 stars 9 forks source link

Issue with new hid_asus_rog module #4

Closed SimoneNascivera closed 3 years ago

SimoneNascivera commented 3 years ago

Hi, I'm trying using your tool with the new asus kernel module (https://gitlab.com/asus-linux/hid-asus-rog) instead of using rog-core, as pointed from the README of the rog-core repo itself. I was able to compile everything with no issues, but when I try running zephyrusblingd it gives me this error:

terminate called after throwing an instance of 'sdbus::Error'
  what():  [org.freedesktop.DBus.Error.FileNotFound] Failed to open bus (No such file or directory)
Aborted

What am I doing wrong? Is the rog-core package mandatory? If so, can I install it along the existing hid-asus-rog kernel module?

Thanks, Simone

Meumeu commented 3 years ago

Hi, it doesn't use the hid-asus-rog kernel module actually. Everything is sent to asusd which uses libusb to talk with the LEDs, so you should install asus-nb-ctrl (which is basically the new name of rog-core) to make it work. rog-core has actually been deprecated but I forgot to update the readme...

SimoneNascivera commented 3 years ago

Hi, Thank you for the quick response. asus-nb-ctrl is installed and I'm able to use FN shortcut like setting keyboard backlight. It there anything I can do to further debug the issue? I'm using ubuntu 20.04

Meumeu commented 3 years ago

If there is no error message about dbus anymore, that means zephyrusblingd can call asusd. If there is still nothing on the LEDs you can try running asusctl anime --on in case they are off.

SimoneNascivera commented 3 years ago

Hi, I had already installed asus-nb-ctrl when I compiled and run the repo and I still get the same error even if the leds are on with the default image (rog one). I'm trying to debug it and the issue is when sdbus cop lib tries to establish a connection. I will try to manually compile last version of asus-nb-ctrl and check if it changes anything.

SimoneNascivera commented 3 years ago

Before compiling asus-nb-ctrl repo the command asusctl anime --on gave me a Command not found error, while after compiling it gives me Error: D-Bus error: The name org.asuslinux.Daemon was not provided by any .service files (org.freedesktop.DBus.Error.ServiceUnknown). After removing /etc/asusd/asusd.conf, I can properly switch the leds on / off with asusctl command but still I can't run zephyrusblingd

Meumeu commented 3 years ago

It seems the asusd service is not running, what does systemctl status asusd says? Mine says:

● asusd.service - ASUS Notebook Control
     Loaded: loaded (/usr/lib/systemd/system/asusd.service; static)
     Active: active (running) since Fri 2020-10-30 22:46:16 CET; 23h ago

If it's not running, start it with systemctl start asusd as root (and systemctl enable asusd to start it at boot)

SimoneNascivera commented 3 years ago

It seems like it's running

● asusd.service - ASUS Notebook Control
     Loaded: loaded (/lib/systemd/system/asusd.service; static; vendor preset: >
     Active: active (running) since Sat 2020-10-31 21:57:03 CET; 2min 10s ago
   Main PID: 1033 (asusd)
      Tasks: 3 (limit: 37763)
     Memory: 2.7M
     CGroup: /system.slice/asusd.service
             └─1033 /usr/bin/asusd
SimoneNascivera commented 3 years ago

Update: I'm debugging sdbus cpp line by line and the issue appears here:

return std::make_unique<sdbus::internal::Connection>(std::move(interface), remote_system_bus, host);

For context, this is the function where it's called:

    std::unique_ptr<sdbus::IConnection> createSessionBusConnection()
    {
        auto interface = std::make_unique<sdbus::internal::SdBus>();
        assert(interface != nullptr);
        constexpr sdbus::internal::Connection::session_bus_t session_bus;
        return std::make_unique<sdbus::internal::Connection>(std::move(interface), session_bus);
    }

Have you ever encountered an issue with this particular piece of code?

Meumeu commented 3 years ago

It seems like its not able to make a dbus connection, are you using the latest version? There's been a PR 2 days ago to use asusd so if you've cloned it before it's trying to connect to rog-core instead of asusd, that would explain the dbus error.

SimoneNascivera commented 3 years ago

Are you referring to ZephyrusBling or to sdbus cpp?

Meumeu commented 3 years ago

ZephyrusBling

SimoneNascivera commented 3 years ago

I did a clean install of both this repo and of sdbus cpp. After compiling both of them, if I run ./zephyrusblingd without sudo it gives me no errors but when I run in another tab ./zephyrusbling --image ../tux.png --fx scale:0.8,0.8 --fx rotate:0,0:3,19 --fx translate:0,-20,0:3,20,0 it gives me Bling /org/meumeu/blings/3 created but nothing is displayed on the screen

SimoneNascivera commented 3 years ago

It's weird because if I run dbus-send --system --type=method_call --dest=org.asuslinux.Daemon /org/asuslinux/Anime org.asuslinux.Daemon.SetOnOff boolean:true from terminal I'm able to show/hide the leds.

SimoneNascivera commented 3 years ago

Ok I got something. When running dbus-monitor with sudo dbus-monitor --system |grep -A2 asuslinux and running the zephyrusblingd the array data looks empty:

method call time=1604237716.657360 sender=:1.184 -> destination=org.asuslinux.Daemon serial=27 path=/org/asuslinux/Anime; interface=org.asuslinux.Daemon; member=SetAnime
   array [
      array of bytes [

Could you please try the same in order to compare the 2 results? Thank you for your patience

SimoneNascivera commented 3 years ago

Solved. I had to firstly change to a different pattern from the proprietary application in Windows. Then after rebooting,everything works just fine!!!!! Thank you!

Meumeu commented 3 years ago

Good to know, I've never had this issue myself.