When trying to use the Speaker pHat on Raspbian 2017-01-11 with Pygame to play an audio file I get a Memory Error related to the sound meter plugin - see error message here.
ALSA lib pcm_meter.c:678:(snd_pcm_meter_add_scope_conf) Cannot open shared library /usr/local/lib/libphatmeter.so
Traceback (most recent call last):
File "pyaudio.py", line 4, in <module>
song = pygame.mixer.Sound('WALLE1.ogg')
MemoryError
If I comment out all the sound meter sections in /etc/asound.conf it works. Is there a bug in the library? I have tried recompiling it and that doesn’t seem to make any difference.
I ran into this today trying to set up a combined Drum HAT/Piano HAT/Speaker pHAT. I’ve not the foggiest clue what’s going on, but “aplay -Dameter filename.wav” plays sounds perfectly fine, whereas anything else trying to open the device fails with the shared library error.
My Google-fu has failed me on this one- finding only issues with Pulse Audio. I just can’t figure out why neither PyGame or PulseAudio can open the shared library, even though it works in all other cases.
Granted, I haven’t spent more than an hour or so looking into it yet, but you’re not alone!