Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TODO list for release 0.5.11 #1785

Open
3 of 6 tasks
gechoto opened this issue Jan 1, 2025 · 5 comments
Open
3 of 6 tasks

TODO list for release 0.5.11 #1785

gechoto opened this issue Jan 1, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@gechoto
Copy link
Contributor

gechoto commented Jan 1, 2025

This is meant for DEVELOPERS ONLY who want to help or discuss the current problems.

Urgent:

A possible fix to make such metadata consistent might be to make two requests to the player endpoint:

  • One for metadata with the WEB_REMIX client (the $fields parameter could be used)
  • Another one for the streams with the WEB_CREATOR or IOS client

Nice to have:

@th3y
Copy link

th3y commented Jan 2, 2025

About loudnessDb, will be better to set it from adaptiveFormats when audioConfig its missing
val loudness = body.playerConfig?.audioConfig?.normalizedLoudnessDb
?: format.loudnessDb?.toFloat()

@gechoto
Copy link
Contributor Author

gechoto commented Jan 2, 2025

About loudnessDb, will be better to set it from adaptiveFormats when audioConfig its missing val loudness = body.playerConfig?.audioConfig?.normalizedLoudnessDb ?: format.loudnessDb?.toFloat()

@th3y while this will get you some value for loudnessDb it is not a consistent one.
For example with the same song and same format you can get these responses:

  • WEB_REMIX: loudnessDb = -4.00
  • IOS: loudnessDb = 2.00

Different clients can have different normalization targets which means the volume will be different depending on which client is used. This will not be a great user experience since users can get mixed volume targets and this defeats the purpose of normalization.

The only one of the current clients (the recent ones from my PR) which seems to provide the values as before is the WEB_REMIX one (which is the only YT Music one - the others are normal YT which has a different volume target).
So I guess the simplest fix would be to always use WEB_REMIX for metadata and the others only for the streams.

Also WEB_REMIX is the only client which provides premium formats. For these reasons I think the best fix (for both U-3 & N-1) might look like this:

  1. Make player request with WEB_REMIX and use metadata like loudnessDb from this response
  2. Try to play the best stream from that first request (because this can contain premium streams)
  3. If the stream url returns 403 fallback to other clients for the streams (but still keep using the metadata from the first request with WEB_REMIX)

But for this to work there needs to be a way to detect if an url returns 403.
@javdc had the idea to "do a HTTP HEAD request before returning the url to the player to see if it responds with a 200 or not"
Idk if and for how long that would work.

An alternative which does not need 403 tests for now might look like this:

// make WEB_REMIX request - save metadata like loudnessDb from this one
if (user.isLoggedIn) {
    if (user.hasPremium) {
        // use streams from above WEB_REMIX request
    } else {
        // make another request with WEB_CREATOR and use these streams
    }
}
// make IOS request and use these streams

But this could also break any moment so it might be better to do 403 tests somehow.

If we only talk about loudnessDb for now:
Another idea is to use the playerConfig.audioConfig.perceptualLoudnessDb because that seems to be the same across clients. But it provides different values again and users will end up with different volumes compared to the songs they played before. Maybe there can be something added to convert between loudnessDb <> perceptualLoudnessDb but I don't know if that is possible because of the way they are calculated.

@finn-524
Copy link

finn-524 commented Jan 3, 2025

Is this app going to be updated because it's my lifeline I'm to committed to it to switch

@gechoto
Copy link
Contributor Author

gechoto commented Jan 4, 2025

Is this app going to be updated

@finn-524 Nobody knows. Maybe it is dead.
(I should have named this issue differently to not create false hope for a new release.)

Currently we have to wait for @z-huang to become active again. Could be tomorrow. Could be in years. Could be never.

Please do not ask about when or if there will be a new release here. This specific issue was meant for developers to discuss solutions to the problems only.

@gechoto
Copy link
Contributor Author

gechoto commented Jan 5, 2025

Good news: U-3, N-1 and N-3 are done: #1789

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants