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.