jeffvli / sonixd

A full-featured Subsonic/Jellyfin compatible desktop music player
GNU General Public License v3.0
1.85k stars 74 forks source link

Add configurable playback/transcode settings #108

Open Maxplosion opened 2 years ago

Maxplosion commented 2 years ago

Is your feature request related to a problem? Please describe. Currently all songs that are played are transcoded, there is no way to set direct play as preferred setting.

Describe the solution you'd like A setting to force direct play, so unnecessary transcoding can be avoided and source quality is not altered.

jeffvli commented 2 years ago

Just an fyi, you can disable transcoding from your user settings in Jellyfin: image

Maxplosion commented 2 years ago

yes that is a possibility but that would be global so I assume that would also stop transcoding when I use a mobile app, which would kill my data in a short time when I'm streaming lossless music. Another option would be to use a separate user, but that in turn would mean loosing the last played/most played,.. info which would also not be ideal as you have added the "play count" column to the gui that I really like and value

jeffvli commented 2 years ago

Valid points! Just wanted to add a notice here as a temporary measure until I get this implemented!

jeffvli commented 2 years ago

Looking at the Jellyfin API docs for UniversalAudio, I'm not quite sure there's a way to force transcoding off besides what is already implemented. There's an optional parameter for transcodingProtocol which I'm assuming forces transcoding but I'm not quite able to get that to work.

Testing the current stream url being played on my end shows that it's already Direct Playing, so I'm not sure what's going on there.

Maxplosion commented 2 years ago

Thank you for taking a closer look at the issue! I added some logs here, maybe they help you in narrowing it down at least some

https://pastebin.com/tZQMPP7p https://pastebin.com/9WPbAXmu

In the log from the first link (general .log file from jellyfin) it shows "direct play" at the beginning, but then it says:

Profile: "Unknown Profile", No audio direct play profiles found for "/path/haircuts for men/haircuts for men - 理髪店 Beat 1995-1999/10 - ゲストハウス (hfm barber chop edit).flac" with codec "flac"

And there is transcoding (flac > aac) going on when you look at the second link where I added the transcoding log file.

(oh and thanks for the new themes, I like the spotify-like one!)

jeffvli commented 2 years ago

Thanks for that info. I took a look at jellyfin-vue's implementation and they don't use UniversalAudio, but rather the regular Audio stream which supports a static parameter which forces transcoding on/off. I changed my implemention to theirs and pushed a dev build here (download one from 2021-12-07) if you could test it and report back if transcoding still occurs. I left the static parameter out of the audio endpoint to first test to see if transcoding still occurs for you.

Edit: I'm just going to add the static parameter since there's some issues with the audio stream on some formats (m4a).

Maxplosion commented 2 years ago

Hi Thanks!, I've just tried it with this version: Sonixd(dev)_2021-12-07T10 29 108a64f51ba4ae8d8e2885e85cf928c6c0a2983d36.exe and sadly still have transcoding of FLAC as well as MP3 files.

jeffvli commented 2 years ago

I just pushed a new build with the static parameter set to true. Can you try that?

Maxplosion commented 2 years ago

yes that's it, no transcoding now!

jeffvli commented 2 years ago

Great! I'll push that change first since I still need some time to figure out how to add additional streaming configuration.

Maxplosion commented 2 years ago

Sounds good, thanks for fixing this, it was the one thing that was missing for me :)