Skip to content
Snippets Groups Projects
Commit 3ac73598 authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by David Henningsson
Browse files

udev: use ID_MODEL/ID_VENDOR to give friendly name for FireWire devices


For recently supported FireWire sound devices, udev's database assign
the name of IEEE 1394 Phy/Link chipset to ID_XXX_FROM_DATABASE. This is
not friently names to users.

This commit applies a workaround to skip ID_XXX_FROM_DATABASE for any
FireWire devices.

[Fixed up by David Henningsson <david.henningsson@canonical.com>]

Reported-by: default avatarAndras Muranyi <muranyia@gmail.com>
Reference: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1381475


Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarDavid Henningsson <david.henningsson@canonical.com>
parent ef864eea
No related branches found
No related tags found
No related merge requests found
......@@ -168,6 +168,7 @@ int pa_udev_get_info(int card_idx, pa_proplist *p) {
struct udev_device *card = NULL;
char *t;
const char *v;
const char *bus;
int id;
pa_assert(p);
......@@ -201,15 +202,16 @@ int pa_udev_get_info(int card_idx, pa_proplist *p) {
pa_proplist_sets(p, "udev.id", v);
if (!pa_proplist_contains(p, PA_PROP_DEVICE_BUS))
if ((v = udev_device_get_property_value(card, "ID_BUS")) && *v)
pa_proplist_sets(p, PA_PROP_DEVICE_BUS, v);
if ((bus = udev_device_get_property_value(card, "ID_BUS")) && *bus)
pa_proplist_sets(p, PA_PROP_DEVICE_BUS, bus);
if (!pa_proplist_contains(p, PA_PROP_DEVICE_VENDOR_ID))
if ((id = read_id(card, "ID_VENDOR_ID")) > 0)
pa_proplist_setf(p, PA_PROP_DEVICE_VENDOR_ID, "%04x", id);
if (!pa_proplist_contains(p, PA_PROP_DEVICE_VENDOR_NAME)) {
if ((v = udev_device_get_property_value(card, "ID_VENDOR_FROM_DATABASE")) && *v)
/* ID_VENDOR_FROM_DATABASE returns the name of IEEE 1394 Phy/Link chipset for FireWire devices */
if (!pa_streq(bus, "firewire") && (v = udev_device_get_property_value(card, "ID_VENDOR_FROM_DATABASE")) && *v)
pa_proplist_sets(p, PA_PROP_DEVICE_VENDOR_NAME, v);
else if ((v = udev_device_get_property_value(card, "ID_VENDOR_ENC")) && *v)
proplist_sets_unescape(p, PA_PROP_DEVICE_VENDOR_NAME, v);
......@@ -222,7 +224,8 @@ int pa_udev_get_info(int card_idx, pa_proplist *p) {
pa_proplist_setf(p, PA_PROP_DEVICE_PRODUCT_ID, "%04x", id);
if (!pa_proplist_contains(p, PA_PROP_DEVICE_PRODUCT_NAME)) {
if ((v = udev_device_get_property_value(card, "ID_MODEL_FROM_DATABASE")) && *v)
/* ID_MODEL_FROM_DATABASE returns the name of IEEE 1394 Phy/Link chipset for FireWire devices */
if (!pa_streq(bus, "firewire") && (v = udev_device_get_property_value(card, "ID_MODEL_FROM_DATABASE")) && *v)
pa_proplist_sets(p, PA_PROP_DEVICE_PRODUCT_NAME, v);
else if ((v = udev_device_get_property_value(card, "ID_MODEL_ENC")) && *v)
proplist_sets_unescape(p, PA_PROP_DEVICE_PRODUCT_NAME, v);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment