Bug 12382 - Timidity in alsa mode : Permission denied
Summary: Timidity in alsa mode : Permission denied
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Colin Guthrie
QA Contact:
URL:
Whiteboard:
Keywords: NEEDINFO
Depends on:
Blocks:
 
Reported: 2014-01-21 17:07 CET by christian fischer
Modified: 2014-01-25 12:36 CET (History)
2 users (show)

See Also:
Source RPM: systemd
CVE:
Status comment:


Attachments

Description christian fischer 2014-01-21 17:07:12 CET
Description of problem:
Timidity in alsa mode can easily play music with rosegarden , but
from user:

$ timidity -iA -Os
Requested buffer size 32768, fragment size 8192
ALSA pcm 'default' set buffer size 32768, period size 8192 bytes
TiMidity starting in ALSA server mode
ALSA lib seq_hw.c:457:(snd_seq_hw_open) open /dev/snd/seq failed: Permission denied
error in snd_seq_open

from root timidity can play:

$ su -
password

[root@amdA4 ~]# timidity -iA -Os
Requested buffer size 32768, fragment size 8192
ALSA pcm 'default' set buffer size 32768, period size 8192 bytes
TiMidity starting in ALSA server mode
Opening sequencer port: 128:0 128:1 128:2 128:3

Version-Release number of selected component (if applicable):
mageia4 RC

How reproducible:


Steps to Reproduce:
1.
2.
3.


Reproducible: 

Steps to Reproduce:
Comment 1 Thierry Vignaud 2014-01-22 03:36:00 CET
Did you make the mistake to first run a sound app as root?
It can results in sound device no more usable by regular users....

Keywords: (none) => NEEDINFO
CC: (none) => mageia, thierry.vignaud

Comment 2 Colin Guthrie 2014-01-22 09:47:23 CET
Yeah the permissions on /dev/snd/seq are a bit of a problem.

It's not treated like other device nodes, but we *should* (eventually) have a nice way of dealing with this now in the form of the static nodes support in udev.

The /usr/lib/udev/rules.d/50-udev-default.rules file contains:

SUBSYSTEM=="sound", GROUP="audio", \
  OPTIONS+="static_node=snd/seq", OPTIONS+="static_node=snd/timer"


So both snd/seq and snd/timer *should* have ACLs.

On my system it appears only snd/timer does. Does that tally with you?

I've tried changing that rule to:

SUBSYSTEM=="sound", GROUP="audio", OPTIONS+="static_node=snd/seq"
SUBSYSTEM=="sound", GROUP="audio", OPTIONS+="static_node=snd/timer"

but it didn't help.

I'll have to check upstream as to why it's not applying to the snd/seq node.
Comment 3 Colin Guthrie 2014-01-22 10:02:19 CET
OK, so it seems the problem is somewhat simple.

The static nodes stuff in udev should be providing a mechanism to autoload the snd-seq module. Sadly users can only trigger this if they have access to the node and this is where a chicken and egg scenario comes in. The ACL is only applied if the module is loaded, so users cannot trigger the autoload to give themselves permission.

This is ultimately a bug in the static nodes code.

A simply work around in the mean time is adding snd-seq to a *.conf file in /etc/modules-load.d/

Assignee: bugsquad => mageia
Source RPM: timidity ++ ? => systemd

Comment 4 Colin Guthrie 2014-01-22 11:03:42 CET
Actually I lied above. The rule change DOES work, but I spoke to Kay upstream and he's now pushed a fix. Testing that shortly.
Comment 5 Colin Guthrie 2014-01-22 11:11:53 CET
Yup, that works.

Should be fixed in next systemd.
Comment 6 Colin Guthrie 2014-01-25 12:36:50 CET
Freeze push requested.

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.