Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constant Freezing on Raspberry Pi 3B+ #213

Open
BreakPoints opened this issue May 26, 2019 · 9 comments
Open

Constant Freezing on Raspberry Pi 3B+ #213

BreakPoints opened this issue May 26, 2019 · 9 comments
Labels

Comments

@BreakPoints
Copy link

I've installed the ws281x library from https://github.com/jgarff/rpi_ws281x.git and the included strandtest.py works perfectly but running this projects visualization.py, I am getting constant freezing of both the LEDs and the FPS count, but not always at the same time.

I've setup everything in the config.py file and the LEDs are reacting to the microphone but only for a few seconds, then it freezes for well over a minute with 2-3% CPU usage. I've tried turning down the FPS, turning off the GUI and FPS counter, none of this works. What does help, for some reason, is launching other software. For example launching Chromium kicks the LEDs back into action for quite a while but once Chromium has finished loading up, it doesn't take long for the LEDs to freeze again.

Leaving it running causes the LEDs to intermittently freeze for long periods until eventually it freezes indefinitely.

@LessThanThreeMan
Copy link

LessThanThreeMan commented May 29, 2019

Having the same issue. I may try it with the logic converter tomorrow to see if that helps, but I'm skeptical.

All resources on the Pi seem underutilized. CPU usage is incredibly low, the GUI is off, the whole thing just seems to spontaneously lock up for seemingly no good reason.

It's also worth noting that the LEDs run fine in all test modes.

@BreakPoints
Copy link
Author

I'm already using a logic converter so I don't think that's the problem.

I may have to try some of the forks and see if the issue exists there as well.

@LessThanThreeMan
Copy link

LessThanThreeMan commented May 30, 2019

I'm pretty sure it's something to do with the audio stream more than anything based on the errors I'm starting to get. It runs fine until it hits the end of this string in console.

pi@raspberrypi:~/Downloads/audio-reactive-led-strip-master/python $ sudo python visualization.py
ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Traceback (most recent call last):
File "visualization.py", line 356, in
microphone.start_stream(microphone_update)
File "/home/pi/Downloads/audio-reactive-led-strip-master/python/microphone.py", line 14, in start_stream
frames_per_buffer=frames_per_buffer)
File "/usr/lib/python2.7/dist-packages/pyaudio.py", line 750, in open
stream = Stream(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pyaudio.py", line 441, in init
self._stream = pa.open(**arguments)
IOError: [Errno -9996] Invalid input device (no default output device)

@BreakPoints
Copy link
Author

I've come across someone claiming that these errors don't matter and that they get them and it still works. May have been in reference to just some of the errors, though. I do get the same messages.

@LessThanThreeMan
Copy link

I just can't shake the feeling that the audio isn't reading into the Pi correctly since the code seems to run fine for most people and we know our LEDs are in working order. I'm not terribly familiar with Linux/Raspbian or Python, but checking the audio feed/playback (in terms of the Pi) seems like something worth looking into. The audio passes through to my sound system just fine.

Either that or there's maybe a memory leak in the code? I dunno.

How many pixels are you running by the way?

@BreakPoints
Copy link
Author

Maybe it's a bug with a certain version of the dependencies for reading in audio or doing spectrum analysis.

I'm running 60 LEDs by the way, shouldn't be any issue for the Pi model I'm using.

@DMKOfficial
Copy link

My SD card broke yesterday in my pi 3b+, so i had to reinstall everything and now i have the exact same issue, but i installed it the same way as before and it was working flawlessly for the past months. Any fix so far?

@DMKOfficial
Copy link

DMKOfficial commented Jun 13, 2019

Set LED_DMA = 10 in config.py solved it for me

@BreakPoints
Copy link
Author

DMKOfficial, I never thought about changing the DMA channel!

That's solved the issue for me as well, performance is a little lower than what other people are claiming but no pauses in sight. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants