natumbri / mopidy-youtube

Mopidy extension for playing music from YouTube
Apache License 2.0
255 stars 75 forks source link

variable bitrates confusing my legacy amplifier #231

Open eiland-asbl opened 1 year ago

eiland-asbl commented 1 year ago

okay, its really my problem, but i have a legacy amplifier, a TX-8050 , and it has a hard time when i switch between youtube items, the first one is played fine, but then, when i switch to another one, it gets really confused to the bitrate (i assume) and starts playing super warped (slow).

i tried forcing mopidy and icecast2 to resample, but to no avail.

is there a away that mopidy-youtube could send out less confusing audio, for my poor old amp?

natumbri commented 1 year ago

Interesting issue, and not something that I've ever come across. I also use an older amplifier (NAD T754). I feed an analog signal generated by an external DAC. My amp doesn't have a USB input, but I have previously had success feeding it a digital signal by SPDIF.

Perhaps you could try limiting the formats that mopidy-youtube uses?

In youtube.py at around line 415 is the code that sets the parameters passed to get the youtube url:

                ytdl_options = {
                    "format": "bestaudio/ogg/mp3/m4a/best",
                    "proxy": self.proxy,
                    "cachedir": False,
                    "nopart": True,
                    "retries": 10,
                }

You could try changing the format line to something like "format": "mp3", to limit it to mp3 only, and see if that helps?

eiland-asbl commented 1 year ago

i turned it into "format": "mp3", but then it triggers errors :(

DEBUG    2022-07-15 19:46:19,322 [3479268:YouTubeBackend-2] mopidy_youtube
  youtube PlaybackProvider.translate_uri "youtube:video:yTrH0nQQZ84"
[youtube] yTrH0nQQZ84: Downloading webpage
[youtube] yTrH0nQQZ84: Downloading player dfd2e197
ERROR: requested format not available
ERROR    2022-07-15 19:46:20,298 [3479268:YouTubeCoreListener-9] mopidy_youtube
  audio_url error ERROR: requested format not available (videoId: yTrH0nQQZ84)
DEBUG    2022-07-15 19:46:20,298 [3479268:YouTubeBackend-2] mopidy.backend
  Backend translated URI from youtube:video:yTrH0nQQZ84 to None
WARNING  2022-07-15 19:46:20,299 [3479268:Core-7] mopidy.core.tracklist
  Track is not playable: youtube:video:yTrH0nQQZ84
DEBUG    2022-07-15 19:46:20,299 [3479268:Audio-1] mopidy.audio.gst
  Changing state to GST_STATE_READY: result=GST_STATE_CHANGE_SUCCESS
DEBUG    2022-07-15 19:46:20,300 [3479268:YouTubeBackend-2] mopidy_youtube

oh and did i mention that with the original setup my computer has no problem playing the audio decently?