All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: ffado-devel@lists.sourceforge.net, linux-audio-dev@lists.linuxaudio.org
Cc: alsa-devel@alsa-project.org, linux1394-devel@lists.sourceforge.net
Subject: New udev rules for firewire character device are added to systemd
Date: Fri, 23 Apr 2021 20:10:49 +0900	[thread overview]
Message-ID: <20210423111049.GA19333@workstation> (raw)

Hi,

Summary of this message:
 * systemd got udev rules with new database for firewire node/unit
 * then fw character device for audio is owned by 'audio' group with ACL
 * the entries are added by my investigation, thus doesn't cover all
 * if you have firewire audio devices not listed in README of below
   repository, please contact to me with image of configuration ROM:
    * https://github.com/takaswie/am-config-roms/

The way to create image file of configuration ROM is typically:

```
$ cat /sys/bus/firewire/devices/fw1/config_rom > filename.img
```

Here, I presuppose that Linux FireWire subsystem detects your device as
'fw1'.


Well, in the past, access permission of Linux firewire character device
is decided by udev rules just for video devices[1]. This was
inconvenient some project such as ALSA and FFADO to produce audio
application.

The source code of libffado includes own file for udev rules[2] to take
firewire character device owned by 'audio' group. Additionally the rules
gives 'ID_FFADO' tag, and systemd includes another udev rule[3] to ACL
at logging-in time according to it.

As a whole, the above is not comprehensive and self-contained. I
proposed patchset to systemd for better solution and today it was merged.
 * https://github.com/systemd/systemd/pull/19124

In the patchset, I add some udev rules, based on hwdb for new entries of
node and units in IEEE 1394 bus. You can see the database[4].

The entries of database have below variables when matching to either
node or unit devices:
 * IEEE1394_UNIT_FUNCTION_MIDI
 * IEEE1394_UNIT_FUNCTION_AUDIO
 * IEEE1394_UNIT_FUNCTION_VIDEO

The added udev rules interpret the content of variables and decide group
owner of fw character device(see [1]). Furthermore, the variables are
used again to decide ACL in logging-in time(see [3], too).

The entries of database also include below variables:
 * ID_VENDOR_FROM_DATABASE
 * ID_MODEL_FROM_DATABASE

They are expected to use applications such as PipeWire and PulseAudio for
better names of sound device, which binds to unit instead of node. I
expect the variables can obsolete my former patch for pulseaudio[5].


I handy write the entries of database from my investigation, thus
it could includes the lack of your device, or mistakes. I wish you to
contact to me with image file of configuration ROM when you can not find
your device in README of my collection repository[6], or when you find
any mistakes in database file.

Thanks for your cooperation in advance.

[1] 4 rules in 'rules.d/50-udev-default.rules'
https://github.com/systemd/systemd/blob/main/rules.d/50-udev-default.rules.in#L52
[2] many rules in 'libffado/60-ffado.rules'
http://subversion.ffado.org/browser/trunk/libffado/libffado/60-ffado.rules?rev=2794
[3] 'src/login/70-uaccess.rules.m4'
https://github.com/systemd/systemd/blob/main/src/login/70-uaccess.rules.m4
[4] 'hwdb.d/80-ieee1394-unit-function.hwdb'
https://github.com/systemd/systemd/blob/main/hwdb.d/80-ieee1394-unit-function.hwdb
[5] udev: use ID_MODEL/ID_VENDOR to give friendly name for FireWire devices 
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/3ac73598c67c
[6] https://github.com/takaswie/am-config-roms/


Takashi Sakamoto

                 reply	other threads:[~2021-04-23 11:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210423111049.GA19333@workstation \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=ffado-devel@lists.sourceforge.net \
    --cc=linux-audio-dev@lists.linuxaudio.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.