On Fri, Jan 24, 2025 at 15:37:56 +0100, Roger Price wrote: > I added export PULSE_RUNTIME_PATH="/run/user/$(id -u)/pulse" to bark.sh . > File /run/user/2108/pulse contains value 1309 and command > > rprice@maria ~ ps -ef | grep pulse > rprice 1309 1293 0 2024 ? 05:45:10 /usr/bin/pulseaudio > --daemonize=no --log-target=journal > > confirms that this is pulseaudio. But I still do not hear any sound from the > cron job, which reports > > From: Cron Daemon <r...@maria.rogerprice.org> > Subject: Cron <rprice@maria> /mnt/home/rprice/bark/bark.sh S45 > > ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave > aplay: main:831: audio open error: Device or resource busy
Hmm. Mine is using pipewire-pulse, not pure pulseaudio, so I'm not sure whether I can properly reproduce your results. Nonetheless, I note the following: 1) I do not have any environment variables with PULSE in them. 2) At least one of my environment variables is required: hobbit:~$ aplay /usr/share/sounds/alsa/Side_Left.wav Playing WAVE '/usr/share/sounds/alsa/Side_Left.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono hobbit:~$ env - aplay /usr/share/sounds/alsa/Side_Left.wav ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave aplay: main:831: audio open error: No such file or directory So then the question is *which* environment variable it is. I would suspect it's one of the XDG_ variables, but I'm not in the mood to go through them one by one to see which one makes the audio start working. You might try that, though, if you're so inclined. Just do a series of commands like env - XDG_SEAT=... aplay myfile using your own variables (as reported by env | sort) and see what you get.