tramhao / termusic

Music Player TUI written in Rust
GNU General Public License v3.0
963 stars 42 forks source link

Song doesn't replay after pressing `l`, and the process `termusic-server` occupies 100% CPU resource #320

Open GrimPixel opened 1 month ago

GrimPixel commented 1 month ago

Environment & Versions

Logs:

No file containing termusic found in /tmp/

$ fd termusic
var/lib/pacman/local/termusic-0.9.0-1/
usr/bin/termusic
usr/bin/termusic-server
usr/share/licenses/termusic/
usr/share/doc/termusic/

Description of the Problem

Song doesn't replay after pressing l, and the process termusic-server occupies 100% CPU resource.

hasezoey commented 1 month ago

Termusic version: d102a05[g]

i just discovered this is a bug in the build script, for context this is termusic 0.9.0-1 from AUR termusic, specifically this commit.

No file containing termusic found in /tmp/

file logging is not enabled by default for 0.9.0, you have to manually enable it by adding --log-to-file


please provide the log (by enabling the logging option), otherwise there is not enough information to help here.

also please try the master branch or AUR termusic-git

GrimPixel commented 1 month ago
[2024-05-26T00:00:00.000+02:00 ERROR termusic]: Error: status: Unavailable, message: "error trying to connect: tcp connect error: Connection refused (os error 111)", details: [], metadata: MetadataMap { headers: {} }

Caused by:
    0: transport error
    1: error trying to connect: tcp connect error: Connection refused (os error 111)
    2: tcp connect error: Connection refused (os error 111)
    3: Connection refused (os error 111)

Looks like it's about the process being killed by me manually.

hasezoey commented 1 month ago

[2024-05-26T00:00:00.000+02:00 ERROR termusic]: Error: status: Unavailable, message: "error trying to connect: tcp connect error: Connection refused (os error 111)", details: [], metadata: MetadataMap { headers: {} }

that means the TUI cannot connect to the server, likely because the server is not started. would need the server logs instead (/tmp/termusic-server.log)

Looks like it's about the process being killed by me manually.

what do you mean by that?

GrimPixel commented 1 month ago

There was no log when that CPU 100% consumption happened. I had to kill the process. After doing so, the log appeared.

hasezoey commented 1 month ago

There was no log when that CPU 100% consumption happened. I had to kill the process. After doing so, the log appeared.

then could you re-try with RUST_LOG=trace before the command? (RUST_LOG=trace termusic) there should be server logs

GrimPixel commented 1 month ago

There is still no log. It's nothing urgent for me. Maybe it can be solved later.

hasezoey commented 1 month ago

if there are no logs, i cannot really help and you would need to debug yourself as i cannot reproduce this issue.

could you re-try with latest master (if not done so already) (currently ac0b9246e1e1a610f9438b4d5b0f2f0f96275ea3) and report if that fixes your issue / produces any logs?

hasezoey commented 1 month ago

btw i just re-read the title & description:

Song doesn't replay after pressing l

could you explain more what you mean with that and which widget you have focused? (ex. Library, Playlist) guessing from the question you might have Playlist selected?

GrimPixel commented 1 month ago

OK. I think the problem is already clear: there is an infinite loop after finishing playing a song. I find your questions off the point, one after another. I don't mind waiting when you look into your code carefully, instead of trying the method of proof by exhaustion on a user.

hasezoey commented 1 month ago

I find your questions off the point, one after another. I don't mind waiting when you look into your code carefully, instead of trying the method of proof by exhaustion on a user.

i am not trying to exhaust, i am just trying to figure out where the problem is as i cannot reproduce it on my side and (in terms of my last comment) trying to be more explicit on where you pushed which button as they have slightly different meaning depending on where pressed (either in the Library or Playlist or somewhere else)

GrimPixel commented 1 month ago

There is no problem switching between “Library” and “Playlist”, as well as adding to and removing from the playlist, except removing the played song.

hasezoey commented 1 month ago

There is no problem switching between “Library” and “Playlist”, as well as adding to and removing from the playlist, except removing the played song.

i dont quite understand what you mean here, i was asking which widget was focused when you pressed L (load, as in the issue title & description), as the meaning is slightly different each time.

except removing the played song.

do you mean similar to #189 or are you expecting a played song be removed from the playlist after having played? (which is currently not the case)