Multiple audio default tracks will play always first track #6845

Closed
opened 2026-02-07 04:12:02 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @enter-a-random-username on GitHub (Mar 25, 2025).

Description of the bug

According to the specs of MKV, all language tracks that aren't special (e.g. commentary) are default for specified language.

https://www.matroska.org/technical/notes.html

Default flag

The “default track” flag is a hint for a Matroska Player indicating that a given track SHOULD be eligible to be automatically selected as the default track for a given language. If no tracks in a given language have the default track flag set, then all tracks in that language are eligible for automatic selection. This can be used to indicate that a track provides “regular service” suitable for users with default settings, as opposed to specialized services, such as commentary, hearing-impaired captions, or descriptive audio.

Unsure if this is a client thing, but based on my observation this happens with Web/JMP and instant play (not using detail view with select in between). So I thought this is default logic from Jellyfin server-side that is applied.
Please move to web, if it is JS and URL building.

File 1

TrackID Track Lang Default
1 video und x
2 audio AA x
3 audio BB x
4 audio commentary AA

My preferred language is BB, but I will get AA

File 2

TrackID Track lang Default
1 video und x
2 audio AA x
3 audio BB
4 audio commentary AA

I will get BB without default flag, that should be set based on MKV specs

Reproduction steps

  1. Create a file like described
  2. Instant playback (so no detail view to select the track). Continue Watching will also play the first audio default track

What is the current bug behavior?

Starting any instant playback e.g. Continue Watching, recently added, from list or Next Up will play the first default track and not preferred language. (No matter the additional flag in settings)

What is the expected correct behavior?

Play my wanted language BB if it has a default flag. Multiple use can have different preferred languages.

Jellyfin Server version

10.10.0+

Specify commit id

No response

Specify unstable release number

No response

Specify version number

No response

Specify the build version

Release (had main/master before new EFCore)

Environment

- OS: arch
- Linux Kernel: 6.14
- Virtualization: -
- Clients: Web or JMP
- Browser: Firefox/Chromium
- FFmpeg Version: 5,6,7 (tried mutliple)
- Playback Method: direct
- Hardware Acceleration: 
- GPU Model:
- Plugins:
- Reverse Proxy: yes
- Base URL:
- Networking:
- Storage:

Jellyfin logs

No error - it is wrong behavior

FFmpeg logs


Client / Browser logs

No response

Relevant screenshots or videos

No response

Additional information

No response

Originally created by @enter-a-random-username on GitHub (Mar 25, 2025). ### Description of the bug According to the specs of MKV, all language tracks that aren't special (e.g. commentary) are default for specified language. https://www.matroska.org/technical/notes.html > Default flag > > The “default track” flag is a hint for a Matroska Player indicating that a given track SHOULD be eligible to be automatically selected as the default track for a given language. If no tracks in a given language have the default track flag set, then all tracks in that language are eligible for automatic selection. This can be used to indicate that a track provides “regular service” suitable for users with default settings, as opposed to specialized services, such as commentary, hearing-impaired captions, or descriptive audio. Unsure if this is a client thing, but based on my observation this happens with Web/JMP and instant play (not using detail view with select in between). So I thought this is default logic from Jellyfin server-side that is applied. _Please move to web, if it is JS and URL building._ ### File 1 | TrackID | Track | Lang | Default | | -------- | ------- | -------- | ------- | | 1 | video | `und` | `x` | | 2 | audio | `AA` | `x` | | 3 | audio | `BB` | `x` | | 4 | audio commentary | `AA` | | My preferred language is `BB`, but I will get AA ### File 2 | TrackID | Track | lang | Default | | -------- | ------- | -------- | ------- | | 1 | video | `und` | `x` | | 2 | audio | `AA` | `x` | | 3 | audio | `BB` | | | 4 | audio commentary | `AA` | | I will get `BB` without default flag, that should be set based on MKV specs ### Reproduction steps 1. Create a file like described 2. Instant playback (so no detail view to select the track). `Continue Watching` will also play the first audio default track ### What is the current _bug_ behavior? Starting any instant playback e.g. `Continue Watching`, `recently added`, from list or `Next Up` will play the first default track and not preferred language. (No matter the additional flag in settings) ### What is the expected _correct_ behavior? Play my wanted language `BB` if it has a default flag. Multiple use can have different preferred languages. ### Jellyfin Server version 10.10.0+ ### Specify commit id _No response_ ### Specify unstable release number _No response_ ### Specify version number _No response_ ### Specify the build version Release (had main/master before new EFCore) ### Environment ```markdown - OS: arch - Linux Kernel: 6.14 - Virtualization: - - Clients: Web or JMP - Browser: Firefox/Chromium - FFmpeg Version: 5,6,7 (tried mutliple) - Playback Method: direct - Hardware Acceleration: - GPU Model: - Plugins: - Reverse Proxy: yes - Base URL: - Networking: - Storage: ``` ### Jellyfin logs ```shell No error - it is wrong behavior ``` ### FFmpeg logs ```shell ``` ### Client / Browser logs _No response_ ### Relevant screenshots or videos _No response_ ### Additional information _No response_
OVERLORD added the bug label 2026-02-07 04:12:02 +03:00
Author
Owner

