Page 1 of 1

Getting the list shown under Audio/Audio Devices through libvlc

Posted: 05 Feb 2015 18:50
by RJVB
Hello,

I'm a member of the KDE Mac community, currently looking at ways to bring audio playback (and capture) device selection to KDE's systemsettings on OS X.

VLC shows exactly the kind of device list I'd like to be able to select from (also with the Qt4 interface), and I was hoping it would be relatively straightforward if not automatic to get that list through the VLC phonon backend. Not so; the only entry I get is auhal.

Looking through the VLC source I see how to obtain the list using aout_DeviceList, but it seems one has to have a valid playlist in order to obtain the required audio_output_t instance.
Is there another way, or is it possible to create some kind of minimal dummy playlist through libvlc?

Maybe I should ask first if it is possible to use the devices returned by aout_DevicesList instead of the ones returned by libvlc_audio_output_list_get ?

Thanks in advance,
R.

PS: I've created a patch against VLC 2.1.5 that allows applications linked against libvlc (as installed through MacPorts) to find the available plugins. I think it doesn't introduce regressions to a standard build (nor to the VLC.app built through MacPorts), so if this is of potential interest for upstream incorporation I can put the patch on trac.

Re: Getting the list shown under Audio/Audio Devices through libvlc

Posted: 05 Feb 2015 19:00
by Rémi Denis-Courmont
libvlc_audio_output_device_enum() already does that.

Re: Getting the list shown under Audio/Audio Devices through libvlc

