alsa: Suppress udev detection of sound card for some units on IEEE 1394 bus
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sun, 15 Jul 2018 10:57:35 +0000 (19:57 +0900)
committerTanu Kaskinen <tanuk@iki.fi>
Sat, 11 Aug 2018 10:10:03 +0000 (13:10 +0300)
commit37358e42c49abe3d83b344452749461b70fdc80f
tree865c55c66b709c42a768fb36a3857c1c0cc9fab9
parenta8ebd9d6ee45b9b6fe4ab99e9bf677dd97ccb5b2
alsa: Suppress udev detection of sound card for some units on IEEE 1394 bus

A bug was filed to bugzilla.kernel.org for a quirk of some models which
ALSA BeBoB driver supports.

Bug 199365 - repeating bus resets on Firewire bus with Focusrite Saffaire 26/io
https://bugzilla.kernel.org/show_bug.cgi?id=199365

Some models (two models as long as I know) have a quirk to disappear from
IEEE 1394 bus at disconnections of packet streaming. Corresponding
character devices are removed according to 'remove' callbacks of relevant
drivers from Linux dd core. Then the models re-appear on the bus by
generating bus resets and corresponding character devices are added
according to 'probe' callbacks from Linux dd core.

In a view of ALSA applications, this looks that plug-out/plug-in occur in
a sequential order for the models when they stop playback/capture substream.
For most applications, this doesn't cause large issue. However, this quirk
is not good for combination of below modules in PulseAudio. PulseAudio
enters endless loop to detect the models and start/stop PCM substream.
 - module-udev-detect
 - module-alsa-card
 - module-suspend-on-idle

In detail, please read my comment no.6:
https://bugzilla.kernel.org/show_bug.cgi?id=199365#c6

This commit suppressed udev detection of sound card for the issued models.
For the models, 'PULSE_IGNORE' flag is added to udev rules, then
module-udev-detect don't handle the models and PulseAudio never uses the
models automatically. In a scenario for users to load
module-alsa-card/module-alsa-sink/module-alsa-source by hand, although
these modules can still stop PCM substreams with module-suspend-on-idle,
PulseAudio never enters the endless loop because udev detection doesn't
work for the models. In this case, as long as special files for ALSA
character devices for these models are the same, corresponding sinks and
sources are available even if the voluntary plug-out/plug-in occur.

(Focusrite Saffire Pro 10 i/o with systemd 237)
$ udevadm info -q all -p /devices/pci0000:00/0000:00:07.0/fw1/fw1.0/sound/card1
P: /devices/pci0000:00/0000:00:07.0/fw1/fw1.0/sound/card1
E: DEVPATH=/devices/pci0000:00/0000:00:07.0/fw1/fw1.0/sound/card1
E: ID_BUS=firewire
E: ID_FOR_SEAT=sound-pci-0000_00_07_0
E: ID_ID=firewire-0x00130e01000606e0
E: ID_MODEL=Pro10IO
E: ID_MODEL_FROM_DATABASE=XIO2213A/B/XIO2221 IEEE-1394b OHCI Controller [Cheetah Express]
E: ID_MODEL_ID=0x000006
E: ID_PATH=pci-0000:00:07.0
E: ID_PATH_TAG=pci-0000_00_07_0
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_INTERFACE_FROM_DATABASE=OHCI
E: ID_PCI_SUBCLASS_FROM_DATABASE=FireWire (IEEE 1394)
E: ID_SERIAL=0x00130e01000606e0
E: ID_SERIAL_SHORT=0x00130e01000606e0
E: ID_VENDOR=Focusrite
E: ID_VENDOR_FROM_DATABASE=Texas Instruments
E: ID_VENDOR_ID=0x00130e
E: SOUND_INITIALIZED=1
E: SUBSYSTEM=sound
E: SYSTEMD_WANTS=sound.target
E: TAGS=:systemd:seat:
E: USEC_INITIALIZED=957089064

(Focusrite Saffire Pro 26 i/o with systemd 237)
$ udevadm info -q all -p /devices/pci0000:00/0000:00:07.0/fw1/fw1.0/sound/card1
P: /devices/pci0000:00/0000:00:07.0/fw1/fw1.0/sound/card1
E: DEVPATH=/devices/pci0000:00/0000:00:07.0/fw1/fw1.0/sound/card1
E: ID_BUS=firewire
E: ID_FOR_SEAT=sound-pci-0000_00_07_0
E: ID_ID=firewire-0x00130e0100030cdd
E: ID_MODEL=Pro26IO
E: ID_MODEL_FROM_DATABASE=XIO2213A/B/XIO2221 IEEE-1394b OHCI Controller [Cheetah Express]
E: ID_MODEL_ID=0x000003
E: ID_PATH=pci-0000:00:07.0
E: ID_PATH_TAG=pci-0000_00_07_0
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_INTERFACE_FROM_DATABASE=OHCI
E: ID_PCI_SUBCLASS_FROM_DATABASE=FireWire (IEEE 1394)
E: ID_SERIAL=0x00130e0100030cdd
E: ID_SERIAL_SHORT=0x00130e0100030cdd
E: ID_VENDOR=Focusrite
E: ID_VENDOR_FROM_DATABASE=Texas Instruments
E: ID_VENDOR_ID=0x00130e
E: SOUND_INITIALIZED=1
E: SUBSYSTEM=sound
E: SYSTEMD_WANTS=sound.target
E: TAGS=:systemd:seat:
E: USEC_INITIALIZED=1071026684

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules