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

This forum is about all development around libVLC.
safari2
New Cone
New Cone
Posts: 7
Joined: 24 Oct 2018 00:30

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

Postby safari2 » 24 Oct 2018 00:48

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.

mfkl
Developer
Developer
Posts: 738
Joined: 13 Jun 2017 10:41

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

Postby mfkl » 24 Oct 2018 04:26

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.
https://mfkl.github.io

safari2
New Cone
New Cone
Posts: 7
Joined: 24 Oct 2018 00:30

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

Postby safari2 » 24 Oct 2018 11:34

3.0.4
how to collect the logs?

safari2
New Cone
New Cone
Posts: 7
Joined: 24 Oct 2018 00:30

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

Postby safari2 » 24 Oct 2018 12:04

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?


mfkl
Developer
Developer
Posts: 738
Joined: 13 Jun 2017 10:41

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

Postby mfkl » 25 Oct 2018 04:10

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
https://mfkl.github.io

safari2
New Cone
New Cone
Posts: 7
Joined: 24 Oct 2018 00:30

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

Postby safari2 » 25 Oct 2018 15:25

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.

mfkl
Developer
Developer
Posts: 738
Joined: 13 Jun 2017 10:41

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

Postby mfkl » 29 Oct 2018 03:52

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
https://mfkl.github.io


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 4 guests