[GH-ISSUE #148] Terminal Window Freeze due to Album Art (Kitty Terminal) #72

Closed
opened 2026-03-02 23:44:15 +03:00 by kerem · 11 comments
Owner

Originally created by @ForeignExchangeZtudent on GitHub (Feb 26, 2023).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/148

Describe the bug
spotify-player freezes after 1-2 minutes of play with Kitty while using the Album Art (Image) feature.

To Reproduce
Repeatedly tried to check if the same behavior occurs, it does. I decided to check if WezTerm had the same issue as they use the same format as Kitty and it does not freeze which might mean it is a Kitty issue which is why I have kind of just decided to go "Oh well." about this.

Expected behavior
The player to be able to be ran with Album Art in Kitty without Terminal Window freezing.

Log and backtrace
No logs, seems to be a Kitty issue and unfortunately it is untraceable within Kitty logs too as the Window is labeled as "Not frozen" so I just gave up trying to figure out if there could be any logs in this regard.

I am sorry that I cannot provide any making this bug report quite redundant. I did not test if Kitty window would freeze after several showcases of images in terminal window. But, I think it would be all over the Kitty project if that was the case.

Environment

  • OS: Manjaro XFCE
  • Application version:spotify-player 0.12
  • Application features: if applicable, provide cargo features used to build with spotify-player
  • Image, Notify

Additional context
Honestly I'd prefer WezTerm but unfortunately due to the lack of aRGB support for themeing I am kind of stuck utilizing Kitty without Album Art support as Kitty has a weird quirk which supports my love for themeing around Terminal Background Images due to its compositor.

Originally created by @ForeignExchangeZtudent on GitHub (Feb 26, 2023). Original GitHub issue: https://github.com/aome510/spotify-player/issues/148 **Describe the bug** spotify-player freezes after 1-2 minutes of play with Kitty while using the Album Art (Image) feature. **To Reproduce** Repeatedly tried to check if the same behavior occurs, it does. I decided to check if WezTerm had the same issue as they use the same format as Kitty and it does not freeze which might mean it is a Kitty issue which is why I have kind of just decided to go "Oh well." about this. **Expected behavior** The player to be able to be ran with Album Art in Kitty without Terminal Window freezing. **Log and backtrace** No logs, seems to be a Kitty issue and unfortunately it is untraceable within Kitty logs too as the Window is labeled as "Not frozen" so I just gave up trying to figure out if there could be any logs in this regard. I am sorry that I cannot provide any making this bug report quite redundant. I did not test if Kitty window would freeze after several showcases of images in terminal window. But, I think it would be all over the Kitty project if that was the case. **Environment** - OS: Manjaro XFCE - Application version:spotify-player 0.12 - Application features: if applicable, provide [cargo features](https://doc.rust-lang.org/cargo/reference/features.html) used to build with `spotify-player` - Image, Notify **Additional context** Honestly I'd prefer WezTerm but unfortunately due to the lack of aRGB support for themeing I am kind of stuck utilizing Kitty without Album Art support as Kitty has a weird quirk which supports my love for themeing around Terminal Background Images due to its compositor.
kerem 2026-03-02 23:44:15 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@aome510 commented on GitHub (Feb 26, 2023):

spotify-player freezes after 1-2 minutes of play with Kitty while using the Album Art (Image) feature.

Do you have a video replicating the issue? I suspect it might be because of a potential deadlock. That said, I haven't encountered any issues running on Ubuntu 22.04, kitty 0.21.2.

No logs

There should be log in ~/.cache/spotify-player, can you check it again?

<!-- gh-comment-id:1445250743 --> @aome510 commented on GitHub (Feb 26, 2023): > spotify-player freezes after 1-2 minutes of play with Kitty while using the Album Art (Image) feature. Do you have a video replicating the issue? I suspect it might be because of a potential deadlock. That said, I haven't encountered any issues running on Ubuntu 22.04, kitty `0.21.2`. > No logs There should be log in `~/.cache/spotify-player`, can you check it again?
Author
Owner

@ForeignExchangeZtudent commented on GitHub (Feb 26, 2023):

Massive apologies for taking so long to report back.

Decided to check if its a "Me" problem. So I changed my Kitty config to a more default one while running with no themes.

https://user-images.githubusercontent.com/26606458/221420281-daac812e-6b25-4d00-9a6d-7dd9a501e0bc.mp4

(Freeze at 58 seconds)

As you can see it freezes around 1 minute and 12 seconds playtime. Window is just completely dead after that (Music still plays)

Just to make sure that it is as dead stock settings as possible I added the default theme file and ran gruvbox_light.

https://user-images.githubusercontent.com/26606458/221420357-37dc9cc1-3ed5-42c4-bf85-40e83a88f47d.mp4

(Freeze at 56 seconds)

2023-02-26T15:19:08.686348Z INFO client_request{request=Search("Pink floyd Eclipse")}: spotify_player::client: successfully handled the client request, took: 360ms
2023-02-26T15:19:29.021878Z INFO client_request{request=Search("Eclipse")}: spotify_player::client: successfully handled the client request, took: 310ms
2023-02-26T15:19:41.759867Z INFO spotify_player::streaming: Got an event from the integrated player: Changed { old_track_id: SpotifyId { id: 245730711378054426041083879867341866666, audio_type: Track }, new_track_id: SpotifyId { id: 174025106707755596360458671758357820961, audio_type: Track } }
2023-02-26T15:19:41.759914Z INFO spotify_player::streaming: Got an event from the integrated player: Loading { play_request_id: 1, track_id: SpotifyId { id: 174025106707755596360458671758357820961, audio_type: Track }, position_ms: 0 }
2023-02-26T15:19:41.976289Z INFO client_request{request=GetCurrentPlayback}: spotify_player::client: successfully handled the client request, took: 216ms
2023-02-26T15:19:41.981859Z INFO client_request{request=Player(StartPlayback(URIs([TrackId("3Z2RsIdWm4BNbT0LsFBuoN")], None)))}: spotify_player::client: successfully handled the client request, took: 829ms
2023-02-26T15:19:41.994398Z INFO client_request{request=GetCurrentPlayback}: spotify_player::client: successfully handled the client request, took: 234ms
2023-02-26T15:19:42.768868Z INFO spotify_player::streaming: Got an event from the integrated player: Playing { play_request_id: 1, track_id: SpotifyId { id: 174025106707755596360458671758357820961, audio_type: Track }, position_ms: 0, duration_ms: 114093 }
2023-02-26T15:19:42.988853Z INFO client_request{request=GetCurrentPlayback}: spotify_player::client: Retrieving an image from url: https://i.scdn.co/image/ab67616d0000b273d3709135d1005baa36939d80
2023-02-26T15:19:43.076280Z INFO client_request{request=GetCurrentPlayback}: spotify_player::client: Retrieving an image from the file: /home/jinako/.cache/spotify-player/image/The Dark Side Of The Moon (2011 Remastered Version)-Pink Floyd-cover.jpg
2023-02-26T15:19:43.085617Z INFO client_request{request=GetCurrentPlayback}: spotify_player::client: successfully handled the client request, took: 316ms
2023-02-26T15:21:06.523589Z INFO spotify_player::streaming: Got an event from the integrated player: TimeToPreloadNextTrack { play_request_id: 1, track_id: SpotifyId { id: 174025106707755596360458671758357820961, audio_type: Track } }
2023-02-26T15:21:36.330509Z INFO spotify_player::streaming: Got an event from the integrated player: EndOfTrack { play_request_id: 1, track_id: SpotifyId { id: 174025106707755596360458671758357820961, audio_type: Track } }
2023-02-26T15:21:36.330575Z INFO spotify_player::streaming: Got an event from the integrated player: Changed { old_track_id: SpotifyId { id: 174025106707755596360458671758357820961, audio_type: Track }, new_track_id: SpotifyId { id: 174025106707755596360458671758357820961, audio_type: Track } }
2023-02-26T15:21:36.330606Z INFO spotify_player::streaming: Got an event from the integrated player: Paused { play_request_id: 2, track_id: SpotifyId { id: 174025106707755596360458671758357820961, audio_type: Track }, position_ms: 0, duration_ms: 114093 }

Nothing (Nothing in Backtrace either), I am assuming its just something system related or a Kitty issue most likely related to my system itself. Either way, it still works fine without Album Art so I stick to that.

Running Kitty within Kitty for debugging provides no sign of any errors either.

Kitty version is: 0.27.1

<!-- gh-comment-id:1445391535 --> @ForeignExchangeZtudent commented on GitHub (Feb 26, 2023): Massive apologies for taking so long to report back. Decided to check if its a "Me" problem. So I changed my Kitty config to a more default one while running with no themes. https://user-images.githubusercontent.com/26606458/221420281-daac812e-6b25-4d00-9a6d-7dd9a501e0bc.mp4 (Freeze at 58 seconds) As you can see it freezes around 1 minute and 12 seconds playtime. Window is just completely dead after that (Music still plays) Just to make sure that it is as dead stock settings as possible I added the default theme file and ran gruvbox_light. https://user-images.githubusercontent.com/26606458/221420357-37dc9cc1-3ed5-42c4-bf85-40e83a88f47d.mp4 (Freeze at 56 seconds) > 2023-02-26T15:19:08.686348Z INFO client_request{request=Search("Pink floyd Eclipse")}: spotify_player::client: successfully handled the client request, took: 360ms 2023-02-26T15:19:29.021878Z INFO client_request{request=Search("Eclipse")}: spotify_player::client: successfully handled the client request, took: 310ms 2023-02-26T15:19:41.759867Z INFO spotify_player::streaming: Got an event from the integrated player: Changed { old_track_id: SpotifyId { id: 245730711378054426041083879867341866666, audio_type: Track }, new_track_id: SpotifyId { id: 174025106707755596360458671758357820961, audio_type: Track } } 2023-02-26T15:19:41.759914Z INFO spotify_player::streaming: Got an event from the integrated player: Loading { play_request_id: 1, track_id: SpotifyId { id: 174025106707755596360458671758357820961, audio_type: Track }, position_ms: 0 } 2023-02-26T15:19:41.976289Z INFO client_request{request=GetCurrentPlayback}: spotify_player::client: successfully handled the client request, took: 216ms 2023-02-26T15:19:41.981859Z INFO client_request{request=Player(StartPlayback(URIs([TrackId("3Z2RsIdWm4BNbT0LsFBuoN")], None)))}: spotify_player::client: successfully handled the client request, took: 829ms 2023-02-26T15:19:41.994398Z INFO client_request{request=GetCurrentPlayback}: spotify_player::client: successfully handled the client request, took: 234ms 2023-02-26T15:19:42.768868Z INFO spotify_player::streaming: Got an event from the integrated player: Playing { play_request_id: 1, track_id: SpotifyId { id: 174025106707755596360458671758357820961, audio_type: Track }, position_ms: 0, duration_ms: 114093 } 2023-02-26T15:19:42.988853Z INFO client_request{request=GetCurrentPlayback}: spotify_player::client: Retrieving an image from url: https://i.scdn.co/image/ab67616d0000b273d3709135d1005baa36939d80 2023-02-26T15:19:43.076280Z INFO client_request{request=GetCurrentPlayback}: spotify_player::client: Retrieving an image from the file: /home/jinako/.cache/spotify-player/image/The Dark Side Of The Moon (2011 Remastered Version)-Pink Floyd-cover.jpg 2023-02-26T15:19:43.085617Z INFO client_request{request=GetCurrentPlayback}: spotify_player::client: successfully handled the client request, took: 316ms 2023-02-26T15:21:06.523589Z INFO spotify_player::streaming: Got an event from the integrated player: TimeToPreloadNextTrack { play_request_id: 1, track_id: SpotifyId { id: 174025106707755596360458671758357820961, audio_type: Track } } 2023-02-26T15:21:36.330509Z INFO spotify_player::streaming: Got an event from the integrated player: EndOfTrack { play_request_id: 1, track_id: SpotifyId { id: 174025106707755596360458671758357820961, audio_type: Track } } 2023-02-26T15:21:36.330575Z INFO spotify_player::streaming: Got an event from the integrated player: Changed { old_track_id: SpotifyId { id: 174025106707755596360458671758357820961, audio_type: Track }, new_track_id: SpotifyId { id: 174025106707755596360458671758357820961, audio_type: Track } } 2023-02-26T15:21:36.330606Z INFO spotify_player::streaming: Got an event from the integrated player: Paused { play_request_id: 2, track_id: SpotifyId { id: 174025106707755596360458671758357820961, audio_type: Track }, position_ms: 0, duration_ms: 114093 } Nothing (Nothing in Backtrace either), I am assuming its just something system related or a Kitty issue most likely related to my system itself. Either way, it still works fine without Album Art so I stick to that. Running Kitty within Kitty for debugging provides no sign of any errors either. Kitty version is: 0.27.1
Author
Owner

@aome510 commented on GitHub (Feb 26, 2023):

Hi @ForeignExchangeZtudent, thanks for the demonstration. I did some experiments but failed to reproduce the issue. Does this happen every time you run the app?

I wonder if increasing cover_image_refresh_duration_in_ms config option to 5000 or above can help. I'll keep an eye on this issue in case it happens on my machine. For now, I couldn't really do anything.

<!-- gh-comment-id:1445457641 --> @aome510 commented on GitHub (Feb 26, 2023): Hi @ForeignExchangeZtudent, thanks for the demonstration. I did some experiments but failed to reproduce the issue. Does this happen every time you run the app? I wonder if increasing `cover_image_refresh_duration_in_ms` config option to `5000` or above can help. I'll keep an eye on this issue in case it happens on my machine. For now, I couldn't really do anything.
Author
Owner

@ForeignExchangeZtudent commented on GitHub (Feb 26, 2023):

Decided to set it to 5000. Thought it was fixed as it ran through the track completely, but then it froze on me after I decided to play a celebratory track.

Set it to 10000 and so far has not had any issues after 14 minutes of play. I will edit after proper testing tomorrow if it continues although considering the length of time with no freezes I think it will be fine.

So yeah, definitely seems to be related to that.

Uncertain what value is "safe". 10000 is definitely safe as far as I can tell from my testing. Whether that should be default or not is up to you to avoid others encountering this.

<!-- gh-comment-id:1445468885 --> @ForeignExchangeZtudent commented on GitHub (Feb 26, 2023): Decided to set it to 5000. Thought it was fixed as it ran through the track completely, but then it froze on me after I decided to play a celebratory track. Set it to 10000 and so far has not had any issues after 14 minutes of play. I will edit after proper testing tomorrow if it continues although considering the length of time with no freezes I think it will be fine. So yeah, definitely seems to be related to that. Uncertain what value is "safe". 10000 is definitely safe as far as I can tell from my testing. Whether that should be default or not is up to you to avoid others encountering this.
Author
Owner

@aome510 commented on GitHub (Feb 26, 2023):

Interesting, it seems that higher value onlys delay the issue for you. I did try to reduce the parameter but still couldn't reproduce it on my machine though 😅 . Hopefully, it is plausible workaround for now until I find the cause.

<!-- gh-comment-id:1445489876 --> @aome510 commented on GitHub (Feb 26, 2023): Interesting, it seems that higher value onlys delay the issue for you. I did try to reduce the parameter but still couldn't reproduce it on my machine though 😅 . Hopefully, it is plausible workaround for now until I find the cause.
Author
Owner

@ForeignExchangeZtudent commented on GitHub (Feb 27, 2023):

Just a final update on the issue. Apparently it was at 100 seconds (100000 ms), it froze after 3-4 hours of playtime.

Decided to just make the number as large as possible and so far seems to work flawlessly and haven't had any freezes.

Number of refreshes? It seems odd that it seems to freeze around the same time every time. (See Default settings freezing around the exact same timeframe (Videos))

I don't know, honestly. I'm just happy I figured out a solution that gives me a days worth of playtime without a freeze.

<!-- gh-comment-id:1447103947 --> @ForeignExchangeZtudent commented on GitHub (Feb 27, 2023): Just a final update on the issue. Apparently it was at 100 seconds (100000 ms), it froze after 3-4 hours of playtime. Decided to just make the number as large as possible and so far seems to work flawlessly and haven't had any freezes. Number of refreshes? It seems odd that it seems to freeze around the same time every time. (See Default settings freezing around the exact same timeframe (Videos)) I don't know, honestly. I'm just happy I figured out a solution that gives me a days worth of playtime without a freeze.
Author
Owner

@slikie commented on GitHub (Mar 4, 2023):

possibly related to https://github.com/atanunq/viuer/issues/47

do you have all the temp files under /tmp/.tmp.viuer.*?

<!-- gh-comment-id:1454722462 --> @slikie commented on GitHub (Mar 4, 2023): possibly related to https://github.com/atanunq/viuer/issues/47 do you have all the temp files under `/tmp/.tmp.viuer.*`?
Author
Owner

@aome510 commented on GitHub (Mar 4, 2023):

Possibly related to https://github.com/aome510/spotify-player/issues/80 as well. Also seems to involve temp files.

<!-- gh-comment-id:1454772932 --> @aome510 commented on GitHub (Mar 4, 2023): Possibly related to https://github.com/aome510/spotify-player/issues/80 as well. Also seems to involve temp files.
Author
Owner

@slikie commented on GitHub (Mar 4, 2023):

Maybe switch to https://docs.rs/pic/latest/pic ? seems like similar enough.

<!-- gh-comment-id:1454791367 --> @slikie commented on GitHub (Mar 4, 2023): Maybe switch to https://docs.rs/pic/latest/pic ? seems like similar enough.
Author
Owner

@ForeignExchangeZtudent commented on GitHub (Mar 4, 2023):

do you have all the temp files under /tmp/.tmp.viuer.*?

Yep.

Again, I want to reconfirm that just making the cover_image_refresh_duration_in_ms as large of a integer as possible gives you a full day of playtime no matter what with no clear issues from my experience.

I don't believe its a issue related to Image itself as running Wezterm with Image works flawlessly without any freezes.

Worst case scenario its just a quirk with Kitty and I don't really have much more to contribute to the issue as it has a clear workaround that functions and makes it useable for a full day.

Anyways, I've said my piece on this issue and left a solution for those who stumble upon this themselves. Can't do much more than that from my angle.

<!-- gh-comment-id:1454835439 --> @ForeignExchangeZtudent commented on GitHub (Mar 4, 2023): > do you have all the temp files under `/tmp/.tmp.viuer.*`? Yep. Again, I want to reconfirm that just making the cover_image_refresh_duration_in_ms as large of a integer as possible gives you a full day of playtime no matter what with no clear issues from my experience. I don't believe its a issue related to Image itself as running Wezterm with Image works flawlessly without any freezes. Worst case scenario its just a quirk with Kitty and I don't really have much more to contribute to the issue as it has a clear workaround that functions and makes it useable for a full day. Anyways, I've said my piece on this issue and left a solution for those who stumble upon this themselves. Can't do much more than that from my angle.
Author
Owner

@aome510 commented on GitHub (Mar 9, 2023):

That said, I haven't encountered any issues running on Ubuntu 22.04, kitty 0.21.2.

@ForeignExchangeZtudent I'm now able to reproduce the issue on my laptop with Ubuntu 20.04, kitty 0.26.5. The cause is because of too many temp files in /tmp folder as @slikie pointed out.

This issue should be fixed by #157. I haven't encountered any issues since then with the default cover_image_refresh_duration_in_ms=2000.

<!-- gh-comment-id:1462623264 --> @aome510 commented on GitHub (Mar 9, 2023): > That said, I haven't encountered any issues running on Ubuntu 22.04, kitty 0.21.2. @ForeignExchangeZtudent I'm now able to reproduce the issue on my laptop with Ubuntu 20.04, kitty 0.26.5. The cause is because of too many temp files in `/tmp` folder as @slikie pointed out. This issue should be fixed by #157. I haven't encountered any issues since then with the default `cover_image_refresh_duration_in_ms=2000`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-player#72
No description provided.