kozec / sc-controller

User-mode driver and GTK3 based GUI for Steam Controller
GNU General Public License v2.0
1.53k stars 129 forks source link

Gui errors in Arch Linux #50

Closed richese closed 8 years ago

richese commented 8 years ago

Hello, I tried to use this driver but I get some errors in the Gui and I can't save or select profiles. The daemon seems to be working when it's started manually with a profile.

I am using Arch Linux. The result is the same whether I use the AUR package (0.2.9.1) or run it directly from git repo.

Gui startup:

$ sc-controller -d
D App           daemon status: unknown
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/scc/gui/userdata_manager.py", line 107, in _on_user_data_loaded
    f = pdir.get_child(finfo.get_name())
TypeError: Argument 1 does not allow None as a value
D DaemonCtrlr   Connected to daemon, version 0.2.9
D DaemonCtrlr   Daemon reported profile change: /dev/null
D App           Daemon uses profile '/dev/null', selecting it in UI
D DaemonCtrlr   Daemon is ready.
D App           daemon status: alive

The TypeError happens every time the Gui is started.

Here is what happens when I press the OK button when configuring any button:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/scc/gui/action_editor.py", line 385, in on_btOK_clicked
    self.ac_callback(self.id, a)
  File "/usr/lib/python2.7/site-packages/scc/gui/app.py", line 377, in on_action_chosen
    self.on_profile_changed()
  File "/usr/lib/python2.7/site-packages/scc/gui/app.py", line 338, in on_profile_changed
    modfile = Gio.File.new_for_path(self.current_file.get_path() + ".mod")
AttributeError: 'NoneType' object has no attribute 'get_path'

And when I press the save profile button:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/scc/gui/app.py", line 368, in on_btSaveProfile_clicked
    self.save_profile(self.current_file, self.current)
  File "/usr/lib/python2.7/site-packages/scc/gui/userdata_manager.py", line 56, in save_profile
    if giofile.get_path().startswith(get_default_profiles_path()):
AttributeError: 'NoneType' object has no attribute 'get_path'

Screenshot of the Gui: 2016-07-02-085828_930x541_scrot

kozec commented 8 years ago

That looks like you don't have any profiles available, not even default ones.

Can you, please, post output of:

ls ~/.config/scc/profiles/
ls /usr/share/scc/default_profiles/

?

edit: also,

pacman -Ql sc-controller sc-controller-git | grep default

may be helpful.

richese commented 8 years ago

Here are the outputs:

$ ls ~/.config/scc/profiles/
'Euro Truck Simulator 2.sccprofile'
$ ls /usr/share/scc/default_profiles/
Desktop.sccprofile  'XBox Controller.sccprofile'  'XBox Controller with High Precision Camera.sccprofile'
$ pacman -Ql sc-controller | grep default
sc-controller /usr/share/scc/default_menus/
sc-controller /usr/share/scc/default_menus/.autoswitch.menu
sc-controller /usr/share/scc/default_menus/Default.menu
sc-controller /usr/share/scc/default_menus/Profiles.menu
sc-controller /usr/share/scc/default_profiles/
sc-controller /usr/share/scc/default_profiles/.scc-osd.keyboard.sccprofile
sc-controller /usr/share/scc/default_profiles/Desktop.sccprofile
sc-controller /usr/share/scc/default_profiles/XBox Controller with High Precision Camera.sccprofile
sc-controller /usr/share/scc/default_profiles/XBox Controller.sccprofile

They are definitely there. The paths also seem to be correct:

In [1]: from scc.paths import *
In [4]: get_default_menus_path()
Out[4]: '/usr/share/scc/default_menus'
In [5]: get_default_profiles_path()
Out[5]: '/usr/share/scc/default_profiles'
In [7]: get_menus_path()
Out[7]: '/home/luck/.config/scc/menus'
In [8]: get_pid_file()
Out[8]: '/home/luck/.config/scc/daemon.pid'
In [9]: get_profiles_path()
Out[9]: '/home/luck/.config/scc/profiles'
In [10]: get_share_path()
Out[10]: '/usr/share/scc/'
kozec commented 8 years ago

That's weird, why else would FileInfo.get_name() return None...

I can simply add check there, but before that, can you tell me what version of GTK and GLib are you using? Either from pacman or by running

from gi.repository import GLib, Gtk
print GLib.glib_version
print Gtk.get_major_version(), Gtk.get_minor_version(), Gtk.get_micro_version()

in python.

richese commented 8 years ago

I use default packages from Arch linux repos. GLib version: (2, 48, 0) Gtk3 version: (3, 20, 6)

Also it looks like python2-gobject is marked as out of date in repo right now.

kozec commented 8 years ago

Ok, so good news are that you have same versions as me, bad news are that nothing explains that None returned instead of filename.

Anyway, are you able to test latest version from git?

richese commented 8 years ago

Yes, I can test it. Tried it and the only thing that changed was that the menu now shows New profile option. Stil the same exceptions though.

When I start daemon manually the OSD menu shows all profiles and can also switch between them.

A screencap to ilustrate: link

kozec commented 8 years ago

That's because OSD loads profile list synchronously instead of using GLib. I can add same method as fallback when GLib fails.

One more question, what DE / window manager are you using? I can't exclude possibility that GLib stuff breaks on non-gnome like environment :(

Btw, "Vymazať"? Narazil som na krajana?

richese commented 8 years ago

Confirming that aa315aa fixed this. I get the warning once but it works. Thanks for the quick fix.

One more question, what DE / window manager are you using?

WM is i3wm.

I can't exclude possibility that GLib stuff breaks on non-gnome like environment :(

Can't deny that. The only 'gnome' application I use is Evince so I probably just have it's dependencies installed + gtk2/3 stuff.

Btw, "Vymazať"? Narazil som na krajana?

Vyzerá to, že hej. Ale mi dobrú chvíľu trvalo, kým som zistil odkiaľ sa to 'Vymazať' zobralo :smile:.