# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only

# Provide access to audio devices. It should only be used by audio servers that
# need direct access to them. 

  include <abstractions/audio-client>

  /usr/share/alsa/{,**} r,

  /etc/alsa/conf.d/{,**} r,

  @{run}/udev/data/+sound:card@{int} r,   # for sound card

  @{sys}/class/ r,
  @{sys}/class/sound/ r,

  @{PROC}/asound/** rw,

  /dev/admmidi*   rw,
  /dev/adsp*      rw,
  /dev/aload*     rw,
  /dev/amidi*     rw,
  /dev/audio*     rw,
  /dev/dmfm*      rw,
  /dev/dmmidi*    rw,
  /dev/dsp*       rw,
  /dev/midi*      rw,
  /dev/mixer*     rw,
  /dev/mpu401data rw,
  /dev/mpu401stat rw,
  /dev/patmgr*    rw,
  /dev/phone*     rw,
  /dev/radio*     rw,
  /dev/rmidi*     rw,
  /dev/sequencer  rw,
  /dev/sequencer2 rw,
  /dev/smpte*     rw,

  /dev/snd/       r,
  /dev/snd/*      rw,
  /dev/sound/*    rw,

  include if exists <abstractions/audio-server.d>
