Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Udev rules #61

Closed
hodasemi opened this issue Jun 7, 2024 · 11 comments
Closed

Udev rules #61

hodasemi opened this issue Jun 7, 2024 · 11 comments

Comments

@hodasemi
Copy link
Contributor

hodasemi commented Jun 7, 2024

More like a summary issue resulting from the conversion in the MR

I'd like to collect some information about the usb devices to build the udev rules.

# usb-devices

T:  Bus=03 Lev=01 Prnt=07 Port=04 Cnt=01 Dev#= 12 Spd=12   MxCh= 0
D:  Ver= 2.01 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=35ca ProdID=1011 Rev=02.00
S:  Manufacturer=VITURE One
S:  Product=XR Glasses
S:  SerialNumber=2074306C4156
C:  #Ifs= 4 Cfg#= 1 Atr=a0 MxPwr=300mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbfs
E:  Ad=01(O) Atr=03(Int.) MxPS=  64 Ivl=1ms
E:  Ad=81(I) Atr=03(Int.) MxPS=  64 Ivl=1ms
I:  If#= 1 Alt= 0 #EPs= 2 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbfs
E:  Ad=02(O) Atr=03(Int.) MxPS=  64 Ivl=1ms
E:  Ad=82(I) Atr=03(Int.) MxPS=  64 Ivl=1ms
I:  If#= 2 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=01 Driver=cdc_acm
E:  Ad=86(I) Atr=03(Int.) MxPS=   8 Ivl=16ms
I:  If#= 3 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=02 Prot=00 Driver=cdc_acm
E:  Ad=03(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=85(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
$ ls -la /dev/serial/by-id

lrwxrwxrwx 1 root root 13  7. Jun 12:53 usb-VITURE_One_XR_Glasses_2074306C4156-if02 -> ../../ttyACM0

I'm still figuring out the rules

$ udevadm info -a -n /dev/serial/by-id/usb-VITURE_One_XR_Glasses_2074306C4156-if02

  looking at device '/devices/pci0000:00/0000:00:14.0/usb3/3-5/3-5:1.2/tty/ttyACM0':
    KERNEL=="ttyACM0"
    SUBSYSTEM=="tty"
    DRIVER==""
    ATTR{power/control}=="auto"
    ATTR{power/runtime_active_time}=="0"
    ATTR{power/runtime_status}=="unsupported"
    ATTR{power/runtime_suspended_time}=="0"
@hodasemi
Copy link
Contributor Author

hodasemi commented Jun 7, 2024

Is there a way to verify the drivers access through the udev rules? I mean some kind of feedback that the driver can access the device correctly

@wheaney
Copy link
Owner

wheaney commented Jun 7, 2024

I think we'll just have to trust the configuration. It'll be difficult to regress once we have it working and tested on all devices. Here's an example of udev rules for supported XREAL devices:
https://gitlab.com/TheJackiMonster/nrealAirLinuxDriver/-/blob/main/udev/nreal_air.rules

We'll need similar rules for these vid/pid combos for VITURE:

#define VITURE_ID_PRODUCT_COUNT 7
#define VITURE_ID_VENDOR 0x35ca
#define VITURE_ONE_MODEL_NAME "One"
#define VITURE_ONE_LITE_MODEL_NAME "One Lite"
#define VITURE_PRO_MODEL_NAME "Pro"
const int viture_supported_id_product[VITURE_ID_PRODUCT_COUNT] = {
0x1011, // One
0x1013, // One
0x1017, // One
0x1015, // One Lite
0x101b, // One Lite
0x1019, // Pro
0x101d, // Pro
};

And this is what's upcoming for Rayneo:

#define RAYNEO_ID_VENDOR 0x1bbb
#define RAYNEO_ID_PRODUCT 0xaf50

@wheaney
Copy link
Owner

wheaney commented Jun 7, 2024

Note in the example nreal air rules file I linked, the GROUP should be a group that the run-as user for the systemd service is in, I believe.

@wheaney
Copy link
Owner

wheaney commented Jun 7, 2024

I believe if we leave off GROUP and add TAG+="uaccess" to the rule, then it will grant access to all users, since I'm assuming that the installation has no way to add users to groups.

@hodasemi
Copy link
Contributor Author

hodasemi commented Jun 8, 2024

I implemented rules for the viture devices based on what I could find on my system, as stated in the wiki:

https://github.com/hodasemi/XRLinuxDriver/commit/69dc1571dcc1c2958a3cbb33642b64ea2afd0893

@wheaney
Copy link
Owner

wheaney commented Jun 8, 2024

Great job finding that wiki! I did notice this bit, which the current file naming of 80-* doesn't follow:

Note: For any rule adding the uaccess tag to be effective, the name of the file it is defined in has to lexically precede /usr/lib/udev/rules.d/73-seat-late.rules

@hodasemi
Copy link
Contributor Author

hodasemi commented Jun 8, 2024

Yea I fixed that and verified that I can access the files in /dev/

@hodasemi
Copy link
Contributor Author

hodasemi commented Jun 8, 2024

Can I modify what I see with this driver alone? I mean without the usage of breeze-desktop.

@wheaney
Copy link
Owner

wheaney commented Jun 8, 2024

Can I modify what I see

I'm not understanding what you mean with this bit

@hodasemi
Copy link
Contributor Author

hodasemi commented Jun 8, 2024

About the verification process, but as you stated in the MR, I need breezy-desktop for it to change to output.

@wheaney
Copy link
Owner

wheaney commented Jul 31, 2024

Closing this out since it was merged.

@wheaney wheaney closed this as completed Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants