Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PulseAudio: Implement DTS-HD and TrueHD #16693

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fritsch
Copy link
Member

@fritsch fritsch commented Oct 1, 2019

With Pulseaudio 13, support for DTS-HD and TrueHD IEC was added. Sadly there was barely any documentation on how to use it.

Make sure to add the formats to your sink (check its number with pactl list sinks, in my case it's 0):

pactl set-sink-formats 0 "pcm; ac3-iec61937; dts-iec61937; eac3-iec61937; truehd-iec61937; dtshd-iec61937"

If you want to test, please start pulseaudio with -vvv as arguments and provide a link to your kodi debuglog. Thanks much.

@fritsch
Copy link
Member Author

fritsch commented Oct 1, 2019

D: [pulseaudio] sink-input.c: Negotiated format: dtshd-iec61937, format.sample_format = "\"s16le\""  format.channels = "8"  format.rate = "192000"
I: [pulseaudio] sink-input.c: Trying to change sample spec
D: [pulseaudio] sink.c: Suspending sink alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1 due to changing format, desired format = s16le rate = 192000
I: [alsa-sink-HDMI 1] alsa-sink.c: Device suspended...
D: [pulseaudio] sink.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1: suspend_cause: (none) -> INTERNAL
D: [pulseaudio] sink.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1: state: IDLE -> SUSPENDED
D: [pulseaudio] source.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1.monitor: suspend_cause: (none) -> INTERNAL
D: [pulseaudio] source.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1.monitor: state: IDLE -> SUSPENDED
I: [pulseaudio] sink.c: Reconfigured successfully
I: [alsa-sink-HDMI 1] alsa-sink.c: Trying resume...
I: [alsa-sink-HDMI 1] alsa-util.c: Trying to disable ALSA period wakeups, using timers only
D: [alsa-sink-HDMI 1] alsa-util.c: Maximum hw buffer size is 85 ms
D: [alsa-sink-HDMI 1] alsa-util.c: Set buffer size first (to 16384 samples), period size second (to 8192 samples).
I: [alsa-sink-HDMI 1] alsa-util.c: ALSA period wakeups disabled
D: [alsa-sink-HDMI 1] alsa-sink.c: hwbuf_unused=0
D: [alsa-sink-HDMI 1] alsa-sink.c: setting avail_min=15502
I: [alsa-sink-HDMI 1] alsa-sink.c: Time scheduling watermark is 4,60ms
I: [alsa-sink-HDMI 1] alsa-sink.c: Resumed successfully...
D: [pulseaudio] sink.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1: suspend_cause: INTERNAL -> (none)
D: [pulseaudio] sink.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1: state: SUSPENDED -> IDLE
D: [pulseaudio] module-suspend-on-idle.c: Sink alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1 becomes idle, timeout in 5 seconds.
D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
I: [alsa-sink-HDMI 1] alsa-sink.c: Starting playback.
D: [pulseaudio] source.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1.monitor: suspend_cause: INTERNAL -> (none)
D: [pulseaudio] source.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1.monitor: state: SUSPENDED -> IDLE
D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
D: [pulseaudio] sink-input.c: Could not update sink sample spec to match passthrough stream
D: [pulseaudio] module-udev-detect.c: /dev/snd/controlC0 is accessible: yes
D: [pulseaudio] module-udev-detect.c: Resuming all sinks and sources of card alsa_card.pci-0000_00_1f.3.
I: [pulseaudio] client.c: Freed 17 "Kodi"
I: [pulseaudio] protocol-native.c: Connection died.

@fritsch
Copy link
Member Author

fritsch commented Oct 1, 2019

@tanuk @ford-prefect Any idea how these new formats should be probed and work?

@ford-prefect
Copy link

ford-prefect commented Oct 2, 2019

Hey @fritsch! Unfortunately, I missed landing a bunch of requried changes before announcing DTS-HD/Dolby TrueHD support. The required work is here -- https://gitlab.freedesktop.org/pulseaudio/pulseaudio/merge_requests/24

I also missed adding that to pavucontrol for an easier way to enable it, so quite poor showing all around, sorry about that.

@DaVukovic DaVukovic added Component: Audio Type: Improvement non-breaking change which improves existing functionality v19 Matrix labels Oct 2, 2019
@fritsch
Copy link
Member Author

fritsch commented Oct 2, 2019

Thanks much @ford-prefect - we are in no hurry here as next major Ubuntu will ship 13.0 only. Do you plan to add those fixed to 13.1?

I would then change the patchset to only enable it for 13,1,0

Codewise it's okay? So nothing fancy, just: 192 khz + 16bit + 8 channels + HD-Format?

One thing to add: Modern AVRs don't consume DTS-HD HR anymore with 8 channels 192 khz, for those we changed our IEC encoder to also send 2 channels / 192 khz, while DTS-HD MA will still be sent as 8/192 khz.

Is that something PA might also need to do?

@fritsch fritsch force-pushed the pulse13 branch 2 times, most recently from cf9929e to 2803c5c Compare October 2, 2019 07:26
@fritsch
Copy link
Member Author

fritsch commented Oct 2, 2019

Patch for PA and DTS-HD HR (Updated!):

From a3d97abd14ce92f6b7ea6a5eb994b9408038e595 Mon Sep 17 00:00:00 2001
From: fritsch <Peter.Fruehberger@gmail.com>
Date: Wed, 2 Oct 2019 09:48:53 +0200
Subject: [PATCH 01/15] Formats: Add support for DTS-HD HR (High Resolution)
 Audio

Modern AVRs don't accepts DTS-HD HR when encapsulated in a 192 khz / 8
bandwidth stream. Therefore send this format as 192 khz / 2.
---
 src/pulse/format.c | 1 +
 src/pulse/format.h | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/src/pulse/format.c b/src/pulse/format.c
index 2e90821b9..175199991 100644
--- a/src/pulse/format.c
+++ b/src/pulse/format.c
@@ -49,6 +49,7 @@ static const char* const _encoding_str_table[]= {
     [PA_ENCODING_MPEG2_AAC_IEC61937] = "mpeg2-aac-iec61937",
     [PA_ENCODING_TRUEHD_IEC61937] = "truehd-iec61937",
     [PA_ENCODING_DTSHD_IEC61937] = "dtshd-iec61937",
+    [PA_ENCODING_DTSHD_HR_IEC61937] = "dtshdhr-iec61937",
     [PA_ENCODING_ANY] = "any",
 };
 
diff --git a/src/pulse/format.h b/src/pulse/format.h
index 82a8be7ba..652c7ce88 100644
--- a/src/pulse/format.h
+++ b/src/pulse/format.h
@@ -62,6 +62,9 @@ typedef enum pa_encoding {
     PA_ENCODING_DTSHD_IEC61937,
     /**< DTS-HD Master Audio encapsulated in IEC 61937 header/padding. \since 13.0 */
 
+    PA_ENCODING_DTSHD_HR_IEC61937,
+    /**< DTS-HD HR (High Resolution) Audio encapsulated in IEC 61937 header/padding. \since 13.1 */
+
     PA_ENCODING_MAX,
     /**< Valid encoding types must be less than this value */
 
@@ -79,6 +82,7 @@ typedef enum pa_encoding {
 #define PA_ENCODING_MPEG2_AAC_IEC61937 PA_ENCODING_MPEG2_AAC_IEC61937
 #define PA_ENCODING_TRUEHD_IEC61937 PA_ENCODING_TRUEHD_IEC61937
 #define PA_ENCODING_DTSHD_IEC61937 PA_ENCODING_DTSHD_IEC61937
+#define PA_ENCODING_DTSHD_HR_IEC61937 PA_ENCODING_DTSHD_HR_IEC61937
 #define PA_ENCODING_MAX PA_ENCODING_MAX
 #define PA_ENCODING_INVALID PA_ENCODING_INVALID
 /** \endcond */
-- 
2.20.1

@fritsch
Copy link
Member Author

fritsch commented Oct 2, 2019

Update:
I took @ford-prefect patches and additionally added mine on top to distinguish between DTSHD and DTSHD-HR.

TrueHD: Multi-Channel opens including noise
DTS-HD-MA: Multi-Channel opens including noise
DTS-HD-HR: Properly opens 2 channel / 192 khz and dts-hd-hr

As I am not sure at all if my laptop's HDMI connection actually supports DTS-HD-MA / TrueHD - I keep it as is for now :-)

Await @MilhouseVH tests

@fritsch
Copy link
Member Author

fritsch commented Oct 2, 2019

DTSHD Log, looks quite okay I'd say (though, only noise on my system)

Okt 02 13:48:38 L380 pulseaudio[7421]: D: [pulseaudio] sink-input.c: Negotiated format: dtshd-iec61937, format.channels = "8"  format.rate = "192000"
Okt 02 13:48:38 L380 pulseaudio[7421]: I: [pulseaudio] sink-input.c: Trying to change sample spec
Okt 02 13:48:38 L380 pulseaudio[7421]: D: [pulseaudio] sink.c: Suspending sink alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1 due to changing format, desired format = s16le rate = 192000
Okt 02 13:48:38 L380 pulseaudio[7421]: I: [alsa-sink-HDMI 1] alsa-sink.c: Device suspended...
Okt 02 13:48:38 L380 pulseaudio[7421]: D: [pulseaudio] sink.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1: suspend_cause: (none) -> INTERNAL
Okt 02 13:48:38 L380 pulseaudio[7421]: D: [pulseaudio] sink.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1: state: IDLE -> SUSPENDED
Okt 02 13:48:38 L380 pulseaudio[7421]: D: [pulseaudio] source.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1.monitor: suspend_cause: (none) -> INTERNAL
Okt 02 13:48:38 L380 pulseaudio[7421]: D: [pulseaudio] source.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1.monitor: state: IDLE -> SUSPENDED
Okt 02 13:48:38 L380 pulseaudio[7421]: I: [pulseaudio] sink.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1: rate: 44100 -> 192000
Okt 02 13:48:38 L380 pulseaudio[7421]: D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
Okt 02 13:48:38 L380 pulseaudio[7421]: I: [pulseaudio] sink.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1: channels: 2 -> 8
Okt 02 13:48:38 L380 pulseaudio[7421]: D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
Okt 02 13:48:38 L380 pulseaudio[7421]: I: [pulseaudio] sink.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1: channel map: front-left,front-right -> front-left,front-right,rear-left,rear-right,front-center,lfe
Okt 02 13:48:38 L380 pulseaudio[7421]: D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
Okt 02 13:48:38 L380 pulseaudio[7421]: I: [pulseaudio] sink.c: Reconfigured successfully to: s16le 8ch 192000Hz
Okt 02 13:48:38 L380 pulseaudio[7421]: D: [pulseaudio] sink.c: Suspending monitor source alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1.monitor, because the sink is entering the passthrough mode.
Okt 02 13:48:38 L380 pulseaudio[7421]: D: [pulseaudio] source.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1.monitor: suspend_cause: INTERNAL -> PASSTHROUGH|INTERNAL
Okt 02 13:48:38 L380 pulseaudio[7421]: I: [alsa-sink-HDMI 1] alsa-sink.c: Trying resume...
Okt 02 13:48:38 L380 pulseaudio[7421]: I: [alsa-sink-HDMI 1] alsa-sink.c: Updated frame_size 16, frames_per_block 4092, fragment_size 4408, hwbuf_size 17632, tsched(size 352800, watermark 3528), rewind_safeguard
Okt 02 13:48:38 L380 pulseaudio[7421]: I: [alsa-sink-HDMI 1] alsa-util.c: Trying to disable ALSA period wakeups, using timers only
Okt 02 13:48:38 L380 pulseaudio[7421]: D: [alsa-sink-HDMI 1] alsa-util.c: Maximum hw buffer size is 21 ms
Okt 02 13:48:38 L380 pulseaudio[7421]: D: [alsa-sink-HDMI 1] alsa-util.c: Set buffer size first (to 22050 samples), period size second (to 22050 samples).
Okt 02 13:48:38 L380 pulseaudio[7421]: I: [alsa-sink-HDMI 1] alsa-util.c: ALSA period wakeups disabled
Okt 02 13:48:38 L380 pulseaudio[7421]: D: [alsa-sink-HDMI 1] alsa-sink.c: hwbuf_unused=0
Okt 02 13:48:38 L380 pulseaudio[7421]: D: [alsa-sink-HDMI 1] alsa-sink.c: setting avail_min=3328
Okt 02 13:48:38 L380 pulseaudio[7421]: D: [alsa-sink-HDMI 1] alsa-sink.c: hwbuf_unused=0
Okt 02 13:48:38 L380 pulseaudio[7421]: D: [alsa-sink-HDMI 1] alsa-sink.c: setting avail_min=3328
Okt 02 13:48:38 L380 pulseaudio[7421]: D: [alsa-sink-HDMI 1] alsa-sink.c: hwbuf_unused=0
Okt 02 13:48:38 L380 pulseaudio[7421]: D: [alsa-sink-HDMI 1] alsa-sink.c: setting avail_min=3328
Okt 02 13:48:38 L380 pulseaudio[7421]: I: [alsa-sink-HDMI 1] alsa-sink.c: Time scheduling watermark is 4,00ms
Okt 02 13:48:38 L380 pulseaudio[7421]: I: [alsa-sink-HDMI 1] alsa-sink.c: Resumed successfully...

@fritsch
Copy link
Member Author

fritsch commented Oct 2, 2019

TrueHD also looks okay (though noisy):

2 14:01:41 L380 pulseaudio[7421]: D: [pulseaudio] sink-input.c: Negotiated format: truehd-iec61937, format.channels = "8"  format.rate = "192000"
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [pulseaudio] sink-input.c: Trying to change sample spec
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [pulseaudio] sink.c: Suspending sink alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1 due to changing format, desired format = s16le rate = 192000
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [alsa-sink-HDMI 1] alsa-sink.c: Device suspended...
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [pulseaudio] sink.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1: suspend_cause: (none) -> INTERNAL
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [pulseaudio] sink.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1: state: IDLE -> SUSPENDED
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [pulseaudio] source.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1.monitor: suspend_cause: (none) -> INTERNAL
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [pulseaudio] source.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1.monitor: state: IDLE -> SUSPENDED
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [pulseaudio] sink.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1: rate: 44100 -> 192000
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [pulseaudio] sink.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1: channels: 2 -> 8
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [pulseaudio] sink.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1: channel map: front-left,front-right -> front-left,front-right,rear-left,rear-right,front-center,lfe
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [pulseaudio] sink.c: Reconfigured successfully to: s16le 8ch 192000Hz
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [pulseaudio] sink.c: Suspending monitor source alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1.monitor, because the sink is entering the passthrough mode.
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [pulseaudio] source.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1.monitor: suspend_cause: INTERNAL -> PASSTHROUGH|INTERNAL
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [alsa-sink-HDMI 1] alsa-sink.c: Trying resume...
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [alsa-sink-HDMI 1] alsa-sink.c: Updated frame_size 16, frames_per_block 4092, fragment_size 4408, hwbuf_size 17632, tsched(size 352800, watermark 3528), rewind_safeguard
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [alsa-sink-HDMI 1] alsa-util.c: Trying to disable ALSA period wakeups, using timers only
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [alsa-sink-HDMI 1] alsa-util.c: Maximum hw buffer size is 21 ms
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [alsa-sink-HDMI 1] alsa-util.c: Set buffer size first (to 22050 samples), period size second (to 22050 samples).
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [alsa-sink-HDMI 1] alsa-util.c: ALSA period wakeups disabled
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [alsa-sink-HDMI 1] alsa-sink.c: hwbuf_unused=0
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [alsa-sink-HDMI 1] alsa-sink.c: setting avail_min=3328
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [alsa-sink-HDMI 1] alsa-sink.c: hwbuf_unused=0
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [alsa-sink-HDMI 1] alsa-sink.c: setting avail_min=3328
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [alsa-sink-HDMI 1] alsa-sink.c: hwbuf_unused=0
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [alsa-sink-HDMI 1] alsa-sink.c: setting avail_min=3328
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [alsa-sink-HDMI 1] alsa-sink.c: Time scheduling watermark is 4,00ms
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [alsa-sink-HDMI 1] alsa-sink.c: Resumed successfully...
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [alsa-sink-HDMI 1] alsa-sink.c: Starting playback.
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [pulseaudio] sink.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1: suspend_cause: INTERNAL -> (none)
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [alsa-sink-HDMI 1] ratelimit.c: 11 events suppressed
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [pulseaudio] sink.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1: state: SUSPENDED -> IDLE
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [alsa-sink-HDMI 1] alsa-sink.c: Cutting sleep time for the initial iterations by half.
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [pulseaudio] module-suspend-on-idle.c: Sink alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1 becomes idle, timeout in 5 seconds.
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [alsa-sink-HDMI 1] alsa-sink.c: Cutting sleep time for the initial iterations by half.
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [pulseaudio] source.c: alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1.monitor: suspend_cause: PASSTHROUGH|INTERNAL -> PASSTHROUGH
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [pulseaudio] module-stream-restore.c: Not restoring volume for sink input sink-input-by-application-name:Kodi, because already set.
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [pulseaudio] module-stream-restore.c: Restoring mute state for sink input sink-input-by-application-name:Kodi.
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [pulseaudio] module-suspend-on-idle.c: Sink alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1 becomes busy, resuming.
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [pulseaudio] module-suspend-on-idle.c: Sink alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1 becomes idle, timeout in 5 seconds.
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [pulseaudio] memblockq.c: memblockq requested: maxlength=33554432, tlength=0, base=16, prebuf=0, minreq=1 maxrewind=0
Okt 02 14:01:41 L380 pulseaudio[7421]: D: [pulseaudio] memblockq.c: memblockq sanitized: maxlength=33554432, tlength=33554432, base=16, prebuf=0, minreq=16 maxrewind=0
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [pulseaudio] sink-input.c: Created input 11 "kodi audio stream" on alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1 with sample spec s16le 8ch 192000Hz and channel map fr
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [pulseaudio] sink-input.c:     media.name = "kodi audio stream"
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [pulseaudio] sink-input.c:     application.name = "Kodi"
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [pulseaudio] sink-input.c:     native-protocol.peer = "UNIX socket client"
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [pulseaudio] sink-input.c:     native-protocol.version = "33"
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [pulseaudio] sink-input.c:     application.process.id = "10290"
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [pulseaudio] sink-input.c:     application.process.user = "fritsch"
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [pulseaudio] sink-input.c:     application.process.host = "L380"
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [pulseaudio] sink-input.c:     application.process.binary = "kodi-wayland"
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [pulseaudio] sink-input.c:     application.language = "C"
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [pulseaudio] sink-input.c:     window.x11.display = ":0"
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [pulseaudio] sink-input.c:     application.process.machine_id = "76f3a034f5be4d65b7250b187703b81e"
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [pulseaudio] sink-input.c:     module-stream-restore.id = "sink-input-by-application-name:Kodi"
Okt 02 14:01:41 L380 pulseaudio[7421]: I: [pulseaudio] protocol-native.c: Requested tlength=200,00 ms, minreq=50,00 ms

xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp Outdated Show resolved Hide resolved
xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp Outdated Show resolved Hide resolved
xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp Outdated Show resolved Hide resolved
xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp Outdated Show resolved Hide resolved
@fritsch
Copy link
Member Author

fritsch commented Oct 4, 2019

Thanks @Rechi - I only fixed new code. Will sort the rest after we know which version this is stable in upstream PA and fine from semantics.

@fritsch
Copy link
Member Author

fritsch commented Oct 4, 2019

@ford-prefect I had a lookg into pulse's alsa sink implementation. It seems there is a lot signalling still missing: AES0, AES1, AES2, AES3, etc. I don't think setting AES0=0x06 is enough

See: https://github.com/xbmc/xbmc/blob/master/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp#L456

How did you test DTSHD / TrueHD - is there some sample application, e.g. pacat that succesfully works?

@phunkyfish
Copy link
Contributor

@fritsch how is this progressing? Is it active or would you like to put it on the the backburner?

@phunkyfish phunkyfish added the PR Cleanup: Backburner This PR has merit as a future feature but has gone stale or is outdated. Label implies closed label Mar 9, 2020
@ford-prefect
Copy link

ford-prefect commented Jan 15, 2022

I've started working on the PA bits for this again, so please let me know what I can do to help move this forwards. My installation of Kodi (19.2 from Fedora) seems to not output TrueHD at all. I guess I need to build this branch for testing first.

@fritsch
Copy link
Member Author

fritsch commented Jan 15, 2022

Awesome to see. I rebased and squashed the changes. Some of the ifdefs / version handling will need adjustment as they still focus towards version 13.

@fritsch fritsch added this to the Nexus 20.0 Alpha 1 milestone Jan 15, 2022
@ford-prefect
Copy link

The PulseAudio branch should be good for testing against XBMC (I've implemented the AES bits as well).

As I am not sure at all if my laptop's HDMI connection actually supports DTS-HD-MA / TrueHD - I keep it as is for now :-)

I think I am also hitting this problem, so not sure how best to test this tbh.

@fritsch
Copy link
Member Author

fritsch commented Jan 18, 2022

You could start kodi like this: KODI_AE_SINK=ALSA kodi - that way it will use ALSA instead of pulseaudio - and you can see if TrueHD / DTS-HD is available under the expert audio settings?

@ford-prefect
Copy link

ford-prefect commented Jan 18, 2022

It is available, but does not work. Ditto for trying this with mpv, so it really seems like an issue with my setup. What I tested:

speaker-test with 2ch
speaker-test with 8ch
✅ EAC3 audio with ALSA
✅ DTS-MA-HR audio with ALSA
❌ TrueHD with ALSA
❌ DTS-HD with ALSA
✅ EAC3 audio with PulseAudio
❌ TrueHD with PulseAudio
❌ DTS-HD with PulseAudio
❌ DTS-MA-HR audio with PulseAudio (expected based on your patch above, but let's punt this one for now)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Audio PR Cleanup: Backburner This PR has merit as a future feature but has gone stale or is outdated. Label implies closed Type: Improvement non-breaking change which improves existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants