Page 1 of 1

Picking output audio device w command line in .bat file

Posted: 14 Dec 2013 20:26
by Robben
Hi all :)

I like to be able to drag a video onto a .bat file that starts that video only on my 2nd screen (TV) via HDMI.
I found some code to put in a .bat file that I kind of understand and that is working for the video part, namely...:

Code: Select all

set vlcPath="c:\Program Files (x86)\VideoLAN\VLC\vlc.exe" %vlcPath% %1 --video-x=1921 --video-y=350 --width=300 --height=300 --fullscreen --novideo-title-show --no-embedded-video --no-qt-fs-controller
I've been trying all day to find the parameters that will use the HDMI for audio too...

At this point the amount of threads or suggestions are getting confusing and there's too much combinations to keep on trying.

If in VLC 2.1.2. I pick/change an audio device in the menu, it always works. Can't get it to work with the command line.

I'd like to know what parameters to try first and how to get the exact name of the audio device that VLC needs, please?

In VLC's menu, it is currently called "TV (NVIDIA High Definition Audi ($1,$64)" [yes, it says "Audi", not "Audio"]

So far I've tried:

--waveout-audio-device="TV"
--directx-audio-device="TV"
--directx-audio-device-name="TV"
... w. full or partial name or abbreviated, with and without quotes, with numbers instead of audio device text, etc.

Some threads seem to suggest you couldn't do this at one point.
So does this work at all in 2.1.2. and if so, how please? TY!

Re: Picking output audio device w command line in .bat file

Posted: 15 Dec 2013 02:44
by Jean-Baptiste Kempf
Change it in preferences and then look into vlcrc to see what is the recorded name :)

Re: Picking output audio device w command line in .bat file

Posted: 15 Dec 2013 14:30
by Robben
You mean "change the name in the Windows Sound Control Panel"...?

If I change "TV" into "HDMI", that's the only part that changes.
Inside in VLC the 2nd part remains "(NVIDIA High Definition Audio)"
So at least I discovered it is "Audio" and not "Audi".

Still, none of these work in .bat ...:

--directx-audio-device="TV"
--directx-audio-device-name="TV"
--directx-audio-device="TV (NVIDIA High Definition Audio)"
--directx-audio-device-name="TV (NVIDIA High Definition Audio)"

--waveout-audio-device="TV"
--waveout-audio-device="TV (NVIDIA High Definition Audio)"

Always works via the menu...

Re: Picking output audio device w command line

Posted: 13 Jan 2014 13:43
by Ludrax
If in VLC 2.1.2. I pick/change an audio device in the menu, it always works. Can't get it to work with the command line.

--directx-audio-device="TV (NVIDIA High Definition Audio)"

Always works via the menu...
and Default is not selected in menu after command :?

Re: Picking output audio device w command line in .bat file

Posted: 20 May 2014 08:59
by Rémi Denis-Courmont
As JB said, you can change it in the VLC preferences, save and check the value in vlcrc.

Anyway, the DirectSound output plugin internally identifies audio device by their GUID, consistent with what most Windows software does. (The device name is not unique, so that's not an option.)

Re: Picking output audio device w command line in .bat file

Posted: 20 May 2014 19:14
by caleb666
As JB said, you can change it in the VLC preferences, save and check the value in vlcrc.

Anyway, the DirectSound output plugin internally identifies audio device by their GUID, consistent with what most Windows software does. (The device name is not unique, so that's not an option.)
As I said in my thread (https://forum.videolan.org/viewtopic.php?f=14&t=119322) the command line doesn't work, even if you use the GUID from the vlcrc file!

Heck, even doing "vlc --aout=directx" doesn't work!
Can you please test this yourself? I'm not the only one getting this problem.

Re: Picking output audio device w command line in .bat file

Posted: 21 May 2014 10:57
by Ludrax
As JB said, you can change it in the VLC preferences, save and check the value in vlcrc.

Anyway, the DirectSound output plugin internally identifies audio device by their GUID, consistent with what most Windows software does. (The device name is not unique, so that's not an option.)
same in 2.2.0 for new plugin? some handy command to keep automatic output module and select(in audio device menu all items are unique) :?:

Re: Picking output audio device w command line in .bat file

Posted: 21 May 2014 13:46
by Rémi Denis-Courmont
Somewhat obviously, DirectSound-related command line options only work with the DirectSound plugin. If you use MMDevice or WaveOut instead, the command line parameter will be ignored.

Re: Picking output audio device w command line in .bat file

Posted: 23 May 2014 11:33
by caleb666
Somewhat obviously, DirectSound-related command line options only work with the DirectSound plugin. If you use MMDevice or WaveOut instead, the command line parameter will be ignored.
I simply want a command line option that will let me do the following:
* Switch the audio output module to "DirectX audio output"
* Enable "Use S/PDIF when available"
* Choose a particular output device

Is this possible with VLC or not? Because the command lines above don't do anything.

Re: Picking output audio device w command line in .bat file

Posted: 23 May 2014 13:51
by Ludrax
Somewhat obviously, DirectSound-related command line options only work with the DirectSound plugin. If you use MMDevice or WaveOut instead, the command line parameter will be ignored.
wouldn't it better some more general command to tell VLC which entry from Audio Device menu to prefer w/o specifying any audio module(same command for all modules - even alsa) :?:

Re: Picking output audio device w command line in .bat file

Posted: 24 May 2014 12:50
by Rémi Denis-Courmont
I don't see how you can abstract the list of devices in a functional yet platform-independent fashion.

Re: Picking output audio device w command line in .bat file

Posted: 26 May 2014 14:20
by Ludrax
then i'm missing something :?

Code: Select all

add_string ("alsa-audio-device", "default",
if i understand correctly, dsound will search for matched guid of entered name(ticket 7102)

Code: Select all

add_obsolete_string( "directx-audio-device-name")
how to accomplish that every plugin can inherit same string if user enters name as displayed in device menu?

far as I can see, there is no command line option to select mmdevice(which can be selected from menu)

Code: Select all

mmdevice debug: using selected device {0.0.0.00000000}.{} mmdevice debug: display name changed: VLC media player mmdevice debug: version 2 session control unavailable

Re: Picking output audio device w command line in .bat file

Posted: 28 May 2014 05:54
by Rémi Denis-Courmont
The audio output device for DirectSound is stored in the VLC preferences and identified by its GUID.

The audio output device for mmdevice is stored by the Windows session manager, not VLC. It must be somewhere in the Windows registry if you care. The ID of the VLC session is 4533f59d-59ee-00c6-ad-b2-c6-8b-50-1a-66-55.