AudioIO.jl icon indicating copy to clipboard operation
AudioIO.jl copied to clipboard

Windows Support

Open ssfrr opened this issue 11 years ago • 19 comments

Pretty much the only thing that should need to be fixed to work in windows is the synchronization between the Julia task and the C PortAudio callback. Currently we're using a POSIX semaphore and a file descriptor. I'm not sure what the best windows equivalents are.

-s

ssfrr avatar Jan 06 '14 05:01 ssfrr

looks like you've removed the requirement for this?

it also would be nice to hook up BinDeps support, esp. since both portaudio and libsndfile are already available via WinRPM

vtjnash avatar Sep 04 '14 03:09 vtjnash

which change are you referring to? I've got the issue up but windows support hasn't been a priority.

I was avoiding Windows support because of the custom C shim and multithreading gymnastics I was doing before, but now that those are gone it should be pretty easy.

I just added the WinRPM lines to REQUIRE and build.jl, though I had to guess at the package names. Is there a list of WinRPM packages online somewhere?

ssfrr avatar Sep 04 '14 13:09 ssfrr

Via email Aitor Ortiz de Latierro Olivella informed me that the packages are:

  • "libportaudio2" (libportaudio2 (mingw64) - Portable Real-Time Audio Library)
  • "libsndfile1" (libsndfile1 (mingw64) - A Library to Handle Various Audio File Formats)

I changed the names in the package script, hopefully that helps. If anyone can test on Windows please let me know.

ssfrr avatar Oct 26 '14 18:10 ssfrr

Now this message appears just after the "INFO: Complete" of the libportaudio2 installation.

===============================[ ERROR: AudioIO ]===============================

Provider PackageManager failed to satisfy dependency libportaudio while loading C:\Users\Aitor.julia\v0.3\AudioIO\deps\build.jl, in expression st arting on line 29

================================[ BUILD ERRORS ]================================

WARNING: AudioIO had build errors.

  • packages with build errors remain installed in C:\Users\Aitor.julia\v0.3
  • build a package and all its dependencies with Pkg.build(pkg)
  • build a single package by running its deps/build.jl script

aiorla avatar Oct 26 '14 19:10 aiorla

Hmm, what happens if you try to use AudioIO even though the build throws the error? Are you able to play sound?

ssfrr avatar Oct 26 '14 19:10 ssfrr

With just "using AudioIO":

ERROR: could not open file C:\Users\Aitor.julia\v0.3\AudioIO\src../deps/deps.j l in include at boot.jl:245 in include_from_node1 at loading.jl:128 in include at boot.jl:245 in include_from_node1 at loading.jl:128 in reload_path at loading.jl:152 in _require at loading.jl:67 in require at loading.jl:51 while loading C:\Users\Aitor.julia\v0.3\AudioIO\src\AudioIO.jl, in expression s tarting on line 60

aiorla avatar Oct 26 '14 19:10 aiorla

I've manually installed "libsndfile1" and the error in the "using AudioIO" doesn't appear. (it is not installed in the build process because of the error) Now I'm going to try play, I will update this comment with the results shortly. (10 min)

