Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

volctl doesn't start if notification area is not ready #56

Open
lfiolhais opened this issue Aug 16, 2021 · 4 comments
Open

volctl doesn't start if notification area is not ready #56

lfiolhais opened this issue Aug 16, 2021 · 4 comments

Comments

@lfiolhais
Copy link

volctl often does not start with my window manager at startup and I need to launch it, either through CLI or rofi. The error that I get at startup is

PulseAudio connected
Warning: Could not embed Gtk.StatusIcon.
Fatal error: Could not create a status icon. Are you sure you have a working notification area?

I'm launching volctl in my .xprofile which is then executed by my window manager with volctl &.

I ended up "fixing" the issue by increasing MAX_EMBED_ATTEMPTS to 100. Before making this change I tried to reinstall the package through AUR multiple times with no difference.

SystemInfo:

  • ArchLinux w/ kernel 5.13.10
  • x86
  • awesomeWM v4.3
  • Python 3.9

Could you provide any guidance on how I should debug this further?

@raven2cz
Copy link
Contributor

I have same configuration and awesome (not 4.3, but 4.4+), but it is almost same. And it works.
The problem will be in the initialization sequence.
Try my settings with autorun script.
The settings are in

https://github.com/raven2cz/dotfiles/blob/master/.config/awesome/autorun.sh

started from rc.lua.

@buzz
Copy link
Owner

buzz commented Aug 18, 2021

@lfiolhais You're facing a race condition. The system tray icon area of your DE is not ready when volctl is started. Just delay the start of volctl by a couple seconds to make sure your system tray is properly initialized. (sleep 5 && volctl & or similar)

@lfiolhais
Copy link
Author

Hi all

@raven2cz My setup is equivalent to yours. The same problems occurs.

@buzz Ah that sucks. However, I should say that I have other tray applications starting in the same way and none display this issue. I'm not very fond of delaying my startup routine because of one application. As I said, other applications don't exhibit this problem. Since I have a solution and you have identified the problem on my end, I'll close the issue.

Thank you to both.

@musjj musjj mentioned this issue Aug 28, 2023
@buzz buzz changed the title volctl doesn't start at startup volctl doesn't start if notification area is not ready Sep 2, 2023
@buzz
Copy link
Owner

buzz commented Sep 2, 2023

Referencing a new report at #81. This issue still seems to exist for some people.

The current implementation retries the status icon creation up to 5 times after a fixed delay of 100ms. This results in a max waiting time of 500ms for the notification area to be usable.

I propose extending the current mechanism with an exponential backoff, thus doubling the delay on each failure and increasing MAX_EMBED_ATTEMPTS to 6. This would result in a max waiting time of 6.7 seconds.

The consideration here is to account for the case when no GTK status icon area is available. Those would have to wait until volctl errors out as we can't know if a notification area is currently initializing or the environment simply doesn't have one.

Happy to review a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants