StreamController / MediaPlugin

GNU General Public License v3.0
2 stars 2 forks source link

Media Plugin throws errors whenever no active media is present #6

Open KaJe5380 opened 3 months ago

KaJe5380 commented 3 months ago

Describe the bug

Brought up in Issue StreamController/StreamController#169 When using the media plugin from the StreamController Store, having no active media present (playing or paused, does not matter) will cause errors and overall function with StreamController.

Buttons that don't even have media plugin actions on them will also be affected. The actions will still work, but the image rendering of said icon will fail.

If buttons are all blank from initial page render, and then media is brought in; icons will still not render. Changing pages to force an update does not seem to fix this either. Using the play / pause however will cause it render when active media is introduced.

Media players being stuff like: Browser (I am personally using Vivaldi) and playing YouTube Spotify (Music Streaming) Strawberry or SwingMusic (for local audio files)

I don't believe this is a StreamDeck+ issue, and will also affect the other StreamDeck hardware (minus the foot-petal)

I want to throw in that StreamController will just crash either open or in background at times. I'm wondering if these errors can potentially lead to that? Though I don't have a 100% way to replicate the crashing, so take this last part with a grain of salt.

Steps to reproduce the behavior:

This happens on new instances of StreamController, and can be replicated both via systemboot (if option is selected), or by terminating the background process and re-opening.

  1. Terminate StreamController and it's background process (I personally use Btop)

  2. Having applications that play media that also include media controls be closed. (that can be used with media keyboard hotkeys, widgets, apis)

    • Having an application (like browser or media player) open without media selected Ex: Having browser on Google homepage does not need to be closed. Ex2: Having Strawberry open with a clear playlist will not be considered media and will still cause said issue
  3. Open a new instance of StreamController, either from it's desktop shortcut or via terminal with:

    $ flatpak run com.core447.StreamController
  4. Now have user swap to a page with the media plugin binded to buttons

Expected behavior

I don't entirely know the expected behavior. I've noticed that when no media is present, the play / pause button doesn't render. This seems to be expected behavior? However when no active media is present, the next track & previous track button still seem to render?

I'd prefer if instead we did something like KDE Plasma media widget? Where when no active media is happening, to just render a STOP square? Media not present image Media present image

What I expect would icons to still render. For it to not halt the other icons that aren't even associated with media plugin to render. For errors to not show within the console output.

Screenshots

This is what StreamController is showing image

When the physical deck will also render (no desync). Note: My volume knobs don't render, even though they aren't part of the media plugin PXL_20240718_162510789

Here's how my "media" page on my deck is setup and supposed to look: image image image image image image image

Additional context

Logs for this can be found here 900 lines would bloat this issue

My Linux system outputted from Fastfetch via Konsole: image

If an active media was present on initial page render, then the icons will render. However once an active media is no longer present, icons will still show but continue to throw errors within the console.

Core447 commented 3 months ago

Thanks for the amazingly detailed issue report!

5f17b0d22219a053d0aadb0d89a78c1c136b3a55 might fix it, I'll look into it more thoroughly tomorrow. Please update the plugin through the store, restart the app (just to make sure) and try again.

KaJe5380 commented 3 months ago

Thanks for the amazingly detailed issue report!

5f17b0d might fix it, I'll look into it more thoroughly tomorrow. Please update the plugin through the store, restart the app (just to make sure) and try again.

Still using that flatpak version from that bash command from the swipe issue. I saw a toast notification about 1 asset updated and saw a new stop button! Seems to automatically update with the source?

From "initial" testing it seems to be better. However it seems when it can't find artist or title because there's no active media, console gets spammed with:

2024-07-18 10:47:14.331 | ERROR    | MediaController:title:216 - 'xesam:title'
2024-07-18 10:47:14.335 | ERROR    | MediaController:title:216 - 'xesam:title'
2024-07-18 10:47:14.340 | ERROR    | MediaController:title:216 - 'xesam:title'

2024-07-18 10:47:14.503 | ERROR    | MediaController:title:216 - 'xesam:title'
2024-07-18 10:47:14.503 | ERROR    | MediaController:title:216 - 'xesam:title'
2024-07-18 10:47:14.505 | ERROR    | MediaController:title:216 - 'xesam:title'
findfont: Font family [''] not found. Falling back to DejaVu Sans.
findfont: Font family [''] not found. Falling back to DejaVu Sans.

2024-07-18 10:48:13.700 | ERROR    | MediaController:artist:230 - 'xesam:artist'
2024-07-18 10:48:13.700 | ERROR    | MediaController:title:216 - 'xesam:title'
2024-07-18 10:48:13.701 | ERROR    | MediaController:title:216 - 'xesam:title'
2024-07-18 10:48:14.696 | ERROR    | MediaController:title:216 - 'xesam:title'
2024-07-18 10:48:14.700 | ERROR    | MediaController:artist:230 - 'xesam:artist'

Didn't realize there were separate repositories, my bad. I see an audio switcher and audio mixer repository, but what if I have an issue for audio control?

Core447 commented 3 months ago

Didn't realize there were separate repositories, my bad.

No problem, moving the issues is no big deal!

I see an audio switcher and audio mixer repository, but what if I have an issue for audio control?

AudioControl is a plugin from @G4PLS, you can find the repo here. There are also links to all repos in the plugin store on the left hand side of the install button.

However it seems when it can't find artist or title because there's no active media, console gets spammed with:

c0d93146a899ab22d67cf897a1a2137ef55ea764 should fix this

Seems to automatically update with the source?

Yes, auto update is enabled per default, but sometimes a full restart of the app might be necessary after it to apply the changes

KaJe5380 commented 3 months ago

When using Overwrite default deck screensaver within Page Settings, when the deck is in screensaver mode and you swap pages with the touch screen, media keys will once again fail to load.

This can be fixed by forcing an update (pressing one of the action keys) or by awaking from screensaver before swapping pages.

This seems to be an issue with the fact that the volume knobs and touchscreen of the StreamDeck+ do not follow the same rules as the buttons for the screensaver. This itself should have it's own issue opened. Though looking at the issue channel on discord. You have a thread about the screensaver being disabled on 1.5.1 beta due to dials and touchscreen. So I won't open a GitHub issue unless you want me to.

The dials when turned get registered inputs when Screensaver is running. Pressing in the dials too don't turn off screensaver and get registered.

Swiping the touchscreen does turn off screensaver, but unlike expected behavior of:

Skipping update_all_inputs because there is a background video

It will actually update all inputs:

Updating all inputs took 0.014662027359008789 seconds

Video here: Screensaver issue, media plugin issue

Core447 commented 3 months ago

You have a thread about the screensaver being disabled on 1.5.1 beta due to dials and touchscreen. So I won't open a GitHub issue unless you want me to.

Thanks for checking this before posing! However, the screensaver is now fully available again and therefore it can and should be expected to work. So please open a separate issue for this.

Are the actions now working as expected besides the screensaver issue? I wasn't able to reproduce this issue, yet, but I haven't tested very long. If you're still experiencing issues, I'll do a full testing tomorrow.

KaJe5380 commented 3 months ago

Thanks for checking this before posing! However, the screensaver is now fully available again and therefore it can and should be expected to work. So please open a separate issue for this.

Ahh, I see. I will open an issue on StreamController itself and reference this.

Are the actions now working as expected besides the screensaver issue? I wasn't able to reproduce this issue, yet, but I haven't tested very long. If you're still experiencing issues, I'll do a full testing tomorrow.

Actions work, and the console errors are gone, but the buttons not rendering is partially fixed. Yes buttons being rendered with no active media being present is fixed from the initial issue reason. However if possible, I'd like to keep this issue open until the screensaver issue is fixed. As it causes similar problems to this initial issue commit.

Note: In the video I sent within the screensaver issue, volume knobs once again didn't load, neither did the play / pause or the title / artist buttons.

Core447 commented 2 months ago

Are you still experiencing this with the screensaver fix?

KaJe5380 commented 2 months ago

Are you still experiencing this with the screensaver fix?

I don't seem to be experiencing this issue anymore with the screensaver fix.

Core447 commented 2 months ago

Nice!