![]() |
Wrong audio track selected by default - Jellyfin for Kodi - Printable Version +- Jellyfin Forum (https://forum.jellyfin.org) +-- Forum: Support (https://forum.jellyfin.org/f-support) +--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting) +--- Thread: Wrong audio track selected by default - Jellyfin for Kodi (/t-wrong-audio-track-selected-by-default-jellyfin-for-kodi) |
Wrong audio track selected by default - Jellyfin for Kodi - Flashwit - 2024-12-14 I'm basically trying to figure out whether to hunt this down in Kodi, J4K, or Jellyfin itself. Jellyfin 10.10.3, latest releases of Kodi Omega and the J4K plugin. A test file for this was Downton Abbey (2019) which has Dolby Vision and 3 audio tracks. The first audio track (TrueHD + Atmos 7.1) is also set as the default. 2nd track is AC-3 5.1 3rd track is AC-3 2 channel commentary track If I open it in the web interface the TrueHD track is selected and plays by default. If I play it in Kodi using Jellycon the TrueHD track plays by default. Yet, if I play it in Kodi using Jellyfin for Kodi, the commentary track plays by default. I can change it and click 'set as default' as many times as I want, it will always start the commentary track when I play it with J4K. I have extracted some relevant logs. This is logging when I tried with J4K https://pastebin.com/XDU1GYxH I can see that when it plays on line 28 it's setting AudioStreamIndex to '3' which is the correct index for the TrueHD track. I'm not sure how to interpret the stuff after that but the audio stream just seems to die for no reason. It then loads the subtitles and out of nowhere it's loading up the stereo commentary track (ac-3). Line 103-104 is where I manually switched it to the TrueHD track which it seems to load with no problem. I don't see any clear issue here. For comparison I looked at the log for Jellycon as well. https://pastebin.com/uCMYVVbW In this case you can see it immediately sees it as TrueHD on line 15 and no problems occur after that. I didn't see anything relevant in the Jellyfin server logs. RE: Wrong audio track selected by default - Jellyfin for Kodi - fezster - 2025-02-21 I'm seeing the same problem on Fire Stick (using Jellyfin for Kodi Omega v21.2). However, the correct audio track is used in LibreElec (same kodi version - LibreElec 12, Kodi 21.2). Both are using J4K in AddOn mode. The fire stick always chooses the 5.1 track, rather than the 7.1 HD Audio Track. RE: Wrong audio track selected by default - Jellyfin for Kodi - fezster - 2025-02-25 I worked out what's causing this. It's a race condition in player.py. If report_playback() -> detect_audio_subs() is called first, the current audio track is defaulted and this is then stored. Later, set_audio_subs() is called and this same audio track is applied. This is what should happen and, I guess, is expected to happen. On the FireStick, though, this never happens. The set_audio_subs() is called first - which means the DefaultAudioStreamIndex returned by Jellyfin is used. The logic is then not applied correctly and the wrong audio track is applied. Later, report_playback is called, but by then the audio track has already been set incorrectly and so it never corrects itself. I think it can be written to avoid the race condition. Will open an issue and see if those who wrote it have more thoughts on why it was done like this. RE: Wrong audio track selected by default - Jellyfin for Kodi - fezster - 2025-02-26 Raised PR: https://github.com/jellyfin/jellyfin-kodi/pull/980. Let's see what the feedback is. |