Reputation: 537
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_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
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
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
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
Upvotes: 1
Views: 5110
Reputation: 378
Sorry for the lack of response on this, I saw your issue on github but didn't know there was a SO question.
Portaudio on ALSA is apparently pretty sensitive about missing the callback deadline, and tends to hang up and peg the CPU at 100%. The latest version of AudioIO (0.1.x) now uses the Read/Write API to portaudio and seems to be much more stable. It also no longer requires the C shim to handle the callback that previous versions did, so it should be easier to install.
Please give it a try and let me know if it works better on your system (though a github issue is definitely a more reliable way to get my attention).
Upvotes: 1