0

I am trying to run certain commands at startup to allow my Audio to be FIFO Piped into a file. If i run the commands (either manually or in a script) it works fine. However when i put them in my local crontab -e the commands throw errors.

One example command:

pacmd load-module module-pipe-sink file=/tmp/snapfifo/bt sink_name=Bluetooth format=s16le rate=48000

If I run this from crontab or as sudo I get:

Home directory not acessible No PulseAudio daemon running, or not running as session daemon.

If I run this as sudo with my user (sudo -u USER) in only get this error: No PulseAudio daemon running, or not running as session daemon.

I have been looking for solution for more than 5h on this, and tried loading environments, and user user PATHs but nothing helped. Hope somebody has an idea on how I can actually run the command automatically on startup.

  • read more about dbus and shell environments. – Ipor Sircer Apr 20 '20 at 0:58
0

Found the answer finally:

Script needs the following reference:

export PULSE_RUNTIME_PATH="/run/user/$(id -u)/pulse/"

To check the correct path:

echo ${XDG_RUNTIME_DIR}

Run the script with:

sudo - u USERNAME -H

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.