[Redesign] Transcoding configuration improvments - #1612
Conversation
|
@Komodo5197 finally dedicated some time to review PRs again, and then I see this 😁 I've tried to merge the upstream changes in, maybe you can take a look at the critical parts to make sure I didn't mess up anything. I'll get this out for a bit and then report back! |
|
Thanks. Could you give me a quick rundown of when to use getLocalized and when getLocalized2? Should we mark getLocalized2 as deprecated if its use is discouraged? |
|
I actually ripped out the BuildContext version of the method in the home screen PR, leaving just the Applocalization method. You just accidentally reintoduced it in the merge. If you add a new localization method for a class, it should probably take an Applocalization instead of a BuildContext because that's what you can get out of GlobalSnackbar now. |
|
Okay, here are my initial thoughts: The current approach seems to be in line with what mainstream streaming apps are doing, which is probably a good idea. However, I'm not sure if it covers what we're trying to enable (more on that later).
Also, not sure if you've seen it, but there's a thread on Discord with some discussion and UI mockups (the concept is similar to the current state of this PR): https://discord.com/channels/1064474779043770408/1418343238657511495/1436103367255527656 CC @brumik, you might be interested in this discussion too :) |
|
1/2. The just_audio changes should be transparently adjusting things without a queue reload on Android. On other platforms you should still get the existing prompts. The player screen data is basically not implemented yet, so you can ignore what is says there. I'll note my biggest concern with all of this is the back end of actually implementing transcode switching. I don't think the current queue switching is actually a good enough strategy for a lot of these more complex or just-in-time changes to be worthwhile, especially because a lot of them are focused on data saving and queue reloads waste data every time. I was messing around with just_audio and got just-in-time resolving working pretty well on Android, but that still leaves out the other platforms. I think the only properly cross-platform solution is to start routing everything through just_audio's localhost proxy, but that seems to come with a separate can of worms. |
2026-07-01-16-13-29.mp4It's not ideal (I'd highlight the currently-applied profile somehow), but I do think directly customizing the config for the current scenario makes more sense than completely overriding all profiles. As for the format+bitrate profile names, I see no reason not to keep them. I'd defer you to the design mockup in Discord for how it could look. Of course we could hide it, but I don't think offering transparency hurts here. And when it comes to reloading, I guess we could try replacing upcoming tracks in the queue before they are prefetched, by letting the metadata provider look ahead further. That should be a fairly minimal data overhead, and not require an interruption in most cases. |
|
@Komodo5197 since you added a todo for "lots of testing", should we try to get this into the next update to have people test this before the stable release, or would you rather delay it and introduce it after the move to stable? |
|
I wasn't planning for this to get in before stable. There's too much left to do, I still haven't fully decided on what I might want to do for non-android platforms, and I'm busy with the other PR. |
This is an experimental attempt to redo the transcode configuration. It allows multiple transcoding configs to be set up for different scenarios. The currently enabled scenarios are the global config, a toggalable override that disables the autoswitch and could also be added to the player track menu if desired, when on cellular data, and when using the remote url. These scenarios select from a customizable set of transcoding configs with a few presets. If multiple configs apply to a situation, the lowest bitrate one is selected. I'm not sure if this whole customizable config thing is overbuilt, but I think android could have up to 6 different transcode scenarios, so it doesn't seem to crazy.
I have additionally put together some modifications to just_audio to add just-in-time resolvers so that we can choose the actual transcoding config only when buffering begins. This is android-only, although I should be able to also add it to windows/linux if it works out. Android additionally may be able to hot-swap local and remote urls mid song, but I haven't been able to test this, so it might just break playback. Just-in-time url resolution allows android to additionally support autotranscoding FLAC/very high bitrate files, and potentially auto-transcode of incompatible files if we can find a way to get or predict the supported codecs. This is awkward to do on other platforms because the codec info seems to only availible in the mediaStreams, and I don't want to slow down playback start even more with these large additions to the requests, so we don't know the codec until the metadata provider loads it just before playback starts. just_audio changes can be found here.
To support these changes, I've fully refactored network manager service. This PR also includes some of the fixes from #1603 due to how I ended up splitting the branches. In terms of testing, I've done a number of basic spot tests but I don't really have the setup to see how this behaves in the field, so any outside testing would be appreciated, especially of switching between remote and local urls across both direct and transcoded playback.
TODOs: