Many thanks for the input Wim. Sorry to distract you from the work.
My user id is indeed 1000 and $XDG_RUNTIME_DIR is /run/user/1000
where there is a pipewire-0 socket (0 bytes) and a pipewire-0.lock
of the same size.
I ran the line below from the command line first and it worked.
Tried it in the cronjob and it works there too!!
PIPEWIRE_RUNTIME_DIR=/run/user/1000 pw-record /home/john/crontest.wav
The script I was using runs jack_record (for the 'duration').
I added a line like: export PIPEWIRE_RUNTIME_DIR=/run/user/1000
and changed the cronjob accordingly. That works too, so I am sorted.
Sincere thanks to all for the help. I'm still learning much.
John.
On Fri, 9 Jul 2021 14:25:03 +0200 Wim Taymans wrote:
You need to make sure the cron script can find the
local socket to
talk to pipewire.
It searches for the socket named pipewire-0 in:
$PIPEWIRE_RUNTIME_DIR
$XDG_RUNTIME_DIR
$HOME
~/
I'm guessing that the cron script is running with a different user
and/or does not have
the same environment variables as the main pipewire daemon and thus
looks in a different
place and can't find a socket.
Normally the user running the daemon will set
XDG_RUNTIME_DIR=/run/user/1000 and the
socket will be named /run/user/1000/pipewire-0
Substitute 1000 for the user id.
Try this in the cron script:
PIPEWIRE_RUNTIME_DIR=/run/user/1000 pw-record
An try again. I'm pretty sure it's a socket path thing. There is no
dbus, systemd or device permissions
involved. You need to check if the cronjob can find and has
permissions to connect to the socket and
that's it.
Wim
On Wed, 7 Jul 2021 at 17:47, John Murphy <rosegardener(a)freeode.co.uk> wrote:
>
> Could someone please do a simple test on any Pipewire installation
> set up to use/replace Jack (or shed any light on this).
>
> If I run 'pw-record crontest.wav' it works fine, as expected.
> If I run 'pw-cat 2> errrrr.txt' ditto, of course.
>
> If I setup a user cronjob with 'crontab -e' to run the commands
> (at the start of the next minute or so) the first does nothing,
> while the second works.
>
> Cron writes to /var/log/syslog like:
>
> CRON[7694]: (john) CMD (pw-record crontest.wav)
> rtkit-daemon[1277]: Supervising 7 threads of 4 processes of 1 users
>
> (second line repeated)
>
> --
> John (older than 95.6% of the population).
> _______________________________________________
> Linux-audio-dev mailing list
> Linux-audio-dev(a)lists.linuxaudio.org
>
https://lists.linuxaudio.org/listinfo/linux-audio-dev