ssfrr / AudioIO.jl

[UNMAINTAINED] - Simple Audio IO in Julia
MIT License
61 stars 24 forks source link

The play()-function is broken #41

Closed flpf closed 9 years ago

flpf commented 9 years ago

After updating julia and the AudioIO-package the play()-function stopped working correctly. If I do a

using AudioIO
play(SinOsc(440))

I only hear the first ~100ms of the sound. When calling play() again nothing is played even though i don't receive an error message. If I load a stream manually

stre=AudioIO.Pa_openDefaultStream(0,2,convert(AudioIO.PaSampleFormat,0x01),48000,1024)
Audio().Pa_StartStream(stre)
AudioIO.Pa_WriteStream(stre,convert(Array{Float32},sin(2*pi*220*[1:1024]/48000)))

I get the same effect. The first write gives me a short beep subsequent writes are mute. My julia version is

julia> versioninfo()
Julia Version 0.4.0-dev+1701
Commit 6a3763e* (2014-11-20 09:16 UTC)
Platform Info:
  System: Linux (x86_64-unknown-linux-gnu)
  CPU: Intel(R) Core(TM) i5-2467M CPU @ 1.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3

My portaudio version is

PortAudio V19-devel (built Jan 31 2014 21:19:35)%

and my alsa version is

Advanced Linux Sound Architecture Driver Version k3.17.3-1-ARCH.

I would be thankful for any pointers, ideas...

P.S.: Calling portaudio from a C program works fine.

flpf commented 9 years ago

I finally had some time to look into this and found that it was caused by an entry in my ~/.asoundrc file. I had an alsa-preamp activated running as the default pcm-device, deleting this entry solved my problems. I am not shure how this affected the portaudio playback from julia because playing portaudio from other applications worked just fine.

ssfrr commented 9 years ago

Glad to hear you worked it out. Thanks for letting me know and closing out the issue!