[PATCH v3 10/11] udev: Store the seat id in device proplists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When using PulseAudio in system mode, it may be interesting to know
which seats the devices are assigned to. This will be used in the
tunnel manager to filter out the devices that belong to other users.
---
 src/modules/udev-util.c | 9 +++++++++
 src/modules/udev-util.h | 2 ++
 2 files changed, 11 insertions(+)

diff --git a/src/modules/udev-util.c b/src/modules/udev-util.c
index b0bb17d..f104c1d 100644
--- a/src/modules/udev-util.c
+++ b/src/modules/udev-util.c
@@ -250,6 +250,15 @@ int pa_udev_get_info(int card_idx, pa_proplist *p) {
         if ((v = udev_device_get_property_value(card, "SOUND_DESCRIPTION")) && *v)
             pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, v);
 
+    if (!pa_proplist_contains(p, PA_PROP_UDEV_SEAT)) {
+        if ((udev_device_has_tag(card, "seat"))) {
+            if ((v = udev_device_get_property_value(card, "ID_SEAT")) && *v)
+                pa_proplist_sets(p, PA_PROP_UDEV_SEAT, v);
+            else
+                pa_proplist_sets(p, PA_PROP_UDEV_SEAT, "seat0");
+        }
+    }
+
     r = 0;
 
 finish:
diff --git a/src/modules/udev-util.h b/src/modules/udev-util.h
index 251575b..70c5044 100644
--- a/src/modules/udev-util.h
+++ b/src/modules/udev-util.h
@@ -24,6 +24,8 @@
 
 #include <pulse/proplist.h>
 
+#define PA_PROP_UDEV_SEAT "udev.seat"
+
 int pa_udev_get_info(int card_idx, pa_proplist *p);
 char* pa_udev_get_property(int card_idx, const char *name);
 
-- 
1.9.3



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux