Quantcast
Viewing all articles
Browse latest Browse all 1246

Python • PulseAudio and Root User Headaches

Hi All,
Been working on a PI Camera Project where I use python and the picamera2 library on a PI5 to write a mp4 file with audio. Worked great, until I wanted to create a cron tab to startup the python3 script to capture image/audio into the mp4 file on a reboot.

The problem seems to be with the PulseAudio module. Even though your non-root user that you log in with works fine with PulseAudio, the root user has all sorts of headaches associated with it. The error messages that PulseAudio puts out are just to cryptic/anorexic to do anything with:

default: No Such Process. <-- Does that scream pulse audio did not start for some obvious reason?

When you go to pulse audio's website, they kind of admit that if it works for your regular non root user, it should work for root ... but it doesn't and they beg for a developer to come in an fix it. I guess no one wants to touch that one.

The other way was that they said that users should just install it system wide, but they severely rebuke you if you decide to do it that way because of some of the security flaws.

IMHO Neither of the two caveats are great.

I've been fumbling around with configuration files, at least 100 reboots of the pi, trying this and trying that just to get the = FfmpegOutput(mp4_file, audio=True) to work correctly. If I set audio=False, then of course it will write out the MP4 file, but it just seems like the piCamera2 library is wrapped around the axle with tat PulseAudio library.

I mean where is the script: sh set_pulse_audio_all_users.sh?

Where it goes out and creates the appropriate configuration files so that users like root can start sampling from the microphone.

Has anyone else had to slog through this?

Statistics: Posted by UltimateCodeWarrior — Sat Dec 07, 2024 6:47 am



Viewing all articles
Browse latest Browse all 1246

Trending Articles