Need for a CMake switch to turn off Pulseaudio support

Bug #592525 reported by Flamelab
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Lightspark
Fix Released
Low
Unassigned

Bug Description

ArchLinux x86_64
Lightspark: from -git

There should be an option to disable Pulseaudio support.

I have not PA in my system but Lightspark build fails during cmake calls:

==> Starting build()...
  -> Connecting to github....
Initialized empty Git repository in /mnt/Lab/Projects/lightspark-git/src/lightspark/.git/
remote: Counting objects: 6331, done.
remote: Compressing objects: 100% (1587/1587), done.
remote: Total 6331 (delta 5292), reused 5700 (delta 4735)
Receiving objects: 100% (6331/6331), 1.59 MiB | 346 KiB/s, done.
Resolving deltas: 100% (5292/5292), done.
  -> Git checkout done or server timeout
  -> Starting make...
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found assembler: /usr/bin/nasm
-- LLVM llvm-config found at: /usr/bin/llvm-config
-- LLVM version: 2.7
-- LLVM CXX flags: -I/usr/include -DNDEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O2 -fomit-frame-pointer -fno-exceptions -fno-rtti -fPIC -Woverloaded-virtual
-- LLVM LD flags: -L/usr/lib/llvm -lpthread -lffi -ldl -lm
-- LLVM core libs: -lLLVMLinker -lLLVMArchive -lLLVMBitWriter -lLLVMBitReader -lLLVMInstrumentation -lLLVMipo -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMCore -lLLVMSupport -lLLVMSystem
-- LLVM JIT libs: -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMMCParser -lLLVMX86AsmPrinter -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMX86Info -lLLVMJIT -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMCore -lLLVMSupport -lLLVMSystem
-- LLVM JIT objs:
-- Found LLVM: /usr/include
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found CURL: /usr/lib/libcurl.so
-- Found ZLIB: /usr/lib/libz.so
-- checking for modules 'gl;libpcrecpp;libavcodec;libavutil;ftgl;x11;libpulse'
-- package 'libpulse' not found
CMake Error at /usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:259 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:311 (_pkg_check_modules_internal)
  CMakeLists.txt:43 (pkg_check_modules)

-- Found assembler: /usr/bin/nasm
-- Loaded CMakeASM-NASMInformation - ASM-NASM support is still experimental, please report issues
-- checking for modules 'gtk+-2.0;gtkglext-1.0'
-- found gtk+-2.0, version 2.20.1
-- found gtkglext-1.0, version 1.2.0
-- checking for modules 'nspr;mozilla-plugin'
-- found nspr, version 4.8.4
-- found mozilla-plugin, version 1.9.2
-- Configuring incomplete, errors occurred!
make: *** No targets specified and no makefile found. Stop.

An option like -DWithoutPulse would be nice for those who don't want Pulseaudio :-)

Tags: pulseaudio
Revision history for this message
Alessandro Pignotti (a-pignotti) wrote :

Pulseaudio is needed for audio support. Switching off pulseaudio would basically disable audio at all. If you think it's useful I'll add this compile time switch for next point release 0.4.2

Changed in lightspark:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Flamelab (panfilip) wrote :

I'd really like to see a compile time switch for that :)

Revision history for this message
Alexandre Demers (oxalin) wrote :

Just a question : will Pulseaudio be the only audio backend supported? As Flamelab has pointed, not every linux distributions ship with Pulseaudio, even if it's not really complicated to install. Since SDL is already a requirement for lightspark, I was under the impression that it would be the way to go : SDL offers audio and video and is available for Linux, Windows, OSX and BSD, 32 or 64bit. But I don't want to argue about it since this is already a step foward compared to... well, no sound, and it's not a bad choice anyway, just another requirement.

Revision history for this message
Alessandro Pignotti (a-pignotti) wrote :

Pulseaudio has been chosen because it offers high precision latency measurement and time sync which are needed for any serious task. Morever, SDL is only used for standalone player, the plugin does not need it (it's currently requested just because I'm too lazy to wrap around SDL stuff an ifdef, my fault). My current policy is too maintain only a single backend per feature, while trying to do things in the right way. I'm of course open to any contribution.

Revision history for this message
Flamelab (panfilip) wrote :

Α nice way would be a Gstreamer implementation (if that's possible), like (for example) Clementine player does (which wants compatibility for both Unix/Linux and Windows NT systems).

Changed in lightspark:
milestone: none → lightspark-0.4.2
Revision history for this message
Alexandre Demers (oxalin) wrote :

One interesting way of doing it would be to split the audio backend from the player. But it would need some rework to implement a plugin approach where Lightspark would query a directory of plugins, if one is found, to ask what it is, if it implements a sound backend and gives lightspark all it needs to play audio correctly (according to a pre-determined communication API between the binary and the plugin to make sure both can communicate correctly and implement the needed stuff on each side), then list it in the different backends available. One could create a plugin for alsa, pulseaudio, gstreamer, xine, openAL as long as it implements what LS needs to decode audio, then it could used.

However, a plugin should be listed as available if :
- it is present in the plugin directory
- it answers to the audio API defined for LS
And to be selectable only if :
- it detects that the backend is present on the system

Then, the user would have to choose between the different plugins which one should be used.

I don't know if this plugin idea could be extended to help the implementation of some other functionalities in the future...

But for sure it would be useful for the sound backend part. It could even be used under Windows or OSX where a plugin for DirectSound (or whatever it is called now under Win7) or Core Audio (which is an OpenAL implementation) could be used without having to code it in LS. For now, personally, I'll wait until work on the audio interface finishes, I know it is still changing a lot. But after that, I could make a fork and try to do something about it.

I'll add that as a wish item... we'll see when we'll be there, unless someone does it before I do.

PS.: instead of adding a switch to remove Pulse from the compilation, I would keep it as a requirement (some of the other required packages are not always installed by default from one distribution to the other).

Revision history for this message
Alessandro Pignotti (a-pignotti) wrote :

In current git is possible to configure the build using

cmake <usual stuff> -DENABLE_SOUND=0

to completely disable sound

Changed in lightspark:
status: Confirmed → Fix Committed
Changed in lightspark:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.