manuel-rw / jellyfin-discord-music-bot

A simple and leightweight Discord Bot, that integrates with your Jellyfin Media server and enables you to listen to your favourite music directly from discord.
MIT License
75 stars 9 forks source link

Music stream lagging every now and then #260

Open sssionek opened 10 months ago

sssionek commented 10 months ago

Describe the bug Haven't encountered it myself yet, but my friends reported many times that the bot has a tendency to stream quite choppily every now and then with ~1s breaks during streaming (suggesting buffering issues? - kinda weird, given that both Jellyfin and the bot run on the same machine).

To Reproduce Steps to reproduce the behavior:

  1. Run the bot from the docker image
  2. Play music
  3. ???
  4. Stream starts to get choppy

Expected behavior Music is streamed without interruptions.

Additional context Not much info as I don't know much about this bug yet, mainly writing it down to not forget - I'll expand this issue as we'll learn more.

manuel-rw commented 3 months ago

Hi @sssionek , has this been resolved?

Corban-Lee commented 1 month ago

I'm also experiencing choppy behaviour consistently, it's impossible to get a smooth track from start to finish. Listening through the Jellyfin web interface and it's clear as day,

I'm unsure if this log is relevant to the issue, but this occurred during playback of some tracks via the bot: [Nest] 28 - 08/02/2024, 6:52:39 PM WARN [DiscordVoiceService] Current resource is is not playable. This means playback will get stuck. Please report this issue. [Nest] 28 - 08/02/2024, 6:52:39 PM WARN [DiscordVoiceService] Current resource is is not playable. This means playback will get stuck. Please report this issue.

manuel-rw commented 1 month ago

@Corban-Lee can you post your hardware specs? Is it running over WLAN / wired? What is the latency to Discord and to Jellyfin?

Corban-Lee commented 1 month ago

Sure thing

CPU: Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz Integrated GPU: Intel Corporation CoffeeLake-S GT2 [UHD Graphics 630] RAM: 2x - CT16G4DFRA266.M16FR (16GB) (2666MHz) [32GB total] Motherboard: PRIME H310M-R R2.0 OS: Ubuntu 22.04.4 LTS

Running the container in docker using the wiki instructions.

Both services (jellyfin & jellyfin-discord-music-bot) are running on the same machine, and my JELLYFIN_SERVER_ADDRESS env var set to the server ip:port for jellyfin http://192.168.0.XX:XXXX.

Latency from the host to https://discord.com/api: DNS Lookup: 0.013779 Connect: 0.029197 Start Transfer: 0.250888 Total: 0.253467

manuel-rw commented 1 month ago

Thank you. That setup really looks like it isn't causing the hickups. Is the Discord server set to the same region as you're in / hosting the bot? How is your bandwith? High CPU usage during streaming? Do you run of slow SSDs or HDDs?

Corban-Lee commented 1 month ago

Server region override is set to automatic, I don't see an option for my region of Europe or UK.

Perplexingly, after just testing again, I'm no longer hearing gaps in the audio playback through the Bot.

I'm unable to confirm whether this was an issue with jellyfin, my hardware usage or this software.

Details (unsure of specifics): Host OS is running on an SSD Media is being served from 7200RPM HDD My music is stored as high quality flac files. No evident CPU spikes during playback, low usage all around.

I'm not sure I need to continue here if the problem has suddenly disappeared without an apparent reason, but thanks for the hasty support!