Jump to content

How to play 5.1 FLAC files in Emby Theater


Recommended Posts

SteveFintel
Posted

I have quite a few audio files (ripped from DVD-A) in FLAC containers that I would like to play in Emby Theater. Emby will play them but only the first two channels (left and right) ignoring center, SR, SR and sub. These files play in 5.1 on Kodi running on the same PC. Can I get Emby Theater to play them correctly?

Posted

Hi there, what version of Emby Theater are you playing with?

SteveFintel
Posted

Emby Theater V3.0.16 on Windows 10 22H1. FYI I see the same behavior on Emby Theater V 2.0.77a on an Amazon FireTV 4K.

SteveFintel
Posted

@Luke FYI, here's what playback of a 5.1 FLAC looks like:image.thumb.jpeg.fc59bf168a651873778ca07818c1edd0.jpeg

SteveFintel
Posted

@Luke BTW, here's the media info report on the same file:

image.png.0288de660a8ccfa9bc4f6aa5353f8213.png

Posted

How have you configured audio settings in the app?

Posted

As a test, if you set the speaker layout to 5.1, does that make a difference?

SteveFintel
Posted

What I'm seeing now is the output from Emby Theater for 5.1 audio matches the speaker configuration. In other words:

  ET Speaker Config ET Outputs...
2.0 source material 2.0, 5.1, 7.1 2.0, 2.0, 2.0
5.1 source material 2.0, 5.1, 7.1 2.1, 5.1, 7.1

 

Posted

So does that produce a better result?

SteveFintel
Posted

It did until I decided to try an upgrade to Windows 11 (I'm having issues with HDR, but that's a separate thread). Under W11, video files wouldn't play at all (spinning icon went on endlessly). After downgrading back to W10, the 5.1 FLAC files indicate whatever the speaker config is set to. Here's the relevant part of the mpv log:

