Page 1 of 1

how-to get HDMI/SPDIF audio passthrough via libVLC?

Posted: 24 Oct 2018 00:48
by safari2
Hi.
I'm trying to get pure DTS-HD MA/Dolby TrueHD/ATMOS bitstreaming from HDMI (Win7, NVidia gtx970) to my AV-Reciever.
With libVLC I can get only PCM 7.1, but native VLC media player do that via "HDMI/SPDIF audio passthrough enabled" in preferences without any problem.

How-to switch to HDMI/SPDIF audio passthrough via libVLC?

I'm using Delphi/Lazarus, but C/C++ example code will be also good.

Re: how-to get HDMI/SPDIF audio passthrough via libVLC?

Posted: 24 Oct 2018 04:26
by mfkl
Which libvlc version are you using?

Can you share some logs?

I don't think that's something you can enable/disable through the libvlc API, but I'm not sure.

Re: how-to get HDMI/SPDIF audio passthrough via libVLC?

Posted: 24 Oct 2018 11:34
by safari2
3.0.4
how to collect the logs?

Re: how-to get HDMI/SPDIF audio passthrough via libVLC?

Posted: 24 Oct 2018 12:04
by safari2
Do you mean to open in GUI preferences/logger enable "log to file" and "verbosity" to "debug"?
This will make to do logs from libVLC?

Re: how-to get HDMI/SPDIF audio passthrough via libVLC?

Posted: 25 Oct 2018 00:42
by safari2

Re: how-to get HDMI/SPDIF audio passthrough via libVLC?

Posted: 25 Oct 2018 04:10
by mfkl
Don't think there is anything interesting in these logs.

You need to get acquainted with

Code: Select all

libvlc_audio_output_device_types_t libvlc_AudioOutputDevice_SPDIF

Code: Select all

libvlc_audio_output_list_get

Code: Select all

libvlc_audio_output_device_list_get

Code: Select all

libvlc_audio_output_device_get

Code: Select all

libvlc_audio_output_device_set

Re: how-to get HDMI/SPDIF audio passthrough via libVLC?

Posted: 25 Oct 2018 15:25
by safari2
as for these functions:

Code: Select all

libvlc_audio_output_list_get libvlc_audio_output_device_list_get libvlc_audio_output_device_get libvlc_audio_output_device_set
I use it and it works good. I can change audio output from HDMI to analog speakers or headphones.

as for these types:

Code: Select all

libvlc_audio_output_device_types_t libvlc_AudioOutputDevice_SPDIF
they are associated only with these functions:

Code: Select all

libvlc_audio_output_get_device_type libvlc_audio_output_set_device_type
I have already tried this function libvlc_audio_output_set_device_type. Unfortunately, there is no result. As was the output in PCM Multi Ch, and remained.

I tried to learn VLC Player sources.That's what i found in \lib\audio.c:

Code: Select all

int libvlc_audio_output_get_device_type( libvlc_media_player_t *mp ) { (void) mp; return libvlc_AudioOutputDevice_Error; } void libvlc_audio_output_set_device_type( libvlc_media_player_t *mp, int device_type ) { (void) mp; (void) device_type; }

How it works if anyway it returns Error? I'm sorry, I know C++ very superficially.

Re: how-to get HDMI/SPDIF audio passthrough via libVLC?

Posted: 29 Oct 2018 03:52
by mfkl

Code: Select all

libvlc_audio_output_set_device_type
is deprecated, don't use it.

Use

Code: Select all

libvlc_audio_output_device_set
and

Code: Select all

libvlc_audio_output_set
How it works if anyway it returns Error?
For

Code: Select all

libvlc_audio_output_device_set
Returns Nothing. Errors are ignored (this is a design bug).
Check the doc https://www.videolan.org/developers/vlc ... af0067f31d