-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Proteaaudio for audio playback #290
base: master
Are you sure you want to change the base?
Conversation
Would ALSA or OSS work better? |
Good point! I'll investigate. |
Based on https://www.music.mcgill.ca/~gary/rtaudio/compiling.html it seems that in particular the OSS backend needs no extra libraries, so static building should be possible. For ALSA it seems that [static builds are possible](https://github.com/alsa-project/alsa-lib/blob/master/INSTALL#L4>, so that should work as well; might require more work on the nixpkgs side. So some Cabal flags to choose a backend might help indeed! |
How do I enable that backend, @csabahruska? Just ~/build/haskell/proteaaudio/proteaaudio $ git diff
diff --git a/proteaaudio/proteaaudio.cabal b/proteaaudio/proteaaudio.cabal
index 939c4e0..d0caa1e 100644
--- a/proteaaudio/proteaaudio.cabal
+++ b/proteaaudio/proteaaudio.cabal
@@ -87,9 +87,8 @@ Library
CXX-Options: "-D__WINDOWS_DS__"
Extra-Libraries: ole32 dsound winmm
if os(linux)
- CXX-Options: "-D__LINUX_PULSE__"
- Extra-Libraries: pthread pulse-simple pulse
- pkgconfig-depends: libpulse-simple, libpulse
+ CXX-Options: "-D__LINUX_OSS__"
+ Extra-Libraries: pthread
if os(darwin)
CXX-Options: "-D__MACOSX_CORE__"
Extra-Libraries: pthread Did not seem to be enough, I get errors from the C compiler. |
It should be that but it seems that OSS is simply broken on recent linux systems. others have the same issue: mltframework/mlt#716 (comment) |
Yeah, also see thestk/rtaudio#90. Probably OSS not is not a way to go. That leaves ALSA 👀 |
I can compile against diff --git a/proteaaudio/proteaaudio.cabal b/proteaaudio/proteaaudio.cabal
index cb2cba8..89ab45f 100644
--- a/proteaaudio/proteaaudio.cabal
+++ b/proteaaudio/proteaaudio.cabal
@@ -88,9 +88,9 @@ Library
CXX-Options: "-D__WINDOWS_DS__"
Extra-Libraries: ole32 dsound winmm
if os(linux)
- CXX-Options: "-D__LINUX_PULSE__"
- Extra-Libraries: pthread pulse-simple pulse
- pkgconfig-depends: libpulse-simple, libpulse
+ CXX-Options: "-D__LINUX_ALSA__"
+ Extra-Libraries: pthread
+ pkgconfig-depends: alsa
if os(darwin)
CXX-Options: "-D__MACOSX_CORE__"
Extra-Libraries: pthread and it works if I compile normally. I can even compile statically against a statically linked ALSA library, but the resulting binary doesn’t work:
It seems that ALSA has a plugin architecture, and once compiled statically, it cannot load such plugins any more? In that way, it’s no better for me than using libpulse. |
So what will you do? Is it possible at all on linux to use static linking with on audio lib. |
I'm inclined to use the old code, shelling out to |
What works
What needs to be done
And this seems to be an upstream issue (https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/1089#note_751107)
Might kill this plan, it seems.
Fixes #286