I have written a function: static const char *get_port_name(pa_device_port *port) { if (port) return port->name; else return "(no port)" } The port name isn't guaranteed to be unique across different cards. I'd like the port name to be an unique identifier, because the result of get_port_name() is used in a log message. If the name is not unique, the log message may be ambiguous. I could change get_port_name() so that it would allocate a new string: pa_sprintf_malloc("%s on %s", port->name, port->card->name), but freeing the string would be inconvenient for the caller. Now, logging being slightly inconvenient may not be the most convincing argument when the requested change would be relatively big. So, here's another argument: we will anyway have to make the name unique, because it would be awesome if pa_connect_playback() could take a port name in it's dev argument - if the requested port isn't active, it will be automatically made active. And we're going to merge the sink and port concepts anyway, aren't we, so all this makes just perfect sense, right?
(In reply to comment #0) > Now, logging being slightly inconvenient may not be the most convincing > argument when the requested change would be relatively big. So, here's > another argument: we will anyway have to make the name unique, because it > would be awesome if pa_connect_playback() could take a port name in it's dev > argument - if the requested port isn't active, it will be automatically made > active. And we're going to merge the sink and port concepts anyway, aren't > we, so all this makes just perfect sense, right? An update: we probably aren't going to merge the sink and port concepts. As for using a port name with pa_connect_playback(): while that would be nice, we should get even better capabilities with the upcoming nodes. pa_connect_playback() (or some alternative function) could take a node name as the routing target, making even more targets available (e.g. source outputs). This doesn't mean that we couldn't or shouldn't make port names unique, but it does make my original argument somewhat weaker.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/189.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.