[   0.045][v][lavf] Found 'flac' at score=100 size=2048.
[   0.064][v][lavf] avformat_find_stream_info() finished after 274196 bytes.
[   0.064][v][demux] Detected file format: flac (libavformat)
[   0.064][v][cplayer] Opening done: http://192.168.1.199:8096/emby/Audio/728337/universal?UserId=0582dfc2a16a4479a147226404126931&DeviceId=Media-Room&MaxStreamingBitrate=140000000&TranscodingContainer=ts&TranscodingProtocol=hls&AudioCodec=aac&api_key=37c1a3ced4cb451a8f3cbfc8459603bf&PlaySessionId=1661827662171&StartTimeTicks=0&EnableRedirection=true&EnableRemoteMedia=true
[   0.066][d][global] config path: 'sub' -/-> 'C:\Users\Media Center\AppData\Roaming/mpv/sub'
[   0.066][d][global] config path: 'sub' -/-> 'C:/Users/Media Center/AppData/Roaming/Emby-Theater/system/x64/electron/sub'
[   0.066][d][global] config path: 'sub' -/-> 'C:/Users/Media Center/AppData/Roaming/Emby-Theater/system/x64/electron/mpv/sub'
[   0.066][v][cplayer] Running hook: ytdl_hook/on_preloaded
[   0.066][v][lavf] select track 0
[   0.066][i][cplayer]  (+) Audio --aid=1 (flac 6ch 48000Hz)
[   0.066][i][display-tags] File tags:
[   0.066][i][display-tags]  Artist: Alan Parsons
[   0.066][i][display-tags]  Album: From The New World [DVD]
[   0.066][i][display-tags]  Date: 2022
[   0.066][i][display-tags]  Genre: Progressive Rock
[   0.066][i][display-tags]  Title: Fare Thee Well
[   0.066][i][display-tags]  Track: 1
[   0.066][v][ad] Codec list:
[   0.066][v][ad]     flac - FLAC (Free Lossless Audio Codec)
[   0.066][v][ad] Opening decoder flac
[   0.066][v][ad] Requesting 1 threads for decoding.
[   0.066][v][ad] Selected codec: flac (FLAC (Free Lossless Audio Codec))
[   0.066][v][user_filter_wrapper] Setting option 'graph' = 'pan=5.1|FL=FL|BL=FL|FR=FR|BR=FR|FC<0.5*FL + 0.5*FR' (flags = 0)
[   0.067][v][af] User filter list:
[   0.067][v][af]   lavfi (lavfi.00)
[   0.067][v][cplayer] Starting playback...
[   0.067][v][lavf] queuing seek to 0.000000
[   0.067][v][lavf] execute seek (to 0.000000 flags 32)
[   0.067][v][ffmpeg] stream level seek from 274196 to 1505
[   0.068][d][ffmpeg] tcp: Starting connection attempt to 192.168.1.199 port 8096
[   0.068][v][cplayer] hr-seek, skipping to 0.000000
[   0.097][d][ffmpeg] tcp: Successfully connected to 192.168.1.199 port 8096
[   0.181][v][ffmpeg] stream level seek from 274241 to 1505
[   0.181][d][ffmpeg] tcp: Starting connection attempt to 192.168.1.199 port 8096
[   0.206][d][ffmpeg] tcp: Successfully connected to 192.168.1.199 port 8096
[   0.209][v][lavf] seek done
[   0.232][v][af] [in] 48000Hz 5.1(side) 6ch s32
[   0.232][v][af] [lavfi] 48000Hz 5.1(side) 6ch s32
[   0.232][d][ffmpeg] mpv_src_in0: tb:1/48000 samplefmt:s32 samplerate:48000 chlayout:(null)
[   0.232][d][ffmpeg] Parsed_pan_0: o0 = 1 i0 + 0 i1 + 0 i2 + 0 i3 + 0 i4 + 0 i5
[   0.232][d][ffmpeg] Parsed_pan_0: o1 = 0 i0 + 1 i1 + 0 i2 + 0 i3 + 0 i4 + 0 i5
[   0.232][d][ffmpeg] Parsed_pan_0: o2 = 0.5 i0 + 0.5 i1 + 0 i2 + 0 i3 + 0 i4 + 0 i5
[   0.232][d][ffmpeg] Parsed_pan_0: o3 = 0 i0 + 0 i1 + 0 i2 + 0 i3 + 0 i4 + 0 i5
[   0.232][d][ffmpeg] Parsed_pan_0: o4 = 1 i0 + 0 i1 + 0 i2 + 0 i3 + 0 i4 + 0 i5
[   0.232][d][ffmpeg] Parsed_pan_0: o5 = 0 i0 + 1 i1 + 0 i2 + 0 i3 + 0 i4 + 0 i5
[   0.232][d][lavfi] Filter graph:
[   0.232][d][lavfi]                                                      +--------------+
[   0.232][d][lavfi] mpv_src_in0:default--[48000Hz s32:5.1(side)]--default| Parsed_pan_0 |default--[48000Hz s32:5.1]--mpv_sink_out0:default
[   0.232][d][lavfi]                                                      |    (pan)     |
[   0.232][d][lavfi]                                                      +--------------+
[   0.232][d][lavfi] 
[   0.232][d][lavfi]                                                 +---------------+
[   0.232][d][lavfi] Parsed_pan_0:default--[48000Hz s32:5.1]--default| mpv_sink_out0 |
[   0.232][d][lavfi]                                                 | (abuffersink) |
[   0.232][d][lavfi]                                                 +---------------+
[   0.232][d][lavfi] 
[   0.232][d][lavfi] +-------------+
[   0.232][d][lavfi] | mpv_src_in0 |default--[48000Hz s32:5.1(side)]--Parsed_pan_0:default
[   0.233][d][lavfi] |  (abuffer)  |
[   0.233][d][lavfi] +-------------+
[   0.233][d][lavfi] 
[   0.233][d][lavfi] 
[   0.233][v][af] [userspeed] 48000Hz 5.1 6ch s32
[   0.233][v][af] [userspeed] (disabled)
[   0.233][v][af] [convert] 48000Hz 5.1 6ch s32
[   0.233][v][ao] Trying audio driver 'wasapi'
[   0.233][v][ao/wasapi] requested format: 48000 Hz, 5.1 channels, s32
[   0.233][d][ao/wasapi] Init wasapi
[   0.233][d][ao/wasapi] Find device ''
[   0.234][d][lavf] stream 0: resize index to 128
[   0.236][v][ao/wasapi] No device specified. Selecting default.
[   0.236][v][ao/wasapi] Selecting device '{ad18e0b2-fb5d-4fd2-a97a-cfceb32d67b1}' (HTP-1 (2- Intel(R) Display Audio))
[   0.236][v][ao/wasapi] Monitoring changes in device {0.0.0.00000000}.{ad18e0b2-fb5d-4fd2-a97a-cfceb32d67b1}
[   0.243][d][ao/wasapi] Init wasapi thread
[   0.243][d][ao/wasapi] Activating pAudioClient interface
[   0.244][d][ao/wasapi] Probing formats
[   0.246][v][ao/wasapi] Trying 5.1 s32 (32/32 bits) @ 48000hz (exclusive) -> unsupported
[   0.246][v][ao/wasapi] Trying stereo s32 (32/32 bits) @ 48000hz (exclusive) -> unsupported
[   0.246][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.246][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 44100hz (exclusive) -> ok
[   0.246][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 96000hz (exclusive) -> ok
[   0.246][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 88200hz (exclusive) -> ok
[   0.247][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 192000hz (exclusive) -> ok
[   0.247][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 176400hz (exclusive) -> ok
[   0.247][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 32000hz (exclusive) -> ok
[   0.247][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 22050hz (exclusive) -> unsupported
[   0.247][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 11025hz (exclusive) -> unsupported
[   0.247][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 8000hz (exclusive) -> unsupported
[   0.247][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 16000hz (exclusive) -> unsupported
[   0.248][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 352800hz (exclusive) -> unsupported
[   0.248][v][ao/wasapi] Trying stereo s32 (32/24 bits) @ 384000hz (exclusive) -> unsupported
[   0.248][v][ao/wasapi] Trying 5.1 s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.248][v][ao/wasapi] Trying 7.1 s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.248][v][ao/wasapi] Trying 6.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.248][v][ao/wasapi] Trying mono s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.249][v][ao/wasapi] Trying 2.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.249][v][ao/wasapi] Trying 4.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.249][v][ao/wasapi] Trying 5.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.249][v][ao/wasapi] Trying 3.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.249][v][ao/wasapi] Trying 3.0(back) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.249][v][ao/wasapi] Trying quad s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.249][v][ao/wasapi] Trying quad(side) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.250][v][ao/wasapi] Trying 3.1 s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.250][v][ao/wasapi] Trying 5.0(side) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.250][v][ao/wasapi] Trying 4.1 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.250][v][ao/wasapi] Trying 5.1(side) s32 (32/24 bits) @ 48000hz (exclusive) -> ok
[   0.250][v][ao/wasapi] Trying 6.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.250][v][ao/wasapi] Trying 6.0(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.251][v][ao/wasapi] Trying 6.0(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.251][v][ao/wasapi] Trying 6.1(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.251][v][ao/wasapi] Trying 7.0 s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.251][v][ao/wasapi] Trying 7.0(front) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.251][v][ao/wasapi] Trying 7.1(wide) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.251][v][ao/wasapi] Trying 7.1(wide-side) s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.251][v][ao/wasapi] Trying empty s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.252][v][ao/wasapi] Trying octagonal s32 (32/24 bits) @ 48000hz (exclusive) -> unsupported
[   0.252][v][ao/wasapi] Channel layouts:
[   0.252][v][ao/wasapi]  - stereo
[   0.252][v][ao/wasapi]  - 5.1
[   0.252][v][ao/wasapi]  - 7.1
[   0.252][v][ao/wasapi]  - quad
[   0.252][v][ao/wasapi]  - 3.1
[   0.252][v][ao/wasapi]  - 5.1(side)
[   0.252][v][ao/wasapi] result: 5.1
[   0.252][v][ao/wasapi] Accepted as 5.1 s32 @ 48000hz -> 5.1 s32 (32/24 bits) @ 48000hz (exclusive)
[   0.252][d][ao/wasapi] Fixing format
[   0.252][d][ao/wasapi] IAudioClient::GetDevicePeriod
[   0.252][v][ao/wasapi] Device period: 10 ms
[   0.252][d][ao/wasapi] IAudioClient::Initialize
[   0.274][d][ao/wasapi] IAudioClient::Initialize pRenderClient
[   0.274][d][ao/wasapi] IAudioClient::Initialize IAudioClient_SetEventHandle
[   0.274][d][ao/wasapi] IAudioClient::Initialize IAudioClient_GetBufferSize
[   0.274][v][ao/wasapi] Buffer frame count: 480 (10 ms)
[   0.274][v][ao/wasapi] IAudioClock::GetFrequency gave a frequency of 48000.
[   0.276][d][ao/wasapi] Activating pEndpointVolume interface
[   0.276][d][ao/wasapi] IAudioEndpointVolume::QueryHardwareSupport
[   0.276][d][ao/wasapi] Entering dispatch loop
[   0.276][d][ao/wasapi] Init wasapi done
[   0.276][v][ao/wasapi] device buffer: 480 samples.
[   0.276][v][ao/wasapi] using soft-buffer of 9600 samples.
[   0.276][i][cplayer] AO: [wasapi] 48000Hz 5.1 6ch s32
[   0.276][v][cplayer] AO: Description: Windows WASAPI audio output (event mode)
[   0.276][v][af] [convert] (disabled)
[   0.277][v][af] [out] 48000Hz 5.1 6ch s32
[   0.277][v][cplayer] audio ready
[   0.277][v][cplayer] starting audio playback
[   0.277][d][ao/wasapi] Thread Resume
[   0.277][d][ao/wasapi] Thread Reset
[   0.277][v][cplayer] playback restart complete @ 0.000000, audio=playing, video=eof
[   5.673][d][lavf] stream 0: resize index to 256
[   5.798][d][libmpv_render] flushing shader cache
[   5.798][d][main] Exiting...
[   5.798][d][cplayer] Run command: quit, flags=64, args=[code="0"]
[   5.798][v][cplayer] EOF code: 5  

 

Posted

So by setting it to 5.1 you're getting the sound that you want?

SteveFintel
Posted (edited)

Not consistently. I've used two test files - both encoded using the same process. The log file indicates both have 6 channel (5.1) content. One usually only plays in stereo, the other consistently plays in 5.1. I'm totally stumped.

The system is 7.2.4 Atmos capable. What do you suggest the Windows audio driver be set to for output configuration?

Edited by SteveFintel
Posted
Quote

What do you suggest the Windows audio driver be set to for output configuration?

Well I would just make sure your windows speaker setup is set correctly. I do see one area of improvement we can make in the way we configure mpv when your setting is 7.1. Essentially we're currently telling mpv that you support 7.1 and stereo, when it should be 7.1, 5.1 and stereo.

But when you configure mpv to 5.1, I would expect that to work, barring an issue with the source file of course.

SteveFintel
Posted

I agree that telling mpv that the 'degraded' formats are also supported would help. I've tried an mpv.conf file that includes audio-channels=6, but I can't tell if that's overridden by the option selected in Emby Theater.

SteveFintel
Posted

Great idea, but it didn't help. The one file that reliably indicated 5.1 on playback now doesn't anymore. Any other ideas?

  • 3 weeks later...
SteveFintel
Posted

It's inconsistent. I haven't been able to create a set of reproducible conditions that causes it to work (or fail) every time. FYI, Emby Theater for Android on a Fire HD 4K works every time.

