Enviro+ Noise detection fails with exception

I have reinstalled the Enviro+ software on a new SD card - RPi Lite - the latest Bullseye.

My old software ran fine before but now fails with the following exception (taken from running the noise-amps example script supplied by Pimoroni.

Does anyone have any suggestions about how I can fix this issue?

Traceback (most recent call last):
File “/home/geekytim/Pimoroni/enviroplus/examples/noise-amps-at-freqs.py”, line 3, in
from enviroplus.noise import Noise
File “/home/geekytim/.local/lib/python3.9/site-packages/enviroplus/noise.py”, line 1, in
import sounddevice
File “/home/geekytim/.local/lib/python3.9/site-packages/sounddevice.py”, line 2871, in
File “/home/geekytim/.local/lib/python3.9/site-packages/sounddevice.py”, line 2835, in _initialize
_check(_lib.Pa_Initialize(), ‘Error initializing PortAudio’)
File “/home/geekytim/.local/lib/python3.9/site-packages/sounddevice.py”, line 2745, in _check
raise PortAudioError(errormsg, err, hosterror_info)
sounddevice.PortAudioError: <exception str() failed>

This is running on a headless Pi Zero

Anyone else seeing this?

Found the issue! For some reason, the ~/.asound.rc file was corrupted (contained a character somewhere that should not be there). I deleted it, and it now works!

1 Like