digego / extempore

A cyber-physical programming environment
1.4k stars 127 forks source link

Extempore directs all informative error messages from audio layer to /dev/null #160

Open giorashh opened 9 years ago

giorashh commented 9 years ago
$ ./extempore --print-devices                              
<...>
audio device[5]:system api[2]:JACK Audio Connection Kit inchan[2] outchan[8]

$ ./extempore --device 5
------------- Extempore -------------- 
Andrew Sorensen (c) 2010-2014
andrew@moso.com.au, @digego

ARCH           : x86_64-unknown-linux-gnu
CPU            : 
ATTRS          : 
Invalid stream pointer
Invalid stream pointer

This happens when the sample rate set for JACK does not match extempore's hardcoded 44100.

giorashh commented 9 years ago

I see now that extempore ----samplerate is all it takes, so the real issue is only there's no meaningful error message.

AudioDevice::start() reports the error to std::cerr when Pa_OpenStream fails, but on non-windows main redirects std:cerr to /dev/null very early, so the user never sees the error message telling him what went wrong.

portaudio's probing process is very noisy and can't be redirected, which I guess is why output is supressed I'm guessing this is the reason this got supressed. Still, I was fooled into thinking JACK support was broken by the missing error message and there must be some way to do better.

rekado commented 9 years ago

I ran into the same issue and assumed that JACK support was broken. It would be helpful if a nicer error was printed that mentioned the sample rate settings.

benswift commented 9 years ago

Yep, this should print a more informative error. Do you have a patch handy? If not, I'll look into it when I have the time.

rekado notifications@github.com writes:

I ran into the same issue and assumed that JACK support was broken. It would be helpful if a nicer error was printed that mentioned the sample rate settings.


Reply to this email directly or view it on GitHub: https://github.com/digego/extempore/issues/160#issuecomment-122595370