@nrpeyton commented on GitHub (Mar 26, 2025):

Same issue.

My playback settings are being ignored:

Image

As shown, I have tried manually setting english as my preferred language and also removed the checkbox for Play default audio track regardless of language.

Server: Jellyfin 10.10.5 (Docker)

Player: Both web and jellyfin-media-player

@nrpeyton commented on GitHub (Mar 26, 2025): Same issue. My playback settings are being ignored: ![Image](https://github.com/user-attachments/assets/91e2ec3f-111d-4e1c-b6b9-cbfb56971a25) As shown, I have tried manually setting english as my preferred language and also **removed** the checkbox for `Play default audio track regardless of language`. Server: Jellyfin **10.10.5** (Docker) Player: Both web and jellyfin-media-player
Author
Owner

@timminator commented on GitHub (Mar 30, 2025):

I can also replicate this issue. I tried to investigate it a bit. I'm relatively certain it's a Jellyfin Web problem. JMP also just uses jellyfin web for its interface, so it makes sense that it is happening in both.
The reported AudioStreamIndex by jellyfin server is also correct from what I can see by debugging the server. The retrieved media information by jellyfin web in the network tab also list the correct AudiostreamIndex.
But I was not able to find out what goes wrong afterwards when using "instant play".

@timminator commented on GitHub (Mar 30, 2025): I can also replicate this issue. I tried to investigate it a bit. I'm relatively certain it's a Jellyfin Web problem. JMP also just uses jellyfin web for its interface, so it makes sense that it is happening in both. The reported AudioStreamIndex by jellyfin server is also correct from what I can see by debugging the server. The retrieved media information by jellyfin web in the network tab also list the correct AudiostreamIndex. But I was not able to find out what goes wrong afterwards when using "instant play".
Author
Owner

@enter-a-random-username commented on GitHub (Mar 30, 2025):

I was also unsure, because URL stuff and redirects are complex, and I was unsure if URL is wrongly built, or something is wrong after you click with many transferred information.

If somebody pinpoints the cause, I'm happy if this issue gets moved :)

@enter-a-random-username commented on GitHub (Mar 30, 2025): I was also unsure, because URL stuff and redirects are complex, and I was unsure if URL is wrongly built, or something is wrong after you click with many transferred information. If somebody pinpoints the cause, I'm happy if this issue gets moved :)
Author
Owner

@enter-a-random-username commented on GitHub (Mar 30, 2025):

OK, after some testing I ended up on server side. Also scoring for tracks, but the code seems solid.

Track selected is

           mediaSource.DefaultAudioStreamIndex = streamInfo.AudioStreamIndex;

Set here based on supported track

playlistItem.AudioStreamIndex = audioStream.Index;

I think I'm only at symptom and not at the cause for the issue.

@enter-a-random-username commented on GitHub (Mar 30, 2025): OK, after some testing I ended up on server side. Also scoring for tracks, but the code seems solid. Track selected is ``` mediaSource.DefaultAudioStreamIndex = streamInfo.AudioStreamIndex; ``` Set here based on supported track ``` playlistItem.AudioStreamIndex = audioStream.Index; ``` I think I'm only at symptom and not at the cause for the issue.
Author
Owner

@nrpeyton commented on GitHub (Mar 30, 2025):

OK, after some testing I ended up on server side. Also scoring for tracks, but the code seems solid.

Track selected is

           mediaSource.DefaultAudioStreamIndex = streamInfo.AudioStreamIndex;

Set here based on supported track

playlistItem.AudioStreamIndex = audioStream.Index;

I think I'm only at symptom and not at the cause for the issue.

You're doing solid investigative work which is seriously appreciated. It’s clear you’re closing in on the root cause. Keep digging—you’ve got the right instincts. 💪

@nrpeyton commented on GitHub (Mar 30, 2025): > OK, after some testing I ended up on server side. Also scoring for tracks, but the code seems solid. > > Track selected is > > ``` > mediaSource.DefaultAudioStreamIndex = streamInfo.AudioStreamIndex; > ``` > > Set here based on supported track > > ``` > playlistItem.AudioStreamIndex = audioStream.Index; > ``` > > I think I'm only at symptom and not at the cause for the issue. You're doing solid investigative work which is seriously appreciated. It’s clear you’re closing in on the root cause. Keep digging—you’ve got the right instincts. 💪
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#6845