Posted (edited)

I'm not able to test that.

@SteveFintel set your windows audio to 7.1 and also in Theater. Make sure upmix is disabled. Disable any audio settings in your mpv.conf. Play one file that has the issue, just once, and attach the complete mpv log file.

From your earlier log excerpt, this is the upmix. This shouldn't be happening. mpv will apply the upmix to audio that it decodes. @Luke you may want to revise your code in Theater, and make sure upmix doesn't interact with audio from non-music related files.

[   0.066][v][user_filter_wrapper] Setting option 'graph' = 'pan=5.1|FL=FL|BL=FL|FR=FR|BR=FR|FC<0.5*FL + 0.5*FR' (flags = 0)
[   0.067][v][af] User filter list:
[   0.067][v][af]   lavfi (lavfi.00)
[   0.067][v][cplayer] Starting playback...
[   0.067][v][lavf] queuing seek to 0.000000
[   0.067][v][lavf] execute seek (to 0.000000 flags 32)
[   0.067][v][ffmpeg] stream level seek from 274196 to 1505
[   0.068][d][ffmpeg] tcp: Starting connection attempt to 192.168.1.199 port 8096
[   0.068][v][cplayer] hr-seek, skipping to 0.000000
[   0.097][d][ffmpeg] tcp: Successfully connected to 192.168.1.199 port 8096
[   0.181][v][ffmpeg] stream level seek from 274241 to 1505
[   0.181][d][ffmpeg] tcp: Starting connection attempt to 192.168.1.199 port 8096
[   0.206][d][ffmpeg] tcp: Successfully connected to 192.168.1.199 port 8096
[   0.209][v][lavf] seek done
[   0.232][v][af] [in] 48000Hz 5.1(side) 6ch s32
[   0.232][v][af] [lavfi] 48000Hz 5.1(side) 6ch s32
[   0.232][d][ffmpeg] mpv_src_in0: tb:1/48000 samplefmt:s32 samplerate:48000 chlayout:(null)
[   0.232][d][ffmpeg] Parsed_pan_0: o0 = 1 i0 + 0 i1 + 0 i2 + 0 i3 + 0 i4 + 0 i5
[   0.232][d][ffmpeg] Parsed_pan_0: o1 = 0 i0 + 1 i1 + 0 i2 + 0 i3 + 0 i4 + 0 i5
[   0.232][d][ffmpeg] Parsed_pan_0: o2 = 0.5 i0 + 0.5 i1 + 0 i2 + 0 i3 + 0 i4 + 0 i5
[   0.232][d][ffmpeg] Parsed_pan_0: o3 = 0 i0 + 0 i1 + 0 i2 + 0 i3 + 0 i4 + 0 i5
[   0.232][d][ffmpeg] Parsed_pan_0: o4 = 1 i0 + 0 i1 + 0 i2 + 0 i3 + 0 i4 + 0 i5
[   0.232][d][ffmpeg] Parsed_pan_0: o5 = 0 i0 + 1 i1 + 0 i2 + 0 i3 + 0 i4 + 0 i5
[   0.232][d][lavfi] Filter graph:
[   0.232][d][lavfi]                                                      +--------------+
[   0.232][d][lavfi] mpv_src_in0:default--[48000Hz s32:5.1(side)]--default| Parsed_pan_0 |default--[48000Hz s32:5.1]--mpv_sink_out0:default
[   0.232][d][lavfi]                                                      |    (pan)     |
[   0.232][d][lavfi]                                                      +--------------+
[   0.232][d][lavfi] 
[   0.232][d][lavfi]                                                 +---------------+
[   0.232][d][lavfi] Parsed_pan_0:default--[48000Hz s32:5.1]--default| mpv_sink_out0 |
[   0.232][d][lavfi]                                                 | (abuffersink) |
[   0.232][d][lavfi]                                                 +---------------+
[   0.232][d][lavfi] 
[   0.232][d][lavfi] +-------------+
[   0.232][d][lavfi] | mpv_src_in0 |default--[48000Hz s32:5.1(side)]--Parsed_pan_0:default
[   0.233][d][lavfi] |  (abuffer)  |
[   0.233][d][lavfi] +-------------+

 

Edited by generiq
  • 1 month later...
Posted

@SteveFintel @generiq

Are you still having an issue with this?

If so, can you try the latest testing build and let us know how that compares?

It has an updated mpv. Thanks !

SteveFintel
Posted (edited)

It's been mysteriously working flawlessly for the last month. I'll try it anyway and see if there are any regressions.

Installing this means unzipping to C:\Users\[User]\AppData\Roaming\Emby-Theater\system ?

What version number should I see?

Edited by SteveFintel
SteveFintel
Posted

This was a big regression on my theater system for me. Audio (5.1 and 2.0) played fine, but video was always a black screen (the overlays showed, but content did not). It didn't matter if I was playing .TS, .mkv or .mp4 files. I heard the audio tracks but no video.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...