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

"Launch Service at System Startup" does not work properly. #3640

Open
hayama77 opened this issue Jan 23, 2025 · 20 comments
Open

"Launch Service at System Startup" does not work properly. #3640

hayama77 opened this issue Jan 23, 2025 · 20 comments

Comments

@hayama77
Copy link

EasyEffects Version

7.2.3

What package are you using?

Arch (easyeffects)

Distribution

Linux/ Raspberry pi5

Describe the bug

Hello! This is an operation report and a request.

To launch EasyEffects automatically after booting up the Raspberry Pi5, I turned on the "Launch Service at System Startup" button on the menu screen.
This action automatically generated "~/.config/autostart/com.github.wwmm.easyeffects.desktop".

However, even when I restart the Raspberry Pi, EasyEffects does not launch automatically.
When I checked the contents of the automatically generated "com.github.wwmm.easyeffects.desktop", it was as follows.

[Desktop Entry]
Type=Application
Name=com.github.wwmm.easyeffects
Exec=flatpak run --command=easyeffects com.github.wwmm.easyeffects --gapplication-service
X-Flatpak=com.github.wwmm.easyeffects

According to analysis report of ChatGPT, the "--gapplication-service" flag was usually used to run background services, but this setting may not be working as intended.
On the other hand, when I set it to my own autorun file (below), EasyEffects started up automatically when the system started.

[Desktop Entry]
Type=Application
Exec=flatpak run com.github.wwmm.easyeffects
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=Easy Effects
Comment=Start Easy Effects on login

There seems to be a problem with the contents of the autorun file (com.github.wwmm.easyeffects.desktop) that is generated when users turn on the "Launch Service at System Startup" button.
Is it possible to fix it in future update?

Thank you.

Expected Behavior

EasyEffects started up automatically when the system started.

Debug Log

Debug Log
Paste your log here

Additional Information

No response

@wwmm
Copy link
Owner

wwmm commented Jan 23, 2025

However, even when I restart the Raspberry Pi, EasyEffects does not launch automatically.

The desktop file in the autostart folder requires support from the desktop environment. What is usually the case when running KDE or GNOME. Which desktop is being used by the Raspberry?

Exec=flatpak run com.github.wwmm.easyeffects

When using the Flatpak package the autostart can be a little tricky. Under ordinary circumstances a window is shown asking the user for the autostart permission. But this often fails if the desktop does not have the required xdg portal packages installed. Based on what I have seen outside of KDE and GNOME it may be more reliable to write that file manually as you have already done.

The easiest solution in this case would be to not use the Flatpak package to install EasyEffects. But I do not think there are native packages for EasyEffects for Raspberry's distributions.

@hayama77
Copy link
Author

In my Raspberry Pi environment, when I turned on the "Launch Service at System Startup" button, the following warning messages always appeared:

"Unable to get background access: Background access has been denied."
"Please allow Easy Effects to ask again with Flatpak permission-reset com.github.wwmm.easyeffects"

To resolve this issue, I reset the Flatpak permissions. And next, I installed xdg-desktop-portal.
This operation eliminated the above warning message, but as I reported last time, I noticed that the autorun file was insufficient.

Currently, I prefer the Flatpak package because it makes very easy install the latest version of EasyEffects.
I don't want to give up this convenience, so based on your advice, I will use the manually created autorun file.
(Of course, in this case, the "Launch Service at System Startup" button will always be turned off.)

For now, since this will enable the automatic launch of EasyEffects, which is my first goal, I will proceed with the evaluation.

By the way, my ultimate wish is not only for the EasyEffects app to launch automatically, but for "Input","Effects" and "Enable input monitoring" on the main screen to be automatically selected and monitoring to be automatically started.
In other words, when the Raspberry Pi is powered on, monitoring will automatically start in the state it was in the last time it was used.
Once the parameters are set, many users will continue to use the same values ​​next time, so I would like to operate it simply without connecting a display.
In that case, it would be great if the autorun file had lines that define "Input or Output", "Recorders or Effects" and "Enable input monitoring".
I would like to consult you on how to make this happen. I need your help !!

@wwmm
Copy link
Owner

wwmm commented Jan 23, 2025

To resolve this issue, I reset the Flatpak permissions. And next, I installed xdg-desktop-portal.
This operation eliminated the above warning message, but as I reported last time, I noticed that the autorun file was insufficient.

@violetmage can explain this better but depending on the desktop being used specific xdg desktop portal packages have to be installed. I think that it can't just be any of them.

@wwmm
Copy link
Owner

