As python packages, add pulseaudio as a plug and have a working system. Seems sound in a python snap is a bit tricky, can anyone tell me in broad terms what I’d need to do to get things working?
Currently, attempting to run google’s push to talk sample produces this error:
Traceback (most recent call last):
File “/snap/ga-matt-test/x12/bin/googlesamples-assistant-pushtotalk”, line 7, in
from googlesamples.assistant.grpc.pushtotalk import main
File “/snap/ga-matt-test/x12/lib/python3.5/site-packages/googlesamples/assistant/grpc/pushtotalk.py”, line 32, in
from . import (
File “/snap/ga-matt-test/x12/lib/python3.5/site-packages/googlesamples/assistant/grpc/audio_helpers.py”, line 25, in
import sounddevice as sd
File “/snap/ga-matt-test/x12/lib/python3.5/site-packages/sounddevice.py”, line 2678, in
_initialize()
File “/snap/ga-matt-test/x12/lib/python3.5/site-packages/sounddevice.py”, line 2634, in _initialize
_check(_lib.Pa_Initialize(), ‘Error initializing PortAudio’)
ffi.error: symbol ‘Pa_Initialize’ not found in library ‘’: /snap/ga-matt-test/x12/usr/bin/python3: undefined symbol: Pa_Initialize
Also, feel free to post your snapcraft.yaml for us to help with. Make sure to paste it inside three backticks so it shows as code - then it’s easier to copy/paste. Also note you may need to set some environment variables for pulse to work but as ogra suggests, add libpulse0 to stage packages first.
And a launcher which sets the environment. Line 14 (and the if chunk above it) are needed. You’ll also need to change the launcher for your app to launch the app via the launcher. The pulsemixer snap should help there.
I tried all that over the weekend and it doesn’t seem to work. The actual error I posted is about PortAudio which means I’m running into problems earlier than pulseaudio’s involvement (I assume but TBH I’m guessing, so far I’ve managed to avoid having anything to do with sound).
I’ve also tried adding a part for portaudio and I can see it sitting in /lib and /usr/lib but I’m still getting the same problem.
Is it possible that I need to build the assistant stuff myself rather than using the versions pip installs?