Xfce Forum

Sub domains
 

You are not logged in.

#1 2024-06-22 06:25:47

Pheeble
Member
Registered: 2015-06-22
Posts: 27

Possible bug in xfce4-volumed

I think I've found a bug in xfce4-volumed installed in xfce4 4.18 in Linux Mint 21.3 XFCE.

When I change the audio volume using the horizontal slider in the pavucontrol panel plugin, a notification is displayed that contains an icon of a speaker.

If, however, the volume is reduced to zero, the speaker icon is replaced by a default icon, indicating that the required icon could not be found.

I think I've traced this to a function in xfce4-volumed, but I can't find the source code for that particular application, I did find xfce4-volumed-pulse at https://git.xfce.org/apps/xfce4-volumed … d_notify.c, and that contained this function:

void
xvd_notify_volume_notification(XvdInstance *Inst)
{
	gint vol = xvd_get_readable_volume (&Inst->volume);
	if (vol == 0)
		xvd_notify_notification (Inst, (Inst->mute) ? ICON_AUDIO_VOLUME_MUTED : ICON_AUDIO_VOLUME_OFF, vol);
	else if (vol < 34)
		xvd_notify_notification (Inst, (Inst->mute) ? ICON_AUDIO_VOLUME_MUTED : ICON_AUDIO_VOLUME_LOW, vol);
	else if (vol < 67)
		xvd_notify_notification (Inst, (Inst->mute) ? ICON_AUDIO_VOLUME_MUTED : ICON_AUDIO_VOLUME_MEDIUM, vol);
	else
		xvd_notify_notification (Inst, (Inst->mute) ? ICON_AUDIO_VOLUME_MUTED : ICON_AUDIO_VOLUME_HIGH, vol);
}

That function sends notifications, and the first 'if' condition will try to set the icon as ICON_AUDIO_VOLUME_OFF if the volume is zero but it has not been muted.

According to the freedesktop specifications at https://specifications.freedesktop.org/ … 01s04.html, there is no such icon. The only audio volume icons listed are 'audio-volume-high' (ICON_AUDIO_VOLUME_HIGH), 'audio-volume-low' ( ICON_AUDIO_VOLUME_LOW), 'audio-volume-medium' (ICON_AUDIO_VOLUME_MEDIUM) and 'audio-volume-muted' (ICON_AUDIO_VOLUME_MUTED).

So when the desktop notification server gets a notification message containing the non-existent icon ICON_AUDIO_VOLUME_OFF, it correctly replaces it with a default icon.

I've hunted around for the location of the source code so I can file a bug report, but I couldn't find it anywhere at https://gitlab.xfce.org/xfce.

I also couldn't find any reference to xfce4-volumed at https://docs.xfce.org/start#applications, so perhaps it is a legacy application that is no longer being worked on, in which case there's no point in reporting a possible bug as it might be getting dropped from the project.

Should I persist in trying to do anything about this?

Offline

#2 2024-06-22 08:01:56

Tamaranch
Member
Registered: 2020-12-31
Posts: 316

Re: Possible bug in xfce4-volumed

The source code is here: https://gitlab.xfce.org/apps/xfce4-volumed-pulse
But I suspect the audio-volume-off icon is just missing in the icon theme you use.
Try e.g. with the papirus icon theme, which seems to ship this icon.

Last edited by Tamaranch (2024-06-22 08:02:24)

Offline

#3 2024-06-22 21:08:44

Pheeble
Member
Registered: 2015-06-22
Posts: 27

Re: Possible bug in xfce4-volumed

Tamaranch wrote:

The source code is here: https://gitlab.xfce.org/apps/xfce4-volumed-pulse
But I suspect the audio-volume-off icon is just missing in the icon theme you use.
Try e.g. with the papirus icon theme, which seems to ship this icon.

Thanks for the response.

Yes you're right, the icon does appear when using the Papirus icon theme.

It does seem problematic, though, to rely on a non-standard icon when nearly all icon themes use only standard icons. That icon was not in any of the other icon themes I tested.

I noticed that scrolling over the xfce4 pulse audio plugin icon results in the display of the 'audio-volume-muted' symbolic icon when the volume reaches zero.

The relevant code from xfce4-pulseaudio-plugin at https://gitlab.xfce.org/panel-plugins/x … type=heads:

/* Icons for different volume levels */
static const char *icons[] = {
  "audio-volume-muted-symbolic",
  "audio-volume-low-symbolic",
  "audio-volume-medium-symbolic",
  "audio-volume-high-symbolic",
  NULL
};

It might be more consistent if xfce4-volumed-pulse did the same, or at least check for the presence of the non-standard icon in the current theme, and fall back to the 'audio-volume-muted' icon if it is not found.

Last edited by Pheeble (2024-06-22 23:15:20)

Offline

#4 2024-06-23 09:36:48

Tamaranch
Member
Registered: 2020-12-31
Posts: 316

Re: Possible bug in xfce4-volumed

Yes indeed, audio-volume-off is not in https://specifications.freedesktop.org/ … atest.html
I'll change it to audio-volume-muted.

Offline

#5 2024-06-23 09:47:39

Tamaranch
Member
Registered: 2020-12-31
Posts: 316

Re: Possible bug in xfce4-volumed

Hm actually that's not really an argument. The icon names for the microphone aren't in the spec either and are generally present in the themes, and xfce4-pulseaudio-plugin uses them too.

I don't use this component so I'd rather not make any hasty changes like that. Feel free to open a new issue on gitlab though if you want.

Offline

#6 2024-06-23 22:59:41

Pheeble
Member
Registered: 2015-06-22
Posts: 27

Re: Possible bug in xfce4-volumed

Tamaranch wrote:

Hm actually that's not really an argument. The icon names for the microphone aren't in the spec either and are generally present in the themes, and xfce4-pulseaudio-plugin uses them too.

I don't use this component so I'd rather not make any hasty changes like that. Feel free to open a new issue on gitlab though if you want.

Good point about the microphone icons - I hadn't realized they weren't part of the freedesktop spec. I just noticed that the icon naming spec hasn't been updated since 2006. It refers to the possibility of addendums for adding new icons but there don't appear to have been any addendums added. As such, it's probably not a good reference point.

The icon issue in XFCE seems like it would be messy to fix.

Either every theme would have to add an 'XFCE compatible' group of one or more icons (not likely to happen) or the XFCE code for generating notifications would have to include checking the current theme for the existence of preferred icons with a fallback to standard icons if preferred icons are not found (which would certainly complicate the code and probably introduce new dependencies.)

Ick.

As the situation seems so difficult to fix, there's probably no point in opening a new issue about this.

P.S. A quick workaround to address the missing icon issue:

Copy an 'audio-volume-muted' icon from the current theme to "$HOME/.local/share/icons" and rename it to 'audio-volume-off'.

In my case:

mkdir -p "$HOME/.local/share/icons"
cp /usr/share/icons/gnome/48x48/status/audio-volume-muted.png "$HOME/.local/share/icons/audio-volume-off.png"

The change should take effect immediately without needing to log out.
Note: It might be necessary to check the current theme's 'index.theme' file for inherited icon themes to track down the icon file used by the current theme.

Last edited by Pheeble (2024-06-24 11:02:50)

Offline

Board footer

Powered by FluxBB