0

I am running a python script on a rpi2b + a cirrus logic audio card. I want to iir filter music. I open a stream with pyaudio and have my callback function.

The first (around) 5 seconds it runs fine and then I get this error... Couldnt find anything helpful with google, completely frustrated ^^

What kind of information can I provide you? Where do I turn on debug options and can show you some outputs?

sanj3k
  • 11
  • 6
  • "Underrun" means that your code did not write new samples to the device in time. – CL. Sep 13 '16 at 06:50
  • And how can I fix this? Python too slow? :/ Since the very first seconds it runs good. When measuring the magnitude response it works and filters but after a certain moment it produces this error. If setting up everything on a pc I dont get this error (okay obviously more power but is that it?) – sanj3k Sep 13 '16 at 09:41
  • As a test, remove the actual computation and output a bunch of zero samples (or a sine wave) instead; this should be faster. – CL. Sep 13 '16 at 10:50
  • with the rpi3b I dont have this problem... just throw the 2b away ^^ – sanj3k Sep 13 '16 at 20:59

1 Answers1

0

ALSA Underrun means , you are not giving data to ALSA in proper intervals. ie, your algorithm is not enough fast in rpi2b. So you need to improve your algorithm or you need a faster chip.

jjm
  • 431
  • 3
  • 19