[alsa-devel] [PATCH] 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 --- .../alsa/mixer/profile-sets/90-pulseaudio.rules | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules b/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules index ceb61d9e5..19b826b52 100644 --- a/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules +++ b/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules @@ -19,6 +19,7 @@ SUBSYSTEM!="sound", GOTO="pulseaudio_end" ACTION!="change", GOTO="pulseaudio_end" KERNEL!="card*", GOTO="pulseaudio_end" SUBSYSTEMS=="usb", GOTO="pulseaudio_check_usb" +SUBSYSTEMS=="firewire", GOTO="pulseaudio_firewire_quirk"
SUBSYSTEMS=="platform", DRIVERS=="thinkpad_acpi", ENV{PULSE_IGNORE}="1"
@@ -109,4 +110,13 @@ ATTRS{idVendor}=="1038", ATTRS{idProduct}=="1250", ENV{PULSE_PROFILE_SET}="steel ATTRS{idVendor}=="1038", ATTRS{idProduct}=="1260", ENV{PULSE_PROFILE_SET}="steelseries-arctis-7-usb-audio.conf" ATTRS{idVendor}=="147a", ATTRS{idProduct}=="e055", ENV{PULSE_PROFILE_SET}="cmedia-high-speed-true-hdaudio.conf"
+GOTO="pulseaudio_end" + +LABEL="pulseaudio_firewire_quirk" + +# Focusrite Saffire Pro 10/26 i/o has a quirk to disappear from IEEE 1394 bus when losing connections. +# https://bugzilla.kernel.org/show_bug.cgi?id=199365 +ENV{ID_VENDOR_ID}=="0x00130e", ENV{ID_MODEL_ID}=="0x000003", ENV{PULSE_IGNORE}="1" +ENV{ID_VENDOR_ID}=="0x00130e", ENV{ID_MODEL_ID}=="0x000006", ENV{PULSE_IGNORE}="1" + LABEL="pulseaudio_end"
On Sun, 2018-07-15 at 19:57 +0900, Takashi Sakamoto wrote:
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
.../alsa/mixer/profile-sets/90-pulseaudio.rules | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules b/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules index ceb61d9e5..19b826b52 100644 --- a/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules +++ b/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules @@ -19,6 +19,7 @@ SUBSYSTEM!="sound", GOTO="pulseaudio_end" ACTION!="change", GOTO="pulseaudio_end" KERNEL!="card*", GOTO="pulseaudio_end" SUBSYSTEMS=="usb", GOTO="pulseaudio_check_usb" +SUBSYSTEMS=="firewire", GOTO="pulseaudio_firewire_quirk"
SUBSYSTEMS=="platform", DRIVERS=="thinkpad_acpi", ENV{PULSE_IGNORE}="1"
@@ -109,4 +110,13 @@ ATTRS{idVendor}=="1038", ATTRS{idProduct}=="1250", ENV{PULSE_PROFILE_SET}="steel ATTRS{idVendor}=="1038", ATTRS{idProduct}=="1260", ENV{PULSE_PROFILE_SET}="steelseries-arctis-7-usb-audio.conf" ATTRS{idVendor}=="147a", ATTRS{idProduct}=="e055", ENV{PULSE_PROFILE_SET}="cmedia-high-speed-true-hdaudio.conf"
+GOTO="pulseaudio_end"
+LABEL="pulseaudio_firewire_quirk"
+# Focusrite Saffire Pro 10/26 i/o has a quirk to disappear from IEEE 1394 bus when losing connections. +# https://bugzilla.kernel.org/show_bug.cgi?id=199365 +ENV{ID_VENDOR_ID}=="0x00130e", ENV{ID_MODEL_ID}=="0x000003", ENV{PULSE_IGNORE}="1" +ENV{ID_VENDOR_ID}=="0x00130e", ENV{ID_MODEL_ID}=="0x000006", ENV{PULSE_IGNORE}="1"
LABEL="pulseaudio_end"
Thanks! Applied.
participants (2)
-
Takashi Sakamoto
-
Tanu Kaskinen