FS#26342 - [libffado] better udev rules

Attached to Project: Arch Linux
Opened by Bernardo Barros (smoge) - Saturday, 08 October 2011, 18:10 GMT
Last edited by Ray Rashif (schivmeister) - Wednesday, 16 November 2011, 11:22 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Ray Rashif (schivmeister)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description: When one installs libffado the user does not have
automatic access to the firewire soundcards it is supposed to support.
Sometimes users just manually change permissions for all firewire devices.

One good solution found by Debian packaging system is to allow just
the devices support by FFADO.

To improve the situation one could add the following to /etc/udev/rules.d

-------8<-------------8<-------------8<-------------8<-------------8<-------------8<------
SUBSYSTEM!="firewire", GOTO="ffado_end"

ATTR{vendor}=="0x000166", GROUP="audio", ENV{ID_FFADO}="1" # TC GROUP A/S
ATTR{vendor}=="0x0001f2", GROUP="audio", ENV{ID_FFADO}="1" # Mark of the Unicorn, Inc.
ATTR{vendor}=="0x0003db", GROUP="audio", ENV{ID_FFADO}="1" # Apogee Electronics Corp.
ATTR{vendor}=="0x000595", GROUP="audio", ENV{ID_FFADO}="1" # Alesis Corporation
ATTR{vendor}=="0x0007f5", GROUP="audio", ENV{ID_FFADO}="1" # Bridgeco Co AG
ATTR{vendor}=="0x000a92", GROUP="audio", ENV{ID_FFADO}="1" # Presonus Corporation
ATTR{vendor}=="0x000aac", GROUP="audio", ENV{ID_FFADO}="1" # TerraTec Electronic GmbH
ATTR{vendor}=="0x000d6c", GROUP="audio", ENV{ID_FFADO}="1" # M-Audio
ATTR{vendor}=="0x000f1b", GROUP="audio", ENV{ID_FFADO}="1" # Ego Systems Inc.
ATTR{vendor}=="0x000ff2", GROUP="audio", ENV{ID_FFADO}="1" # Loud Technologies Inc.
ATTR{vendor}=="0x001260", GROUP="audio", ENV{ID_FFADO}="1" # Stanton Magnetics,inc.
ATTR{vendor}=="0x00130e", GROUP="audio", ENV{ID_FFADO}="1" # Focusrite Audio Engineering Limited
ATTR{vendor}=="0x001486", GROUP="audio", ENV{ID_FFADO}="1" # Echo Digital Audio Corporation
ATTR{vendor}=="0x001564", GROUP="audio", ENV{ID_FFADO}="1" # BEHRINGER Spezielle Studiotechnik GmbH
ATTR{vendor}=="0x001c2d", GROUP="audio", ENV{ID_FFADO}="1" # FlexRadio Systems
ATTR{vendor}=="0x001c6a", GROUP="audio", ENV{ID_FFADO}="1" # Weiss Engineering Ltd.
ATTR{vendor}=="0x0040ab", GROUP="audio", ENV{ID_FFADO}="1" # ROLAND DG CORPORATION

# The devices below abuse another Vendor's ID, and therefore we need more advanced rules for those.

ATTR{vendor}=="0x00000a", ATTR{model}=="0x030000", ATTR{units}=="*0x00a02d:0x010001*", GROUP="audio", ENV{ID_FFADO}="1" # CME, Matrix K FW
ATTR{vendor}=="0x00000f", ATTR{model}=="0x01006?", ATTR{units}=="*0x00a02d:0x010001*", GROUP="audio", ENV{ID_FFADO}="1" # Mackie, Onyx Firewire
ATTR{vendor}=="0x000a35", ATTR{units}=="0x000a35:0x00000[12]", GROUP="audio", ENV{ID_FFADO}="1" # RME

LABEL="ffado_end"
-------8<-------------8<-------------8<-------------8<-------------8<-------------8<------
This task depends upon

Closed by  Ray Rashif (schivmeister)
Wednesday, 16 November 2011, 11:22 GMT
Reason for closing:  Implemented
Comment by Bernardo Barros (smoge) - Saturday, 08 October 2011, 18:14 GMT
It also could have a message about including the firewire stack modules to the MODULES array in /etc/rc.conf:

MODULES=(firewire-core firewire-ohci)

Comment by Bernardo Barros (smoge) - Saturday, 08 October 2011, 19:01 GMT Comment by Ray Rashif (schivmeister) - Saturday, 08 October 2011, 19:24 GMT
After the migration to the new stack I deprecated the previous one-liner firewire rule, and did not adopt a new set of rules (this existed back then as well), as upstream did not merge this. However, enough time has passed, and upstream appears to depend on distributors to do this, so I say +1 now.
Comment by Ray Rashif (schivmeister) - Saturday, 08 October 2011, 21:34 GMT
Err..sorry. This is to be shipped with ffado, not udev. My bad.
Comment by Tom Gundersen (tomegun) - Sunday, 09 October 2011, 01:00 GMT
@Ray: My two cents even if it is not assigned to me:

Requiring all users to be in the audio group in order to use sound is not a very good approach (you probably don't want that any user should be able to listen to the microphone remotely). The audio group is mostly a legacy/fallback solution for users who don't use ACL. The "correct" solution would be for consolekit (or systemd if you are so inclined) to manage the ACL's for you and grant permissions to whoever is active local user.

The attached rules file might still be a good starting point though, as it will provide the fallback group assignment, and the ID_FFADO flag could be used by whoever deals with the ACLs. It's a bit weird that upstream does not want to maintain this though, surely they should know best what exactly should go in these lists...?
Comment by Bernardo Barros (smoge) - Sunday, 09 October 2011, 01:50 GMT
FFADO is used only by JACK, there is no ALSA support for firewire, thus no PulseAudio either. JACK also requires the user to be in the audio group anyway, see  FS#26343  [1], otherwise it will not work properly.

[1] https://bugs.archlinux.org/task/26343?project=1&order=dateopened&sort=desc

Comment by Ray Rashif (schivmeister) - Sunday, 09 October 2011, 05:05 GMT
Tom: Yes, in general, I know where you're coming from. This would have to do until there is a long-term solution for all these permissions to operate external devices. Anyway, this one is only for one particular group of devices, i.e sound devices supported by the ffado driver, so these will only affect those who install the package.
Comment by Ray Rashif (schivmeister) - Thursday, 13 October 2011, 03:56 GMT
Please test -4 in [testing].
Comment by Ray Rashif (schivmeister) - Saturday, 05 November 2011, 07:32 GMT
  • Field changed: Status (Assigned → Requires Testing)
Someone with a firewire device should test this (I don't have one). The packages have been in [testing] for over 2 weeks so it's time I moved them.
Comment by Bernardo Barros (smoge) - Tuesday, 08 November 2011, 07:55 GMT
I have 2 firewire soundcards but they are only supported by ffado-svn.

Loading...