hyperb1iss / uchroma

An advanced driver for Razer Chroma hardware in Linux
https://cyanogen.github.io/uchroma/
GNU Lesser General Public License v3.0
49 stars 9 forks source link

uchroma -l returns empty #27

Open splushii opened 7 years ago

splushii commented 7 years ago

Tried to install on Razer Blade Stealth (Kaby Lake) running openSUSE Tumbleweed. Could be same as https://github.com/cyanogen/uchroma/issues/13

git clone https://github.com/cyanogen/uchroma.git I installed dependencies manually in order to successfully run 'sudo make install': sudo zypper in python-cffi sudo pip install argcomplete cffi colorlog colr evdev frozendict gbulb grapefruit hidapi-cffi hsluv matplotlib numpy pydbus pyudev ruamel.yaml scikit-image scipy traitlets wrapt sudo make install

I noticed that uchromad seem to shut down:

Mar 30 21:07:52 linux-lbe3 dbus-daemon[1482]: Activating service name='org.chemlab.UChroma'
Mar 30 21:07:53 linux-lbe3 dbus-daemon[1482]: Successfully activated service 'org.chemlab.UChroma'
Mar 30 21:07:53 linux-lbe3 org.chemlab.UChroma[1482]:  uchroma.power/INFO     | Connected screensaver: org.freedesktop.ScreenSaver (':1.10',)
Mar 30 21:07:53 linux-lbe3 org.chemlab.UChroma[1482]:  uchroma.power/INFO     | Connected to org.freedesktop.login1 (':1.3',)
Mar 30 21:08:40 linux-lbe3 org.chemlab.UChroma[1482]:  uchroma.server/INFO     | Shutting down
Mar 30 21:08:40 linux-lbe3 org.chemlab.UChroma[1482]: Error in atexit._run_exitfuncs:
Mar 30 21:08:40 linux-lbe3 org.chemlab.UChroma[1482]: Traceback (most recent call last):
Mar 30 21:08:40 linux-lbe3 org.chemlab.UChroma[1482]:   File "/usr/lib64/python3.6/site-packages/uchroma/server/server.py", line 121, in exit
Mar 30 21:08:40 linux-lbe3 org.chemlab.UChroma[1482]:     return_when=futures.ALL_COMPLETED))
Mar 30 21:08:40 linux-lbe3 org.chemlab.UChroma[1482]:   File "/usr/lib/python3.6/site-packages/gbulb/glib_events.py", line 136, in run_until_complete
Mar 30 21:08:40 linux-lbe3 org.chemlab.UChroma[1482]:     return future.result()
Mar 30 21:08:40 linux-lbe3 org.chemlab.UChroma[1482]:   File "/usr/lib64/python3.6/asyncio/tasks.py", line 298, in wait
Mar 30 21:08:40 linux-lbe3 org.chemlab.UChroma[1482]:     raise ValueError('Set of coroutines/Futures is empty.')
Mar 30 21:08:40 linux-lbe3 org.chemlab.UChroma[1482]: ValueError: Set of coroutines/Futures is empty.

When starting it again manually:

linux-lbe3:~> uchromad -d
 uchroma.devicemanager/DEBUG    | Udev monitor started                                              
 uchroma.power/INFO     | Connected screensaver: org.freedesktop.ScreenSaver (':1.10',)             
 uchroma.power/INFO     | Connected to org.freedesktop.login1 (':1.3',)

uchroma -l returns nothing:

linux-lbe3:~> uchroma -l
linux-lbe3:~>

lsusb output for reference:

Bus 001 Device 004: ID 1532:0220 Razer USA, Ltd 
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x1532 Razer USA, Ltd
  idProduct          0x0220 
  bcdDevice            2.00
  iManufacturer           1 
  iProduct                2 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           84
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      1 Keyboard
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      61
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 
      bInterfaceProtocol      1 Keyboard
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     159
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 
      bInterfaceProtocol      2 Mouse
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      94
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
jramapuram commented 7 years ago

Same issue on Arch for me

hyperb1iss commented 7 years ago

Apparently something is different on the new Stealths.. I'll see if I can get my hands on one.

jramapuram commented 7 years ago

I'm running a GTX1060 2016 Skylake RB, not a stealth

jtmkrueger commented 7 years ago

I'm having the same issue on the new Pro 17"

jacobc-eth commented 7 years ago

Yep, can confirm same issue on Razer Blade Pro 2017

brad-decker commented 7 years ago

Add another confirmation for razer blade pro 2017

jacobc-eth commented 7 years ago

Any word on a fix for newer laptops?

