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

Feature request: Kiosk Mode on Raspberry Pi #528

Open
Tilogorn opened this issue Sep 25, 2024 · 17 comments
Open

Feature request: Kiosk Mode on Raspberry Pi #528

Tilogorn opened this issue Sep 25, 2024 · 17 comments

Comments

@Tilogorn
Copy link

Is your feature request related to a problem? Please describe.
As per my research Psst is currently the best (if not only) solution that provides a stable Spotify GUI on ARM-based systems. Unfortunately, Psst does not support a "kiosk" mode, which would allow many makers to create Spotify-based media centers without the hazzle of Desktop UI around the Psst window.

My specific use case is my 5 year old son who likes to listen to his audio books on Spotify. I am creating an embedded "Spotify Player" based on a battery-powered Raspberry Pi 5 in a custom housing with built-in speakers. He is able to learn to use the Psst GUI (thanks to album image support!), but he can't do anything with the system menus. And if he were to close the Psst window by mistake, he wouldn't know what to do.

Describe the solution you'd like
I'd like to have a psst-gui --kiosk flag that opens the GUI in fullscreen, as e.g. Chromium and Firefox offer it. Closing the Psst window or accessing the Desktop UI should not be possible anymore. See this official tutorial to get an idea, if this is new to you.

Describe alternatives you've considered
Of course I stumbled upon Volumio, but their audio board compatibility lacks of newer boards (my WM8960 is not supported) and their system image is still based on Debian Buster, which is end-of-support since a while.

The second best option would be to run Spotify in a native browser in kiosk mode, but Psst is of course a lot more performant.

Additional context

  • My current (and the most recent) setup is a Raspberry Pi 5 with the recent Raspberry Pi OS (Bookworm, Kernel 6.6.47) and Wayland
  • An example of another GTK application offering kiosk mode in this exact setup would be the pre-installed Firefox
  • I am willing to support the development of this feature financially. After all, it will improve the Christmas present for my son. :-)
@SO9010
Copy link
Contributor

SO9010 commented Sep 25, 2024

Hello, I am happy to have a look at this 👍

@Tilogorn
Copy link
Author

Glad to hear! Let me know if I can do anything to support you. I'll be available for hardware testing of course.
Feel free to contact me regarding the compensation.

@SO9010 SO9010 mentioned this issue Sep 25, 2024
@SO9010
Copy link
Contributor

SO9010 commented Sep 25, 2024

@Tilogorn I've had a crack at it; you are welcome to go to my branch: https://github.com/SO9010/psst/tree/kiosk-mode, where you can download it and try it yourself and give me some feedback. I have also mentioned what I have done in PR #533, which I encourage you to look at. After you are happy with the implementation, I'll message you about compensation :)

@Tilogorn
Copy link
Author

@SO9010 Wow, that was quick! Sorry for the dumb question, but can you specify "download"? The links in the README certainly point to the official (master) binaries and I cannot find any compiled versions in the source itself. Do you think I should compile the source code myself under ARM? Then I will give the Building section in the README a try.

@jacksongoode
Copy link
Collaborator

I'll review the changes tomorrow and it will become apart of the official binaries, which arm Linux is one of them. However, I think you might need to build it for the Pi architecture as it's typically different.

@SO9010
Copy link
Contributor

SO9010 commented Sep 26, 2024

@Tilogorn, sorry, my bad for not specifying; yes, you need to compile it yourself if you want to test it before @jacksongoode merges it. If you have rust and cargo installed, all you have to run is: cargo run --bin psst-gui -- --KIOSK and that should be it. If you have any issues with that just ask me :)

Also, @jacksongoode, the Aarch64 architecture is the arm, which is the processor that the Pi runs, so it should be fine.

@Tilogorn
Copy link
Author

I was able to compile it on my Pi. Thanks to your instructions, @SO9010!

To get this running on ARM, one library was missing though: libc6-dev-arm64-cross (hint from SO). You might want to add this to your build instructions.

Unfortunately, there is no Kiosk behaviour noticeable.

Sorry, terminal output is German, but the last line is saying "unknown option: --kiosk". I tried uppercase (your last reply), lowercase (your PR), and --k; its always unknown.

$ cargo run --bin psst-gui -- --kiosk
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.36s
     Running `target/debug/psst-gui --kiosk`
