You are not logged in.

#1 2024-01-28 10:07:52

onedayillmakeit
Member
Registered: 2023-10-28
Posts: 14

udev rule works but can't produce sound

I have the following udev entry:

ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="20b1", ATTR{idProduct}=="30a0", RUN+="/etc/apulse-on.sh"

When the USB device is detected the following script is executed:

#!/bin/bash

systemctl start spotifyd &
systemctl start shairport-sync &
systemctl start triggerhappy &
systemctl start mpd &
aplay /root/a.wav &

This successfully starts the daemons, but the aplay command doesn't produce sound. When I execute the script myself as a command line it does play the sound. But not when executed as a udev rule. Any idea why is that? Thank you.

Offline

#2 2024-01-28 10:23:37

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,381

Offline

Board footer

Powered by FluxBB