Closed mpariente closed 4 years ago
It seems that pulseaudio is not configured for your root account. Does the behavior change if you first open a root session with su
, and then call python
?
In general, however, it might be better to give your user access rights to the restricted resource you are using instead of just executing your program as root.
Thanks for your answer.
It seems that pulseaudio is not configured for your root account. Does the behavior change if you first open a root session with
su
, and then callpython
?
It it the same in that case.
In general, however, it might be better to give your user access rights to the restricted resource you are using instead of just executing your program as root.
I also tried something like that but keyboard
doesn't work in this case either. sudo su username -c "command"
also works nice to have sudo
rights and executing as a user. In this case, soundcard
would load but keyboard
would still disagree.
How can I configure pulseaudio for the root account then?
How can I configure pulseaudio for the root account then?
I have no idea, to be honest. As far as I know, Pulse is a local server that your app connects to on a socket. Perhaps you merely need to start the pulseaudio server as root? Or perhaps you need to make the pulseaudio socket available to root via some environment variable?
Thanks, I'll let you know if I find anything !
Hey guys,
I have a similar problem. But I'm running the programm without root or anything. Any idea what could be wrong?
Output ps aux | grep pulseaudio
:
bruno 1944 0.5 0.1 2072620 19824 ? S<sl 14:13 0:05 /usr/bin/pulseaudio --daemonize=no --log-target=journal
bruno 5493 0.0 0.0 9376 2600 pts/1 S+ 14:30 0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox pulseaudio
Output pulseaudio --check; echo $?
: 1
Hi Bastibe,
In some cases, I'd like to use
sudo python
to run my code (if I were to usekeyboard
for example.) however my code freezes at the import.Here is the state when I press
Ctrl + C
Any idea why this would be? Thanks