hyperb1iss commented 7 years ago

Unfortunately not, I haven't been able to get my hands on any of the 2017 laptops and not for lack of trying. If you're able to capture a packet trace in Windows while using Synapse, that could be very helpful.

jramapuram commented 7 years ago

This is also happening on my 2016 gtx1060 razer blade

jtmkrueger commented 7 years ago

@cyanogen I have dual booting setup on my 2017 razer blade pro. Is there any documentation regarding what you want as far as a packet trace? I'm more than happy to provide one, I'm just not sure how to go about getting it. I'll apologize in advance for my lack of Windows knowledge.

hyperb1iss commented 7 years ago

There's an open pull request that brings in support for at least the new Blade. It may be as simple as adding the device to laptops.yaml.

splushii commented 7 years ago

I tested with the current version. The issue seems to be resolved for Razer Blade Stealth (Kaby Lake). Not sure about 2017 models so I am not closing this.

keponk commented 6 years ago

@cyanogen I've got a Razer Blade 2017. I attempted to copy the laptop.yaml file from the pull request into my installation via yaourt in Arch. No changes, after doing the change and rebooting the uchroma -l command still throws nothing.

If you give me instructions on how to collect packet trace data from windows I'd be happy to produce it.

Thanks for the work on the project!

xsacha commented 6 years ago

Just like to add that I have the same issue, even after adding the pull request.

May 09 16:40:21 razerblade systemd[775]: Started UChroma Device Management Service.
-- Subject: Unit UNIT has finished start-up
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit UNIT has finished starting up.
-- 
-- The start-up result is RESULT.
May 09 16:40:21 razerblade uchromad[3917]:  uchroma.power/INFO     | Connected screensaver: org.freedesktop.ScreenSaver:/org/freedesktop/ScreenSaver (':1.10',)
May 09 16:40:21 razerblade uchromad[3917]:  uchroma.power/WARNING  | Could not connect to com.canonical.Unity:/org/gnome/ScreenSaver service
May 09 16:40:21 razerblade uchromad[3917]:  uchroma.power/INFO     | Connected to org.freedesktop.login1 (':1.6',)

If it helps,

I tried to track down the issue in device_manager (why it reports no devices).

parent = self._get_parent(devinfo.product_id)

devinfo.product_id == 0x0224 parent == None

if parent is None:
                continue

So then I tried to look at why _get_parent was failing:

        pid = "%04x" % product_id
        self._logger.info("pid == %s", pid)

        devs = self._udev_context.list_devices(tag='uchroma', subsystem='usb',
                                               ID_MODEL_ID=pid)

pid == 0224 devs == <pyudev.core.Enumerator object at 0x7fcd2cf2c908> but appears empty

Then I removed the tag='uchroma' and then I get: DEVTYPE == usb_device

Now I instead get this error:

May 09 17:22:00 razerblade uchromad[4487]:  uchroma.server/INFO     | add: UChromaLaptop(name=Blade (2017), type=Laptop, product_id=0x0224, index=0)
May 09 17:22:00 razerblade uchromad[4487]:  uchroma.driver-0/ERROR    | Failed to open connection
May 09 17:22:00 razerblade uchromad[4487]: Traceback (most recent call last):
May 09 17:22:00 razerblade uchromad[4487]:   File "/usr/lib/python3.6/site-packages/uchroma/server/device_base.py", line 289, in _ensure_open
May 09 17:22:00 razerblade uchromad[4487]:     self._dev = hidapi.Device(self._devinfo, blocking=False)
May 09 17:22:00 razerblade uchromad[4487]:   File "/usr/lib/python3.6/site-packages/hidapi.py", line 159, in __init__
May 09 17:22:00 razerblade uchromad[4487]:     raise IOError("Could not open connection to device.")
May 09 17:22:00 razerblade uchromad[4487]: OSError: Could not open connection to device.
May 09 17:22:00 razerblade uchromad[4487]: Unhandled exception in async future

Considering the tag failed and the permissions are failing, this leads me to udev. Your udev rules must not be working?

ACTION=="add|change", SUBSYSTEM=="hidraw|usb|input", ATTRS{idVendor}=="1532", IMPORT{builtin}="hwdb --subsystem=usb --lookup-prefix=uchroma:"
ENV{UCHROMA_DEVICE}=="?*", TAG+="uchroma", TAG+="uaccess"
jblankfeld commented 5 years ago

Hi, I'm having the same issue as above. Does anybody know how to fix the udev rules ?

SealedJoy commented 2 years ago

same issue on blade stealth 13" 2020 (no devices show with uchroma -l)