UPDATE: Every method like play, ArrayPlayer, SinOsc, read "is not defined" :( UPDATE2: On the other hand methods like "AudioIO.open(wavFile)" work.

aiorla avatar Oct 26 '14 19:10 aiorla

Hi, sorry, I didn't see these updates because apparently GitHub doesn't sent notifications on updates, only new comments.

I'll see if I can get AudioIO up and running on a Windows machine myself so I can better debug. I'll comment back when I have some more info. Probably next week.

ssfrr avatar Nov 12 '14 00:11 ssfrr

Still getting the same error on my Windows 10 machine with Julia 0.3.11 when building AudioIO:

===============================[ ERROR: AudioIO ]===============================

Provider PackageManager failed to satisfy dependency libportaudio while loading C:\Users\Wouter.julia\v0.3\AudioIO\deps\build.jl, in expression s tarting on line 29

================================[ BUILD ERRORS ]================================

WARNING: AudioIO had build errors.

  • packages with build errors remain installed in C:\Users\Wouter.julia\v0.3
  • build the package(s) and all dependencies with Pkg.build("AudioIO")
  • build a single package by running its deps/build.jl script

wielrenner avatar Oct 07 '15 13:10 wielrenner

I've also been finding this error. Any guesses on what one should do?

rennis250 avatar Oct 12 '15 13:10 rennis250

Are you running the release version or master? If you're not running the latest master try checking it out with Pkg.checkout("AudioIO"). I fixed the package names to what hopefully are the correct ones, but that hasn't made it into a release yet because I haven't tested it.

ssfrr avatar Oct 13 '15 16:10 ssfrr

It seems that the RPM provider of libportaudio2 does not provide what AudioIO wants? Or is the build script in error somehow?

According to the RPM page at http://rpmfind.net//linux/RPM/opensuse/12.1/i586/portaudio-19-273.1.3.i586.html the RPM provides:

portaudio libportaudio.so.2 portaudio(x86-32)

Is this what AudioIO needs? Or should a different RPM be used?

wherrera10 avatar Oct 28 '15 19:10 wherrera10

Ah, here it is: for Windows to build, there have to be aliases. In build.jl the lines need to change to:

libportaudio = library_dependency("libportaudio", aliases=["libportaudio-2"]) libsndfile = library_dependency("libsndfile", aliases=["libsndfile-1"])

wherrera10 avatar Oct 29 '15 12:10 wherrera10

Great! Thanks for that. Will test soon.

rennis250 avatar Oct 30 '15 11:10 rennis250

Thanks for the windows help, @wherrera10. If this change is confirmed working than I'll merge in #50. (I don't think it should break anything on linux or osx and seems a strict improvement on windows).

Thanks!

Also, so you know, AudioIO.jl is going to be deprecated relatively soon and the functionality broken out into separate packages for audio file I/O, device I/O, and building DSP graphs. (see #48 with some more info) Changes like this will definitely make it into the new packages though, so it's definitely still helpful.

ssfrr avatar Nov 03 '15 19:11 ssfrr

Thanks. I have an interest in device IO with DSP.

I have recently patched portaudio.jl by adding functionality to use other than the default stream. Is the portaudio side already undergoing a lot of revision, so my added functions are not needed?

--Bill

On Tue, Nov 3, 2015 at 9:34 AM, Spencer Russell [email protected] wrote:

Thanks for the windows help, @wherrera10 https://github.com/wherrera10. If this change is confirmed working than I'll merge in #50 https://github.com/ssfrr/AudioIO.jl/pull/50. (I don't think it should break anything on linux or osx and seems a strict improvement on windows).

Thanks!

Also, so you know, AudioIO.jl is going to be deprecated relatively soon and the functionality broken out into separate packages for audio file I/O, device I/O, and building DSP graphs. (see #48 https://github.com/ssfrr/AudioIO.jl/issues/48 with some more info) Changes like this will definitely make it into the new packages though, so it's definitely still helpful.

— Reply to this email directly or view it on GitHub https://github.com/ssfrr/AudioIO.jl/issues/4#issuecomment-153463762.

wherrera10 avatar Nov 03 '15 21:11 wherrera10

There is going to be a lot of revision on the PortAudio side, but it's hard to tell at this point what exactly will be preserved across the transition. Certainly being able to select non-default audio streams would be a great feature to carry over, so I'd welcome the PR.

ssfrr avatar Nov 03 '15 22:11 ssfrr

I was wresting with this error on win64 for a while. Strangely enough I had added the @windows_only directive and the library_dependency aliases which didn't do the trick for me. The recent @windows_only change in master and the two lines proposed by @wherrera10 work as expected.

arnfaldur avatar Jan 28 '16 14:01 arnfaldur

I wanted to offer some Windows DLLs for PortAudio that may be helpful. These are from the Python community, but I suspect these DLLs could work for Julia. Especially important to me is that these builds support WASAPI exclusive mode, and they use a recent version of PortAudio where WASAPI exclusive mode is working. Note that Python wheel files are ZIP format, so I use 7-Zip to extract DLLs from them.

These wheel files contain portaudio_x64.dll (and whatever the name is for 32-bit) compiled with the Microsoft compiler: http://www.lfd.uci.edu/~gohlke/pythonlibs/#sounddevice

The Microsoft compiler version used for each Python version is documented at https://wiki.python.org/moin/WindowsCompilers

These DLLs are built with GCC on Linux: https://github.com/spatialaudio/portaudio-binaries/tree/19.6.0-windows

I have tested the above DLLs on 64-bit Python 3.5 with Windows 8.1.

hiccup7 avatar Dec 04 '16 18:12 hiccup7