[systemd-devel] Bug#758050: udev: ID_VENDOR_FROM_DATABASE, ID_MODEL_FROM_DATABASE for unrecognised USB device are taken from USB hub

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Aug 14 06:07:31 PDT 2014


I recently opened this Debian bug, for which I attach a
patch that seems to work. Bug report quoted in full below.

I would appreciate udev maintainers' opinions on whether this is
likely to break non-USB devices, or whether there is a better way
to do it.

    S

> Steps to reproduce: plug in a USB device which isn't in the udev
> hwdb, like this one: 
> 
> Bus 003 Device 017: ID 21b4:0081  
> Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               1.00
>   bDeviceClass            0 (Defined at Interface level)
>   bDeviceSubClass         0 
>   bDeviceProtocol         0 
>   bMaxPacketSize0         8
>   idVendor           0x21b4 
>   idProduct          0x0081 
>   bcdDevice            1.20
>   iManufacturer           1 AudioQuest inc.
>   iProduct                2 AudioQuest DragonFly
>   iSerial                 3 (C) 2013 Wavelength Audio, ltd.
> 
> (Yes I know that's a weird serial number, I didn't design the device.)
> 
> Expected result:
> 
> * ID_MODEL_FROM_DATABASE and ID_VENDOR_FROM_DATABASE are missing
> * Interested applications can look up those properties using
>   idVendor and idProduct if they want to
> 
> Actual result: those strings are taken from the parent device,
> an Intel Corp. Integrated Rate Matching Hub (vendor 8087, product 0024):
> 
> P: /devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1.2/3-1.2:1.0/sound/card1
> E: DEVPATH=/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1.2/3-1.2:1.0/sound/card1
> E: ID_BUS=usb
> E: ID_FOR_SEAT=sound-pci-0000_00_1a_0-usb-0_1_2_1_0
> E: ID_ID=usb-AudioQuest_inc._AudioQuest_DragonFly-00-DragonFly
> E: ID_MODEL=AudioQuest_DragonFly
> E: ID_MODEL_ENC=AudioQuest\x20DragonFly
> E: ID_MODEL_FROM_DATABASE=Integrated Rate Matching Hub
> E: ID_MODEL_ID=0081
> E: ID_PATH=pci-0000:00:1a.0-usb-0:1.2:1.0
> E: ID_PATH_TAG=pci-0000_00_1a_0-usb-0_1_2_1_0
> E: ID_REVISION=0120
> E: ID_SERIAL=AudioQuest_inc._AudioQuest_DragonFly
> E: ID_TYPE=audio
> E: ID_USB_DRIVER=snd-usb-audio
> E: ID_USB_INTERFACES=:010100:010200:
> E: ID_USB_INTERFACE_NUM=00
> E: ID_VENDOR=AudioQuest_inc.
> E: ID_VENDOR_ENC=AudioQuest\x20inc.
> E: ID_VENDOR_FROM_DATABASE=Intel Corp.
> E: ID_VENDOR_ID=21b4
> E: SOUND_INITIALIZED=1
> E: SUBSYSTEM=sound
> E: SYSTEMD_WANTS=sound.target
> E: TAGS=:seat:systemd:
> E: USEC_INITIALIZED=6479525776
> 
> This makes PulseAudio assign a silly name to this device, which shows
> up in control UIs (e.g. "Integrated Rate Matching Hub Analog Stereo" in
> pavucontrol and "Analog Stereo - Integrated Rate Matching Hub" in
> gnome-control-center):
> 
>     index: 1
> 	name: <alsa_output.usb-AudioQuest_inc._AudioQuest_DragonFly-00-DragonFly.analog-stereo>
> 	...
> 	card: 1 <alsa_card.usb-AudioQuest_inc._AudioQuest_DragonFly-00-DragonFly>
> 	...
> 	properties:
> 	...
> 		alsa.card_name = "AudioQuest DragonFly"
> 		alsa.long_card_name = "AudioQuest inc. AudioQuest DragonFly at usb-0000:00:1a.0-1.2, full speed"
> 	...
> 		udev.id = "usb-AudioQuest_inc._AudioQuest_DragonFly-00-DragonFly"
> 		device.bus = "usb"
> 		device.vendor.id = "21b4"
> 		device.vendor.name = "Intel Corp."
> 		device.product.id = "0081"
> 		device.product.name = "Integrated Rate Matching Hub"
> 		device.serial = "AudioQuest_inc._AudioQuest_DragonFly"
> 	...
> 		device.profile.name = "analog-stereo"
> 		device.profile.description = "Analog Stereo"
> 		device.description = "Integrated Rate Matching Hub Analog Stereo"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-hwdb-stop-looking-at-parent-devices-if-the-modalias-.patch
Type: text/x-diff
Size: 1859 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140814/a7f0c519/attachment.patch>


More information about the systemd-devel mailing list