ssfrr / AudioIO.jl

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

“ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred” - Error in julia while trying to play audio #13

Closed dexterdev closed 10 years ago

dexterdev commented 10 years ago

Can someone tell what is this error when trying to play audio in JULIA ? How to solve this? I am using the library AudioIO. And trying to play a sinusoid.

julia> x=sin(0:.01:2_pi_500*5);

julia> using AudioIO

julia> play(x) INFO: Initializing PortAudio. Expect errors as we scan devices ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side bt_audio_service_open: connect() failed: Connection refused (111) bt_audio_service_open: connect() failed: Connection refused (111) bt_audio_service_open: connect() failed: Connection refused (111) bt_audio_service_open: connect() failed: Connection refused (111) ALSA lib pcm_dmix.c:961:(snd_pcm_dmix_open) The dmix plugin supports only playback stream INFO: Launching PortAudio Task... INFO: Audio Task Launched INFO: Audio Task Yielded, starting the stream... INFO: Portaudio stream started. ArrayPlayer(true,[0.0f0,0.009999833f0,0.019998666f0,0.029995501f0,0.039989334f0,0.04997917f0,0.059964005f0,0.06994285f0,0.0799147f0,0.08987855f0 … -0.09313279f0,-0.083171755f0,-0.07320242f0,-0.063225746f0,-0.05324276f0,-0.04325445f0,-0.033261813f0,-0.02326585f0,-0.01326756f0,-0.0032679432f0],1)

julia> ALSA lib pcm.c:7843:(snd_pcm_recover) underrun occurred

ssfrr commented 10 years ago

Hello,

What distribution are you on? I'm assuming Linux, but are you using PulseAudio, or raw ALSA, etc.?

Do you get any audio output at all (pops and clicks, fragments)?

I just tried the code on my Mac and things went as expected (you may want to multiply by 0.2 or something if your speakers are up. Full blast is loud).

dexterdev commented 10 years ago

I am using Linux Mint 16 (Petra cinnamon). I have started using Linux only. So I don't understand PulseAudio, raw ALSA etc. :D But when I tried to play a random signal like rand(44100), it first told PortAudio.h is missing, so I went to synaptic and installed some packages related to audio. After that when I played rand(44100) these errors came, along with the 1 second noise audio. But I was not able to play sinusoid. Also these messages keep on popping on the julia prompt repeatedly.

dexterdev commented 10 years ago

Yes I have installed Pulseaudio and alsaplayer in my computer . And I also get some pops and clicks when playing sinusoid.

ssfrr commented 10 years ago

The latest master now will print out to the console if the Audio task crashes. Can you try again and see if you get an error code when you're not getting sound?

dexterdev commented 10 years ago

I am currently not in touch with julia, but once I get it I will try it, OK :)

ssfrr commented 10 years ago

Sounds like this is a machine-specific issue, so I'm going to go ahead and close it. @dexterdev feel free to re-open if you get back to playing around with Julia and AudioIO and it's still an issue.