Posted: 05 Feb 2015 22:30
by RJVB
Thanks, but I don't see that function (libvlc_audio_output_device_enum) in my 2.1.5. source code; was it added after that release?
Maybe I should ask first if it is possible to use the devices returned by aout_DevicesList instead of the ones returned by libvlc_audio_output_list_get ?
And with that I mean of course that the device selection will happen through phonon as a function of the sound category (music, notification, video; see KDE's multimedia control module), and thus without having a VLC playlist available.

Re: Getting the list shown under Audio/Audio Devices through libvlc

Posted: 06 Feb 2015 10:21
by Jean-Baptiste Kempf
Yes, it was added later.

Re: Getting the list shown under Audio/Audio Devices through libvlc

Posted: 12 Feb 2015 12:48
by RJVB
FWIW, libVLC does detect the available devices of the auhal module, but for some reason fails to make them available through libvlc_audio_output_device_list_get(). As far as I can see the list in which they should be stored has 0 length in the data retrieved through the bsearch() call to which libvlc_audio_output_device_list_get() leads.

Code: Select all

%> env PHONON_SUBSYSTEM_DEBUG=5 PHONON_BACKEND_DEBUG=5 /Applications/MacPorts/KDE4/systemsettings.app/Contents/MacOS/systemsettings QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave. PHONON-VLC Constructing Phonon-VLC Version 0.8.50 [00007fd2cd370c38] core libvlc debug: VLC media player - 2.2.0-rc2 Weatherwax [00007fd2cd370c38] core libvlc debug: Copyright © 1996-2015 the VideoLAN team [00007fd2cd370c38] core libvlc debug: revision 2.2.0-rc2-215-g1d718af [00007fd2cd370c38] core libvlc debug: configured with ./configure '--prefix=/opt/local' '--with-contrib=/opt/local/var/macports/build/_opt_local_site-ports_multimedia_VLC-devel/libVLC/work/VLC-devel-2.2.0-rc2-214-g2d59a46/contrib' '--disable-debug' '--disable-update-check' '--enable-gnutls' '--disable-notify' '--enable-lua' '--disable-gnomevfs' '--disable-growl' '--disable-macosx-vlc-app' '--enable-dvdnav' '--enable-dvdread' '--disable-smbclient' '--enable-vcdx' '--enable-freerdp' '--enable-opencv' '--enable-sftp' '--enable-dvbpsi' '--enable-mux_ogg' '--enable-mkv' '--enable-mod' '--enable-mpc' '--disable-shout' '--enable-a52' '--enable-faad' '--enable-flac' '--enable-live555' '--enable-opus' '--enable-vorbis' '--enable-ogg' '--enable-mad' '--enable-libass' '--enable-dca' '--enable-png' '--disable-quicktime' '--enable-twolame' '--enable-speex' '--enable-theora' '--enable-x264' '--enable-postproc' '--enable-avcodec' '--enable-avformat' '--enable-swscale' '--disable-fluidsynth' '--enable-schroedinger' '--disable-caca' '--enable-sdl' '--enable-sdl-image' '--enable-freetype' '--enable-fontconfig' '--enable-fribidi' '--disable-svg' '--disable-jack' '--disable-pulse' '--disable-macosx-dialog-provider' '--disable-qt' '--enable-ncurses' '--disable-skins2' '--disable-goom' '--enable-bonjour' '--enable-upnp' '--enable-macosx-eyetv' '--enable-dbus' '--enable-macosx-qtkit' '--with-x' '--enable-xvideo' '--enable-glx' '--enable-xcb' '--enable-macosx' '--disable-samplerate' '--enable-merge-ffmpeg' '--enable-realrtsp' 'CC=/usr/bin/clang' 'CFLAGS=-O3 -march=native -g -arch x86_64' 'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64' 'CPPFLAGS=-I/opt/local/include -D__unix__=1 -DFREERDP_INTERFACE_VERSION -DFREERDP_VERSION_MAJOR=1 -DFREERDP_VERSION_MINOR=1 -I/opt/local/lib/live/liveMedia/include' 'CXX=/usr/bin/clang++' 'CXXFLAGS=-O3 -march=native -g -arch x86_64 -stdlib=libc++' 'OBJC=/usr/bin/clang' 'OBJCFLAGS=-O3 -march=native -g -arch x86_64' 'OBJCXX=/usr/bin/clang++' 'OBJCXXFLAGS=-O3 -march=native -g -arch x86_64 -stdlib=libc++' 'CXXCPP=/usr/bin/clang++ -E' [00007fd2cd370c38] core libvlc debug: searching plug-in modules [00007fd2cd370c38] core libvlc debug: loading plugins cache file /opt/local/lib/vlc/plugins/plugins.dat [00007fd2cd370c38] core libvlc debug: recursively browsing `/opt/local/lib/vlc/plugins' [00007fd2cd370c38] core libvlc debug: saving plugins cache /opt/local/lib/vlc/plugins/plugins.dat [00007fd2cd370c38] core libvlc debug: plug-ins loaded: 418 modules [00007fd2cd370c38] core libvlc debug: translation test: code is "en_GB" [00007fd2cd370c38] core libvlc debug: CPU has capabilities MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX FPU [00007fd2cd29a5c8] core playlist debug: creating audio output [00007fd2cd19deb8] core audio output debug: looking for audio output module matching "any": 4 candidates [00007fd2cd19deb8] auhal audio output debug: Rebuild device list [00007fd2cd19deb8] auhal audio output debug: found 5 audio device(s) [00007fd2cd19deb8] auhal audio output debug: DevID: 56 DevName: Built-in Input [00007fd2cd19deb8] auhal audio output debug: this 'Built-in Input' is INPUT only. skipping... [00007fd2cd19deb8] auhal audio output debug: DevID: 47 DevName: Built-in Output [00007fd2cd19deb8] auhal audio output debug: found 12 stream formats for stream id 48 [00007fd2cd19deb8] auhal audio output debug: DevID: 63 DevName: USB PnP Sound Device [00007fd2cd19deb8] auhal audio output debug: found 4 stream formats for stream id 64 [00007fd2cd19deb8] auhal audio output debug: DevID: 84 DevName: iMic USB audio system [00007fd2cd19deb8] auhal audio output debug: found 4 stream formats for stream id 85 [00007fd2cd19deb8] auhal audio output debug: DevID: 73 DevName: LogMeInSoundDriver [00007fd2cd19deb8] auhal audio output debug: found 9 stream formats for stream id 74 [00007fd2cd19deb8] core audio output debug: restart requested (2) [00007fd2cd19deb8] core audio output debug: using audio output module "auhal" [00007fd2cd29a5c8] core playlist debug: keeping audio output [00007fd2cd29a5c8] core playlist debug: adding services_discovery ''... [00007fd2cd395dd8] core services discovery debug: looking for services_discovery module matching "''": 10 candidates [00007fd2cd395dd8] core services discovery debug: no services_discovery modules matched [00007fd2cd395dd8] core services discovery error: no suitable services discovery module [00007fd2cd3965d8] core interface debug: looking for interface module matching "logger,none": 16 candidates [00007fd2cd3965d8] logger interface: using logger. [00007fd2cd3965d8] logger interface debug: opening logfile `/Users/bertin/Library/Application Support/org.videolan.vlc/log/vlc-log-31563.txt' PHONON-VLC Using VLC version 2.2.0-rc2 Weatherwax vlcAudioOutBackends ("adummy", "afile", "amem", "auhal") PHONON-VLC Sound system "pulse" not supported by libvlc PHONON-VLC Sound system "alsa" not supported by libvlc PHONON-VLC Sound system "oss" not supported by libvlc PHONON-VLC Sound system "jack" not supported by libvlc PHONON-VLC Sound system "aout_directx" not supported by libvlc PHONON-VLC Sound system "directsound" not supported by libvlc Output "adummy" descr= "Dummy audio output" Output "afile" descr= "File audio output" Output "amem" descr= "Audio memory output" Output "auhal" descr= "HAL AudioUnit output" manually injecting sound system "auhal" PHONON-VLC Added backend device "auhal" PHONON-VLC BEGIN: void Phonon::VLC::EffectManager::updateEffects() PHONON-VLC END__: void Phonon::VLC::EffectManager::updateEffects() [Took: 0s] PHONON-VLC virtual bool Phonon::VLC::AudioOutput::setOutputDevice(const AudioOutputDevice &) PHONON-VLC Object: Phonon::VLC::AudioOutput PHONON-VLC Object: Phonon::VLC::MediaObject PHONON-VLC Backend connected Phonon::VLC::MediaObject to Phonon::VLC::AudioOutput PHONON-VLC Setting output soundsystem to "auhal" PHONON-VLC Volume changed from 75 to 100 PHONON-VLC Object: Phonon::VLC::AudioOutput PHONON-VLC Object: Phonon::VLC::MediaObject PHONON-VLC BEGIN: virtual void Phonon::VLC::MediaObject::setSource(const Phonon::MediaSource &) PHONON-VLC MediaSource::Url: QUrl( "file:///opt/local/share/sounds/KDE-Sys-Log-In.ogg" ) PHONON-VLC Phonon::LoadingState --> Phonon::BufferingState PHONON-VLC END__: void Phonon::VLC::MediaObject::changeState(Phonon::State) [Took: 0s] PHONON-VLC BEGIN: void Phonon::VLC::MediaObject::updateState(MediaPlayer::State) PHONON-VLC State(MediaPlayer::PlayingState) PHONON-VLC attempted autoplay? false PHONON-VLC BEGIN: void Phonon::VLC::MediaObject::changeState(Phonon::State) PHONON-VLC Phonon::BufferingState --> Phonon::PlayingState PHONON-VLC END__: void Phonon::VLC::MediaObject::changeState(Phonon::State) [Took: 0s] PHONON-VLC Restoring buffering state after state change to Playing PHONON-VLC BEGIN: void Phonon::VLC::MediaObject::changeState(Phonon::State) PHONON-VLC Phonon::PlayingState --> Phonon::BufferingState PHONON-VLC END__: void Phonon::VLC::MediaObject::changeState(Phonon::State) [Took: 0s] PHONON-VLC END__: void Phonon::VLC::MediaObject::updateState(MediaPlayer::State) [Took: 0s] PHONON-VLC BEGIN: void Phonon::VLC::MediaObject::changeState(Phonon::State) PHONON-VLC Phonon::BufferingState --> Phonon::PlayingState PHONON-VLC END__: void Phonon::VLC::MediaObject::changeState(Phonon::State) [Took: 0s] PHONON-VLC BEGIN: virtual void Phonon::VLC::MediaObject::stop() PHONON-VLC END__: virtual void Phonon::VLC::MediaObject::stop() [Took: 0.053s] PHONON-VLC Object: Phonon::VLC::AudioOutput PHONON-VLC Object: Phonon::VLC::MediaObject PHONON-VLC Object: Phonon::VLC::AudioOutput PHONON-VLC Object: Phonon::VLC::MediaObject [00007fd2cd370c38] core libvlc debug: VLC media player - 2.2.0-rc2 Weatherwax [00007fd2cd370c38] core libvlc debug: Copyright © 1996-2015 the VideoLAN team [00007fd2cd370c38] core libvlc debug: revision 2.2.0-rc2-215-g1d718af [00007fd2cd370c38] core libvlc debug: configured with ./configure '--prefix=/opt/local' '--with-contrib=/opt/local/var/macports/build/_opt_local_site-ports_multimedia_VLC-devel/libVLC/work/VLC-devel-2.2.0-rc2-214-g2d59a46/contrib' '--disable-debug' '--disable-update-check' '--enable-gnutls' '--disable-notify' '--enable-lua' '--disable-gnomevfs' '--disable-growl' '--disable-macosx-vlc-app' '--enable-dvdnav' '--enable-dvdread' '--disable-smbclient' '--enable-vcdx' '--enable-freerdp' '--enable-opencv' '--enable-sftp' '--enable-dvbpsi' '--enable-mux_ogg' '--enable-mkv' '--enable-mod' '--enable-mpc' '--disable-shout' '--enable-a52' '--enable-faad' '--enable-flac' '--enable-live555' '--enable-opus' '--enable-vorbis' '--enable-ogg' '--enable-mad' '--enable-libass' '--enable-dca' '--enable-png' '--disable-quicktime' '--enable-twolame' '--enable-speex' '--enable-theora' '--enable-x264' '--enable-postproc' '--enable-avcodec' '--enable-avformat' '--enable-swscale' '--disable-fluidsynth' '--enable-schroedinger' '--disable-caca' '--enable-sdl' '--enable-sdl-image' '--enable-freetype' '--enable-fontconfig' '--enable-fribidi' '--disable-svg' '--disable-jack' '--disable-pulse' '--disable-macosx-dialog-provider' '--disable-qt' '--enable-ncurses' '--disable-skins2' '--disable-goom' '--enable-bonjour' '--enable-upnp' '--enable-macosx-eyetv' '--enable-dbus' '--enable-macosx-qtkit' '--with-x' '--enable-xvideo' '--enable-glx' '--enable-xcb' '--enable-macosx' '--disable-samplerate' '--enable-merge-ffmpeg' '--enable-realrtsp' 'CC=/usr/bin/clang' 'CFLAGS=-O3 -march=native -g -arch x86_64' 'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64' 'CPPFLAGS=-I/opt/local/include -D__unix__=1 -DFREERDP_INTERFACE_VERSION -DFREERDP_VERSION_MAJOR=1 -DFREERDP_VERSION_MINOR=1 -I/opt/local/lib/live/liveMedia/include' 'CXX=/usr/bin/clang++' 'CXXFLAGS=-O3 -march=native -g -arch x86_64 -stdlib=libc++' 'OBJC=/usr/bin/clang' 'OBJCFLAGS=-O3 -march=native -g -arch x86_64' 'OBJCXX=/usr/bin/clang++' 'OBJCXXFLAGS=-O3 -march=native -g -arch x86_64 -stdlib=libc++' 'CXXCPP=/usr/bin/clang++ -E' [00007fd2cd29a5c8] core playlist debug: destroying [00007fd2cd29a5c8] core playlist debug: deactivating the playlist [00007fd2cd19deb8] core audio output debug: removing module "auhal"