wwmm commented Jan 23, 2025

In other words, when the Raspberry Pi is powered on, monitoring will automatically start in the state it was in the last time it was used.

By this do you mean for EasyEffects to remember which section of tis window were used and reopen on it when its window is shown? If yes it is something that will happen after we move from gtk to Qt. Our Qt branch already does that. But it is not ready for users yet.

@violetmage
Copy link
Contributor

violetmage commented Jan 23, 2025

Yes, xdg style autostart using desktop files is effectively the responsibility of the window manager, and they all implement this a bit differently.

Every window manager is supposed to also have it's own xdg-desktop-portal-$(name) package, since the generic xdg-desktop-portal-gtk cannot implement services that require wm specific functions and is thus intentionally feature incomplete.

It exists so that wm's don't have to rewrite all the mundane stuff, only requests outside of xdg-desktop-portal-gtk's scope have to be implemented by the wm, the wm can send the boring requests off to xdg-desktop-portal-gtk.

The Qt/KDE situation is very similar.

Edit: the most consistent way a background app could be started would probably be user session systemd units, but that's not an xdg standard, so can't be done from a flatpak.

@hayama77
Copy link
Author

To resolve this issue, I reset the Flatpak permissions. And next, I installed xdg-desktop-portal.
This operation eliminated the above warning message, but as I reported last time, I noticed that the autorun file was insufficient.

@violetmage can explain this better but depending on the desktop being used specific xdg desktop portal packages have to be installed. I think that it can't just be any of them.

Thank you for your comments. for your refernce,In my case, I executed following commands.
sudo apt update
sudo apt install --no-install-recommends xdg-desktop-portal-gnome

@hayama77
Copy link
Author

hayama77 commented Jan 24, 2025

In other words, when the Raspberry Pi is powered on, monitoring will automatically start in the state it was in the last time it was used.

By this do you mean for EasyEffects to remember which section of tis window were used and reopen on it when its window is shown? If yes it is something that will happen after we move from gtk to Qt. Our Qt branch already does that. But it is not ready for users yet.

Yes. Of course I know that.EasyEffects remembers the screen and presets I used last time, and starts from that state next time. This is a perfect specification!

What I am saying is that I want to automate the operation procedure from then on.
With the current specification, EasyEffects will not work unless I click the mouse three times: 'input' → 'Effects' → 'Enable input monitoring' every time.
Of course, this operation procedure will be different for each person. But it would be great if each individual could customize it to their own convenience.

Please imagine this:
When you power on a hardware equipments such as an equalizer or compressor, it starts working immediately with the current settings. No display or mouse is required.

As same way, when there is no need to change parameters, I want the EasyEffects effector functions to start up automatically when I just power it on.
Of course, when I want to change parameters, I need to connect a display and mouse.
But at other times, I don't need a display or mouse. I want it to work immediately when I just power it on, just like the conventional hardware equipments shown above.

@hayama77
Copy link
Author

Yes, xdg style autostart using desktop files is effectively the responsibility of the window manager, and they all implement this a bit differently.

Every window manager is supposed to also have it's own xdg-desktop-portal-$(name) package, since the generic xdg-desktop-portal-gtk cannot implement services that require wm specific functions and is thus intentionally feature incomplete.

It exists so that wm's don't have to rewrite all the mundane stuff, only requests outside of xdg-desktop-portal-gtk's scope have to be implemented by the wm, the wm can send the boring requests off to xdg-desktop-portal-gtk.

The Qt/KDE situation is very similar.

Edit: the most consistent way a background app could be started would probably be user session systemd units, but that's not an xdg standard, so can't be done from a flatpak.

Thank you for explaining. I understand the situation now.

@wwmm
Copy link
Owner

wwmm commented Jan 24, 2025

EasyEffects will not work unless I click the mouse three times: 'input' → 'Effects' → 'Enable input monitoring' every time.

Did you enable Process All Input Streams in EasyEffects preferences window? If you do that it will redirect apps that record audio just like it does by default to the ones that playback.

When process all input/output streams is disabled it is up to the user to manage which streams will have effects or not. Sometimes WirePlumber will remember the association and restore it automatically. But it is not guaranteed.

I want the EasyEffects effector functions to start up automatically when I just power it on.

It will if process all streams is enabled.

@hayama77
Copy link
Author

Did you enable Process All Input Streams in EasyEffects preferences window?

Yes. I have always had "process all input/output streams" enabled.
Therefore, when EasyEffects is launched, the preset state and input/output audio devices are the same as the last time.
I think this is a good specification and have no complaints.

