• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting Wrong audio track selected by default - Jellyfin for Kodi

     
    • 0 Vote(s) - 0 Average

    Wrong audio track selected by default - Jellyfin for Kodi

    Flashwit
    Offline

    Junior Member

    Posts: 3
    Threads: 2
    Joined: 2024 Jun
    Reputation: 0
    Country:Canada
    #1
    2024-12-14, 06:12 PM
    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.
    fezster
    Offline

    Junior Member

    Posts: 9
    Threads: 1
    Joined: 2024 Jan
    Reputation: 1
    Country:United Kingdom
    #2
    2025-02-21, 05:09 PM (This post was last modified: 2025-02-21, 05:10 PM by fezster. Edited 1 time in total.)
    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.
    fezster
    Offline

    Junior Member

    Posts: 9
    Threads: 1
    Joined: 2024 Jan
    Reputation: 1
    Country:United Kingdom
    #3
    2025-02-25, 09:38 PM
    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.
    fezster
    Offline

    Junior Member

    Posts: 9
    Threads: 1
    Joined: 2024 Jan
    Reputation: 1
    Country:United Kingdom
    #4
    2025-02-26, 07:26 PM
    Raised PR: https://github.com/jellyfin/jellyfin-kodi/pull/980. Let's see what the feedback is.
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode