Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-113462

QSerialPortInfo reports id's of Intel CPU machine runs on instead of actual device id's on Debian 11.7

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.15.13, 5.15.10, 6.5.0
    • Serial Port
    • None
    • Debian 11.7 amd64
    • Linux/X11

    Description

      Looks like after Debian 11.7 updates udev output have changed, and QSerialPortInfo() now returns Intel CPU vendor/product id's instead of actual USB serial ports.

      For example, if we have this code:

      #include <QDebug>
      #include <QSerialPortInfo>
      
      int main()
      {
          for (const QSerialPortInfo& info: QSerialPortInfo::availablePorts())
              qDebug().nospace().noquote() << "vid = 0x" << QString::number(info.vendorIdentifier(), 16) << ", pid = 0x" << QString::number(info.productIdentifier());
      }
      

      With these two USB serial devices attached:

      # udevadm info /dev/ttyUSB0
      P: /devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5:1.0/ttyUSB0/tty/ttyUSB0
      N: ttyUSB0
      L: 0
      S: serial/by-path/pci-0000:00:14.0-usb-0:5:1.0-port0
      E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5:1.0/ttyUSB0/tty/ttyUSB0
      E: DEVNAME=/dev/ttyUSB0
      E: MAJOR=188
      E: MINOR=0
      E: SUBSYSTEM=tty
      E: USEC_INITIALIZED=268864506971
      E: ID_BUS=pci
      E: ID_VENDOR_ID=0x8086
      E: ID_MODEL_ID=0x43ed
      E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
      E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
      E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI
      E: ID_VENDOR_FROM_DATABASE=Intel Corporation
      E: ID_PATH=pci-0000:00:14.0-usb-0:5:1.0
      E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_5_1_0
      E: ID_USB_MODEL=USB2.0-Ser_
      E: ID_USB_MODEL_ENC=USB2.0-Ser\x21
      E: ID_USB_MODEL_ID=7523
      E: ID_USB_SERIAL=1a86_USB2.0-Ser_
      E: ID_USB_VENDOR=1a86
      E: ID_USB_VENDOR_ENC=1a86
      E: ID_USB_VENDOR_ID=1a86
      E: ID_USB_REVISION=0254
      E: ID_USB_TYPE=generic
      E: ID_USB_INTERFACES=:ff0102:
      E: ID_USB_INTERFACE_NUM=00
      E: ID_USB_DRIVER=ch341
      E: ID_MM_CANDIDATE=1
      E: DEVLINKS=/dev/serial/by-path/pci-0000:00:14.0-usb-0:5:1.0-port0
      E: TAGS=:systemd:
      E: CURRENT_TAGS=:systemd:
      
      # udevadm info /dev/ttyACM0
      P: /devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7:1.0/tty/ttyACM0
      N: ttyACM0
      L: 0
      S: serial/by-path/pci-0000:00:14.0-usb-0:7:1.0
      E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7:1.0/tty/ttyACM0
      E: DEVNAME=/dev/ttyACM0
      E: MAJOR=166
      E: MINOR=0
      E: SUBSYSTEM=tty
      E: USEC_INITIALIZED=267816820604
      E: ID_BUS=pci
      E: ID_VENDOR_ID=0x8086
      E: ID_MODEL_ID=0x43ed
      E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
      E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
      E: ID_PCI_INTERFACE_FROM_DATABASE=XHCI
      E: ID_VENDOR_FROM_DATABASE=Intel Corporation
      E: ID_PATH=pci-0000:00:14.0-usb-0:7:1.0
      E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_7_1_0
      E: ID_USB_MODEL=Numato_Lab_8_Channel_USB_GPIO_Module
      E: ID_USB_MODEL_ENC=Numato\x20Lab\x208\x20Channel\x20USB\x20GPIO\x20Module
      E: ID_USB_MODEL_ID=0800
      E: ID_USB_SERIAL=Numato_Systems_Pvt._Ltd._Numato_Lab_8_Channel_USB_GPIO_Module_NLGP210915A0045
      E: ID_USB_SERIAL_SHORT=NLGP210915A0045
      E: ID_USB_VENDOR=Numato_Systems_Pvt._Ltd.
      E: ID_USB_VENDOR_ENC=Numato\x20Systems\x20Pvt.\x20Ltd.
      E: ID_USB_VENDOR_ID=2a19
      E: ID_USB_REVISION=0100
      E: ID_USB_TYPE=generic
      E: ID_USB_INTERFACES=:020201:0a0000:
      E: ID_USB_INTERFACE_NUM=00
      E: ID_USB_DRIVER=cdc_acm
      E: ID_MM_CANDIDATE=1
      E: DEVLINKS=/dev/serial/by-path/pci-0000:00:14.0-usb-0:7:1.0
      E: TAGS=:systemd:
      E: CURRENT_TAGS=:systemd:
      

      Application actually prints:

      vid = 0x8086, pid = 0x17389
      vid = 0x8086, pid = 0x17389
      vid = 0x0, pid = 0x0
      

      Ignoring zeroes for now, first two should be 0x1a86 0x7523 for "noname" one and 0x2a19 0x0100 for Numato GPIO serial device. But we get Intel CPU vendor/model!?

      On older Udev, there where no ID_USB_X keys, so I guess that's the core issue - Qt needs to parse udev data differently now, i.e. use ID_USB_X if available instead of ID_VENDOR_ID/ID_MODEL_ID ?

      You can find older udev output that worked on my Debian bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1035551

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ablasche Alex Blasche
            vdargis_at_uab_styritrade Vincas Dargis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes