serialosc not working on Fedora 36, possible udev issue [solved]

Hello,

I hope its OK to post this here, it seems like crowdsourcing a solution might be the best option.

I tried my grid recently after a long absence from it and serialosc no longer sees it at all.

I spent a couple of hours investigating and narrowed it down to a udev issue, as follows:

> udevadm info --query=all /dev/ttyACM0|sort

E: CURRENT_TAGS=:systemd:
E: DEVLINKS=/dev/serial/by-path/pci-0000:00:14.0-usb-0:4:1.0
E: DEVNAME=/dev/ttyACM0
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.0/tty/ttyACM0
E: ID_AUTOSUSPEND=1
E: ID_BUS=pci
E: ID_MM_CANDIDATE=1
E: ID_MODEL_FROM_DATABASE=Virtual COM Port
E: ID_MODEL_ID=0x02ed
E: ID_PATH=pci-0000:00:14.0-usb-0:4:1.0
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_4_1_0
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
E: ID_USB_CLASS_FROM_DATABASE=Communications
E: ID_USB_DRIVER=cdc_acm
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_INTERFACES=:020201:0a0000:
E: ID_USB_MODEL_ENC=grid
E: ID_USB_MODEL=grid
E: ID_USB_MODEL_ID=5740
E: ID_USB_REVISION=0200
E: ID_USB_SERIAL=monome_grid_m2949672
E: ID_USB_SERIAL_SHORT=m2949672
E: ID_USB_SUBCLASS_FROM_DATABASE=Abstract (modem)
E: ID_USB_TYPE=generic
E: ID_USB_VENDOR_ENC=monome
E: ID_USB_VENDOR_ID=0483
E: ID_USB_VENDOR=monome
E: ID_VENDOR_FROM_DATABASE=STMicroelectronics
E: ID_VENDOR_ID=0x8086
E: MAJOR=166
E: MINOR=0
E: SUBSYSTEM=tty
E: TAGS=:systemd:
E: USEC_INITIALIZED=4237290428
L: 0
N: ttyACM0
P: /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.0/tty/ttyACM0
S: serial/by-path/pci-0000:00:14.0-usb-0:4:1.0

Two things are wrong here:

  • ID_VENDOR and ID_SERIAL_SHORT are missing - these are used by serialosc and libmonome to identify the device
  • ID_BUS=pci is set when this is not really a PCI device.

I suspect some recent change in udev has broken things. (I have systemd 250 here). I haven’t had time yet to find what changed in udev, though.

It would be possible to work around this silliness in libmonome by using ID_USB_SERIAL_SHORT, ID_USB_VENDOR and ID_USB_MODEL properties - in fact i’ve done just that as a workaround. I can submit patches easily enough but it would be nice to first figure out if this is a “bug” or a “feature” of udev.

hello! are you compiling from source? (sorry, i have no idea if serialosc made it into fedora’s package manager— if so it would’ve been community contributed at some point in the past)

libmonome and serialosc were updated for the CDC grid (which you have) whereas in the past the FTDI driver was used.

if you suspect udev, you can compile libmonome with sysfs instead— check out the wscript file for options

1 Like

Yes, I’m compiling it from source myself, so it’s definitely the latest version. Good idea to try sysfs backend, I’ll give that a go.

Hello again,

I tried the sysfs backend and it didn’t work - there’s no file /sys/bus/usb/drivers/ftdi_sioon my system (6.1.12-100.fc36.x86_64).

I’ve been looking for evidence as to what changed on my system to break the udev backend.

I looked at the history of udev’s 60-serial.rules file. Nothing looks like it would directly cause the issue. This commit mentions it though: udev: first set properties based on usb subsystem · systemd/systemd@01e704e · GitHub

Is anyone running Linux with systemd older than 250, that has serialosc working ? Or anyone with systemd 250 or newer able to reproduce the issue I’m seeing ?

I’d like to track this down and open a useful issue against libmonome. i don’t have the energy myself to build a bunch of different versions of systemd and the exact moment where this behaviour change. If a couple of other people can look at what systemd versions they have, we can hopefully crowdsource the required effort :slight_smile:

the grid you’re using is a CDC-class, the first generation we did using an STM chip. so it doesn’t need FTDI. i’ve never needed to use the sysfs build, so it actually might be quite outdated.

i’m running ubuntu with systemd v251 and it’s working fine. i’ve been running it on ubuntu for a few years now so i imagine that at some point recently i was at/below v250?

perhaps @artfwo can see this missing puzzle piece

I’m running ubuntu with systemd v251 and it’s working fine. i’ve been running it on ubuntu for a few years now so i imagine that at some point recently i was at/below v250?

That’s very useful info. Have done a system-upgrade to get to Fedora 37 and systemd v251, and the issue is fixed. The ID_BUS setting is back to usb, and the properties like ID_SERIAL are present again.

So i think there’s nothing more to do here except advise folk on Fedora 36 to upgrade to 37. :slight_smile:

3 Likes

My guess would be some udev misconfiguration, as I’ve been using both CDC and FTDI grids on both Fedora 36 and 37 without issues. Also the PCI bus flag is super suspicious.