[2024-09-26T19:30:09Z INFO  psst_gui::data::config] loading config: "/home/daniel/.config/Psst/config.json"
[2024-09-26T19:30:09Z ERROR psst_gui::webapi::client] failed to read local tracks: No such file or directory (os error 2)
[2024-09-26T19:30:09Z INFO  psst_core::audio::output::cpal] using audio device: "default"
[2024-09-26T19:30:09Z INFO  psst_core::cache] using cache: "/home/daniel/.cache/Psst"
[2024-09-26T19:30:09Z INFO  psst_core::audio::output::cpal] opening output stream: StreamConfig { channels: 2, sample_rate: SampleRate(44100), buffer_size: Default }
[2024-09-26T19:30:09Z INFO  psst_core::session::access_token] access token expired, requesting
[2024-09-26T19:30:09Z WARN  psst_gui::controller::on_command_async] async action pending
[2024-09-26T19:30:09Z INFO  psst_core::session::access_token] access token expired, requesting
Unbekannte Option --kiosk

Let me know if I can help with troubleshooting.

@SO9010
Copy link
Contributor

SO9010 commented Sep 26, 2024

Heya, I suspect you didn't switch to the correct branch.

Try git checkout kiosk-mode

Then git pull

If you used the jpochyla repository you need to install it from from my repository

git clone -b kiosk-mode https://github.com/SO9010/psst

I'll give this a better look through on Linux tomorrow.

@Tilogorn
Copy link
Author

Tilogorn commented Sep 26, 2024 via email

@SO9010
Copy link
Contributor

SO9010 commented Sep 26, 2024

Ok so I just looked at it, the value is still being passed through so I'm not sure why the error is there.

There is still an issue where it doesn't maximise and show the preferences window when on initial set up in kiosk mode.

@Tilogorn when it's being run with -- --kiosk does the log in screen have a title bar?

@SO9010
Copy link
Contributor

SO9010 commented Sep 27, 2024

Im just setting up my own raspberry pi so I can properly test and troubleshoot it my self :)

@Tilogorn
Copy link
Author

Hi, sorry, I have just the evenings (CET) for my side projects. If you have a Pi that will easify debugging a lot probably.

I just pulled, build and made pictures with and without config.json. Its maximized, but not full screen. Title bars shown, settings cog is gone.

IMG_9026

IMG_9027

Regarding the „unknown option“. I am not sure, but is --help showing the paramter? Is there maybe some command line args library involved that builds the help and must know every parameter?

Tbh I would not spend to much effort into the settings. Everyone will setup the application in „normal“ mode and change to Kiosk once everything is set up.

@SO9010
Copy link
Contributor

SO9010 commented Sep 27, 2024

Thank you for this. I have looked into this and took your advice about putting a little effort into the settings. I even made it simpler. If not set up yet, the settings and log-in page start small and not maximised but are set to be always on top.

I had a deeper look into Druid (the UI framework being used), and unfortunately, it cannot go full screen like Firefox.

Because of this, there will be more steps to set up on devices such as the PI. You have to remove the top bar by right-clicking it and clicking "Delete this panel" do be warned that this cannot be easily un-done.

I'm pretty sure that the title bar should be removed now. However, my Raspberry Pi is number 2b, so it's a bit old, so I couldn't test it there. But I did test on LXDE, so it should be alright.

Do let me know if this didn't sort it :)

@SO9010
Copy link
Contributor

SO9010 commented Sep 27, 2024

@jacksongoode after this feature has been resolved I think the README is need of an update, notably the credits section says no async is being used, then I'll go through the build instructions and improve it and also explain how to use kiosk mode.

What do you think?

@jacksongoode
Copy link
Collaborator

I definitely agree, with the many improvements and changes we should do a comprehensive refresh of the Psst readme, with new screenshots, and detailing functionality and cleanup the roadmap!

@Tilogorn
Copy link
Author

@SO9010 Thank you for your detailed explanation. It is a pity that it is currently not possible. I will try to hide the system menu, but of course this is not a real kiosk mode. It doesn't start over the whole screen without OS modifications and the window title bar is still visible. This is more like --start-maximized or something similar.

Hiding the settings doesn't really make sense in this context in my opinion, as this is not a kiosk mode, but that is up to you.

However, updating the README in context of this MR is of course never a bad idea

@SO9010
Copy link
Contributor

SO9010 commented Sep 28, 2024

@Tilogorn I'm sorry that I couldn't help more, it's very weird that the PI keeps the window title.

If you wanted an alternative desktop environment which would probably work you could try i3 tiling manager and that with minimal modification removes the title bar and you can very easily customise all of the keybindings.

However, I understand that this is not ideal.

https://i3wm.org/

Do let me know if I can help in any way.

Edit: you may actually want to use sway as that uses Wayland: https://swaywm.org/

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