Answer the question
In order to leave comments, you need to log in
How to "unmute" sound on Raspberry Pi for root?
Such a situation - sawing a small script in Python + PyAudio under the Raspberry Pi. Everything works fine under pi user. I wanted to automate the launch of the script on the supervisor - there is no sound. Mistakes too. I googled problems with the supervisor for a long time, but it turned out that I was looking in the wrong place. Found a hint that the root user may not have permission to access audio. I ran the script with sudo python myscript.py - for sure, there is no sound (it works silently and without errors like in the supervisor).
Actually the question is: how to "enable" the sound for the root user. I tried to add a group to the audio - without result (audio: x: 29: pi, pulse, root)
Any other ideas?
Answer the question
In order to leave comments, you need to log in
Everything turned out to be simple. I just wasn't looking there.
Default output device for root was different. For the pi user, I set the required one in GUI mode a long time ago, when I was not going to try pyaudio. Pyaudio kindly picked up the default sound device (for the pi, this is an external USB sound card). For root, of course, nothing was configured and in default there was something else, perhaps a native audio output. It helped to manually set the desired device through output_device_index
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question