[Pkg-alsa-devel] Bug#878401: [systemd] Dependency on /tmp not correctly stated for some sound.target (or /tmp/pulse-* shows up underneath my /tmp mount)

Dominick Grift dac.override at gmail.com
Sun Sep 22 16:43:18 BST 2019


On Sun, Sep 22, 2019 at 05:40:14PM +0200, Dominick Grift wrote:
> Setting PULSE_RUNTIME_PATH did not do it for me.
> 
> I borrowed the following from Fedora, and did:
> 
> 1. /etc/udev/rules.d/90-alsa-restore.rules:
> 
> ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", KERNELS!="card*", GOTO="alsa_restore_go"
> GOTO="alsa_restore_end"
> 
> LABEL="alsa_restore_go"
> TEST!="/etc/alsa/state-daemon.conf", RUN+="/usr/sbin/alsactl -E HOME=/run/alsa -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf --initfile=/usr/share/alsa/init/00main restore /dev/$name"
> TEST=="/etc/alsa/state-daemon.conf", RUN+="/usr/sbin/alsactl -E HOME=/run/alsa -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf --initfile=/usr/share/alsa/init/00main nrestore /dev/$name"
> 
> LABEL="alsa_restore_end"
> 
> 2. /etc/systemd/system/alsa-state.service:
> 
> #
> # Note that two different ALSA card state management schemes exist and they
> # can be switched using a file exist check - /etc/alsa/state-daemon.conf .
> #
> 
> [Unit]
> Description=Manage Sound Card State (restore and store)
> Documentation=man:alsactl(1)
> ConditionPathExists=/etc/alsa/state-daemon.conf
> 
> [Service]
> Type=simple
> ExecStart=-/usr/sbin/alsactl -E HOME=/run/alsa -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf --initfile=/usr/share/alsa/init/00main -s -n 19 -c rdaemon
> ExecStop=-/usr/sbin/alsactl -E HOME=/run/alsa -s kill save_and_quit
> 
> 3. /etc/systemd/system/alsa-restore.service:
> 
> #
> # Note that two different ALSA card state management schemes exist and they
> # can be switched using a file exist check - /etc/alsa/state-daemon.conf .
> #
> 
> [Unit]
> Description=Save/Restore Sound Card State
> Documentation=man:alsactl(1)
> ConditionPathExists=!/etc/alsa/state-daemon.conf
> 
> [Service]
> Type=oneshot
> RemainAfterExit=true
> ExecStart=-/usr/sbin/alsactl -E HOME=/run/alsa -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf --initfile=/usr/share/alsa/init/00main restore
> ExecStop=-/usr/sbin/alsactl -E HOME=/run/alsa -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf store
> StandardOutput=syslog
> 
> 
> ... seems to work

Oh and:

4. cat /etc/alsa/alsactl.conf:

ctl.hw {
    @args [ CARD ]
    @args.CARD {
        type string
        default "0"
    }
    type hw
    card $CARD
}

5. cat /etc/alsa/state-daemon.conf:

# Remove this file to disable the alsactl daemon mode
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-alsa-devel/attachments/20190922/2a819993/attachment.sig>


More information about the Pkg-alsa-devel mailing list