It will if process all streams is enabled.

However, when EasyEffects is launched, "Output" and "Recorders" are always selected.
Therefore, I have to click with the mouse every time to change them to "input" and "Effects".
And finally, I have to click the "Enable/disable input monitoring" button to actually start EasyEffects.

I realized after writing this letter so far that I'm beginning to think that this inconvenience might only be due to the Raspberry Pi environment I'm using.
In your environment, EasyEffects starts running automatically without any mouse click operation, right?
This may be a side effect of installing it with Flatpak.
I will install it in a different way over the weekend and check the behavior.

@wwmm
Copy link
Owner

wwmm commented Jan 24, 2025

In your environment, EasyEffects starts running automatically without any mouse click operation, right?

At least on KDE and GNOME EasyEffects autostarts on login and process audio in the background just fine when using a native installation package. No need to click on its icon to start it. When installing through Flatpak there is the whole xdg portal situation that can be still annoying even if not using a Raspberry.

@hayama77
Copy link
Author

In your environment, EasyEffects starts running automatically without any mouse click operation, right?

At least on KDE and GNOME EasyEffects autostarts on login and process audio in the background just fine when using a native installation package. No need to click on its icon to start it. When installing through Flatpak there is the whole xdg portal situation that can be still annoying even if not using a Raspberry.

Thanks for the helpful comments, I'll try a different installation method. (^_^)

@hayama77
Copy link
Author

hayama77 commented Feb 3, 2025

I have been trying to install Easyeffects natively on Raspberry pi5 for the past two weeks.
Installing without Flatpak was very time-consuming because many errors occurred during the build. But I managed to install it.

After launching Easyeffects, I tried to enable "Launch Service at System Startup" (also enabled "Process All Input Streams").
However, when I rebooted Raspberry pi, Easyeffects did not launch automatically. I was hoping that it would launch automatically and start working without any mouse operations, but that did not happen.

Although it was a very disappointing result, I would like to report it to you as the current behavior of installing Easyeffects on Raspberry pi. Thank you and violetmage for your kind support so far.

@wwmm
Copy link
Owner

wwmm commented Feb 3, 2025

After launching Easyeffects, I tried to enable "Launch Service at System Startup" (also enabled "Process All Input Streams").
However, when I rebooted Raspberry pi, Easyeffects did not launch automatically. I was hoping that it would launch automatically and start working without any mouse operations, but that did not happen.

Which desktop are you using? The autostart of files inside ~/.config/autostart/ is the desktop environment responsibility.

@violetmage
Copy link
Contributor

@wwmm Perhaps the option should be renamed to "Start in background at Login", as I think it's equally clear and doesn't misrepresent what actually happens.

@wwmm
Copy link
Owner

wwmm commented Feb 3, 2025

Perhaps the option should be renamed to "Start in background at Login", as I think it's equally clear and doesn't misrepresent what actually happens.

I do not see a problem in renaming it. But I think people will still expect things to just work anyway.

@hayama77
Copy link
Author

hayama77 commented Feb 4, 2025

Which desktop are you using? The autostart of files inside ~/.config/autostart/ is the desktop environment responsibility.

Below is information about the autostart file that was generated when I natively installed Easyeffects on the Raspberry pi5.

~/.config/autostart/easyeffects-service.desktop

#The contents
[desktop Entry]
Name=Easy Effects
Comment=Easy Effects Service
Exec=easyeffects --gapplication-service
Icon=com.github.wwmm.easyeffects
StartupNotify=false
Terminal=false
Type=Application

@wwmm
Copy link
Owner

wwmm commented Feb 4, 2025

Below is information about the autostart file that was generated when I natively installed Easyeffects on the Raspberry pi5.

As expected the desktop file is fine. The issue is the desktop being used in your Raspberry installation. It does not seem to use autostart files.

@hayama77
Copy link
Author

hayama77 commented Feb 4, 2025

It does not seem to use autostart files.

Yes, after analyzing this code it is clear that it doesn't work as I expected. This is the current situation of it.
It would be nice if I could add the features by hand coding as a temporary measure ....

@wwmm
Copy link
Owner

wwmm commented Feb 4, 2025

Yes, after analyzing this code it is clear that it doesn't work as I expected. This is the current situation of it.
It would be nice if I could add the features by hand coding as a temporary measure ....

Maybe #3635 will help you. But that still depends on whether systemd will start EasyEffects at the right time. As EasyEffects is just a gui app that pretends to be a service the desktop environment has to be already running when EasyEffects is started.

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

No branches or pull requests

3 participants