sentriz / gonic

music streaming server / free-software subsonic server API implementation
ircs://irc.libera.chat/#gonic
GNU General Public License v3.0
1.5k stars 105 forks source link

Respect Client's maxBitRate query param stream request #403

Closed OpenSrcerer closed 8 months ago

OpenSrcerer commented 8 months ago

Context

gonic version: v0.16.0 client: symfonium if from docker, docker tag: 257089075b20

Issue

I was having a confusing time understand why my Symfonium client was using so much data, and in the process I found out that Gonic does not respect the maxBitRate setting of the client upon a stream request.

In #244 you state:

I think hopefully that shouldn't happen. gonic will skip a transcoded if the source bitrate is less than the requested bitrate the client requests a maxBitrate higher than the source nitrate the client requests to not transcode

However, right now the behavior seems to be that the maxBitRate param is completely ignored, and the only setting that is respected is the "transcoding device settings" override that you set in the control panel.

I think respecting the param is a good thing to have because it allows users to select different bitrates client-side depending on factors such as WiFi connection status, or (come up with some creative idea here).

sentriz commented 8 months ago

hi it does respect it, you just need to enable transcoding on the gonic web interface

OpenSrcerer commented 8 months ago

Hi @sentriz thanks for the reply! Perhaps I'm confused, but you do mean this, right?

image

Wouldn't this force the client to use opus @ the bitrate you've provided on the wiki, so 96kb/s?

sentriz commented 8 months ago

without a maxbitrate yes it will default to 96kbps, however if the client instead says maxBitRate 50kbps, then it will be opus @ 50kbps

but it must be lower than the profile

so you could instead set the profile to opus 192, then the client can request anywhere from 0 to 192

if that makes sense :eyes:

in future i want clients to be able to pick their own profile too - but this will need an extension to the subsonic api

OpenSrcerer commented 8 months ago

Okay makes sense! Thanks for the explanation.

I'm not super well-versed in the new OpenSubsonic impl to really understand the reasons behind your necessity for the extensions, since the maxBitRate param already exists. However, Opus@192 & less is perfect for my usage so I'll call this issue closed on my end.