[pulseaudio-discuss] update-card-properties? Possible?

Bernd Wechner bwechner at yahoo.com
Wed Aug 17 02:55:13 UTC 2016


If device.description is intended by design for UIs to label devices 
(cards or ports) then that should indeed suffice. No need to consider 
another property.

When I look at ALSA:

http://www.alsa-project.org/main/index.php/Main_Page

It looks a little too low level to be worried about local naming of 
devices which I'd see as a more supervisory OS feature, belonging IMHO 
almost at the Xwindows or Gnome level and not even necessarily as low as 
pulseaudio. I was looking here because someone on the MINT forums 
suggests it was a pulsaudio issue (but that has the feel of buckpassing 
slowly).

And the level of pulsaudio for example complexities arise with say USB 
devices. They are hot plugable and so if I unplug it and plug it in 
again how is it described? I'd like its local name to stick, in the same 
way that I find my names for USB flash drives stick and my printers (by 
different mechanisms, but the same UX result).

But if I've helped spot a pulseaudio bug (failure to copy the HDMI 
product name to the card description in some way), that's that's nice. I 
do think it would awesome and seemingly an easy fix to see those HDMI 
device identifiers in the Sound settings through the card 
device.description.

As to the simple use case and why someone would like to change the name 
that is easily answered.

1) USB devices identify themselves with weird or unclear names. HDMI 
devices similarly. They are techie and device descriptive.

2) These names used as well in the System tray sound apps that allow 
selection of output device for example.

3) I have family and others using a multimedia machine, as I suspect 
many do who want to be able to select output device, pump sound into one 
attached unit or another (I have quite a few).

4) For that reason I'd like freedom to name these devices, in a way that 
sticks, and ideally survives unplugging and plugging in again, to be 
meaningful to end users. Names like "Wireless headphones", "Surround 
sound system", "Bedroom speakers", "FM transmitter" etc, by way of 
example. As it is essentially with complex sound systems and multiple 
devices served any user has to try them one by one until they detect 
sound where they want it. That is neither practical fro all devices nor 
friendly so most steer clear of it.

5) Further, it'd be nice to name them in the Sound Settings GUI and not 
have to lay around with config files in /etc if possible.

I migrated from Windows a while back and there I could name the sound 
devices. And I suspect it's managed at a level higher than ALSA, maybe 
at a level like pulseaudio, and possible even at a higher level still.

Getting my head around where this might fit. As I may be in a position 
to contribute code of course once I know where is most appropriate and 
how to contribute to the relevant community.

Regards,

Bernd.

On 17/08/2016 12:05 AM, Tanu Kaskinen wrote:
> On Tue, 2016-08-16 at 23:06 +1000, Bernd Wechner wrote:
>> Thanks Tanu, your observations are every very helpful and time saving.
>>
>> If I may, I'd ask an ancillary question. It's not actually the card's
>> device.description I want to change. I just had a curious question about
>> that because that is what is used at present by the Sound settings app
>> in Linux MINT (Cinnamon) to identify sound devices.
>>
>> Only I find that wholly inadequate and have the strong desire to name my
>> sound devices as I manage quite a number and even in the simplest case
>> of two onboard sound devices on a NUC the names not at all useful in
>> identifying which is which on the ports.
>>
>> The use-case I'm after is simple:
>>
>>    * Open Sound settings app.
>>    * Edit name of sound device to reflect my configs.
>>    * See the device thusly described thence-forth in the Sound settings
>>      app at least, ideally in any app of mixer that works with cards.
>>
>> That's looking like a biggish sort of ask as I don't even suspect
>> device.description is the right place for it, as that is populated with
>> something semi sensible already. Though it might be, as I'm not sure if
>> there's a pulaseaudio spec that states that card.device.description
>> should be used to identifying cards in apps that work with them.
> device.description is what all friendly UIs should use to label the
> card.
>
>> It might rather be that the most appropriate path forward is a new
>> property like card.device.name that is editable and has methods for
>> setting it and remembering it. But that actually raises the question,
>> whether such a property belongs in pulseaudio at all or in alsa?
> It could be argued that this belongs in alsa. However, the current
> state of things is that alsa doesn't provide very user-friendly card
> descriptions, and I don't think it has an API for doing runtime
> modifications either.
>
> The way pulseaudio generates descriptions is convoluted, but I think
> most USB cards get their description from udev's ID_MODEL_FROM_DATABASE
> property.
>
> By the way, I now noticed that it's possible to directly affect the
> card description by setting SOUND_DESCRIPTION in udev configuration.
> This of course is not usable for the "set description in sound settings
> UI" use case.
>
>> Or I note that ports sometimes have a device.product.name property,
>> which if it's an HDMI or DisplayPort device seems to contain a lucid
>> name for the device. Perhaps support for a port property like
>> device.description is consistent with the paradigm in place, and it
>> could be made editable/updatable and then Sounds Settings apps can use
>> this in their titles for sound devices?
> Hmm... We indeed read the HDMI monitor name and store it in the port's
> device.product.name property. I believe the purpose of this is to use
> that as the UI label for the port, but it looks like the code that
> reads the monitor name only sets the device.product.name property and
> doesn't update the port description. I don't know if there are UIs that
> show the product name in place of the normal description. In any case,
> not setting the port description looks like a bug.
>
> This is not really related to card descriptions. If a UI shows a list
> of cards, it should use the card description, and if it shows a list of
> ports, it should use the port description.
>
> And yes, it would be good to have the port descriptions user-editable
> as well as the card descriptions.
>
>> My experience is not deep. I'm dishing for wisdom.
>>
>> Either way I see this is likely a common use case among people working
>> much with sound, and a real bother.  Printers don't have this problem, I
>> can name them. Awesome. And the name is distinct form the description.
> Regarding the separation between a name and a description, it's unclear
> to me how you would like those to be handled. We already have a name
> for reliable and persistent identification, and a description for user-
> friendly labeling. You mentioned that you'd like to change the name on
> the fly as well, but your example use case was about changing the user-
> friendly label in sound settings. Why would you want to change the
> name? While it would be nice to be able to change the ugly names to
> something easier to remember, implementing that would be much more
> complicated than implementing support for editable descriptions.
>
> -- 
> Tanu
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20160817/63953907/attachment-0001.html>


More information about the pulseaudio-discuss mailing list