<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Missing uaccess rule for /dev/snd/seq"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=66861">66861</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Missing uaccess rule for /dev/snd/seq
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>a.c.kalker@gmail.com
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>systemd
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Arch Linux, systemd 204, linux 3.9.9, x86_64

I'm trying to use QSynth (a frontent for fluidsynth) as a virtual synthesizer
to play MIDI output from other software.
I want to run QSynth as regular user, not as a system daemon (which brings all
kinds of issues like JACK setup, use with Pulseaudio, running as "root", etc.)

Starting QSynth as regular user, I get the error:
"Qsynth1: Failed to create the MIDI driver (alsa_seq).

No MIDI input will be available."

Investigating, I found the following:

$ aconnect -o
ALSA lib seq_hw.c:457:(snd_seq_hw_open) open /dev/snd/seq failed: Permission
denied
can't open sequencer

$ id
uid=1000(miki) gid=100(users)
groups=100(users),10(wheel),78(kvm),91(video),150(wireshark),190(systemd-journal),1002(adbusers),1003(networkminer)

(i.e. I'm *not* a member of the audio group, following the advice of
documentation in many places to let systemd handle access to devices.)

$ loginctl seat-status seat0
seat0
    Sessions: *2 1
     Devices:
          ├─/sys/devices/LNXSYSTM:00/LNXPWRBN:00/input/input1
          │ input:input1 "Power Button"
          ├─/sys/device...XSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input0
          │ input:input0 "Power Button"
          ├─/sys/devices/pci0000:00/0000:00:04.0/usb2
          │ usb:usb2
          │ ├─/sys/device.../0000:00:04.0/usb2/2-1/2-1:1.0/input/input3
          │ │ input:input3 "  USB Keyboard"
          │ ├─/sys/device.../0000:00:04.0/usb2/2-1/2-1:1.1/input/input4
          │ │ input:input4 "  USB Keyboard"
          │ └─/sys/device.../0000:00:04.0/usb2/2-2/2-2:1.0/input/input5
          │   input:input5 "Logitech USB Mouse"
          ├─/sys/devices/pci0000:00/0000:00:04.1/usb1
          │ usb:usb1
          ├─/sys/device...0000:00/0000:00:0a.0/0000:01:06.0/sound/card0
          │ sound:card0 "CMI8738"
          ├─/sys/device...0e.0/ata1/host0/target0:0:0/0:0:0:0/block/sr0
          │ block:sr0
          ├─/sys/devices/platform/HDHomeRun.0/dvb/dvb0.demux0
          │ dvb:dvb0.demux0
          ├─/sys/devices/platform/HDHomeRun.0/dvb/dvb0.dvr0
          │ dvb:dvb0.dvr0
          ├─/sys/devices/platform/HDHomeRun.0/dvb/dvb0.frontend0
          │ dvb:dvb0.frontend0
          ├─/sys/devices/platform/HDHomeRun.1/dvb/dvb1.demux0
          │ dvb:dvb1.demux0
          ├─/sys/devices/platform/HDHomeRun.1/dvb/dvb1.dvr0
          │ dvb:dvb1.dvr0
          ├─/sys/devices/platform/HDHomeRun.1/dvb/dvb1.frontend0
          │ dvb:dvb1.frontend0
          ├─/sys/devices/platform/pcspkr/input/input2
          │ input:input2 "PC Speaker"
          ├─/sys/devices/platform/vesafb.0/graphics/fb0
          │ [MASTER] graphics:fb0 "VESA VGA"
          └─/sys/devices/virtual/misc/kvm
            misc:kvm

$ getfacl /dev/snd/pcmC0D0p /dev/snd/midiC0D0 /dev/snd/seq
getfacl: Removing leading '/' from absolute path names
# file: dev/snd/pcmC0D0p
# owner: root
# group: audio
user::rw-
user:miki:rw-
group::rw-
mask::rw-
other::---

# file: dev/snd/midiC0D0
# owner: root
# group: audio
user::rw-
user:miki:rw-
group::rw-
mask::rw-
other::---

# file: dev/snd/seq
# owner: root
# group: audio
user::rw-
group::rw-
other::---

(i.e. I have access to sound playback and "raw" (hardware) MIDI devices, but
not to the sequencer device, needed for virtual MIDI.

I believe an uaccess rule could be added to 71-seat.rules to enable access to
the sequencer, correct?</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>