Bug 804736

Summary: udev does not add proper human readable description for FireWire audio devices
Product: [Fedora] Fedora Reporter: Jay Fenlason <fenlason>
Component: udevAssignee: udev-maint
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: harald, jfeeney, jonathan, udev-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-14 00:01:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
read firewire device descriptions none

Description Jay Fenlason 2012-03-19 17:22:00 UTC
Description of problem:
When I use a FireWire audio device, PulseAudio insists on calling the device "TSB43AB22A IEEE-1394a-2000 Controller ( PHY/Link ) [iOHCI-Lynx]" rather than something useful like "Griffin FireWave Surround".  It turns out that TSB43AB22A... is the host controller that the audio device is connected to, and udev_device_new_from_syspath() of /sys/class/sound/card2 (which is a symlink: /sys/class/sound/card2 -> ../../devices/pci0000:00/0000:00:1e.0/0000:10:02.0/fw1/fw1.0/sound/card2 ) returns information about the host controller rather than the FireWire device.  This is ok, if confusing, if you only have one FireWire sound device attached.  When you attach a second one, PulseAudio sees that both of them have the same host controller and thinks they are the same device.

Version-Release number of selected component (if applicable):
udev-173-3.fc16.x86_64

How reproducible:
Always.

Steps to Reproduce:
1.Install a FireWire sound device (say a Griffin FireWave Surround as supported by snd-firewire-speakers)
2.Start pavucontrol and look at the names of your sound devices.
3.Plug in a second FireWire sound device (say an iSight or a pair of LaCie FireWire speakers)
4. Note that pavucontrol is now helplessly confused.
  
Actual results:
Attempts to get udev information about firewire devices get information about the host controller instead.

Expected results:
Information about the attached firewire devices.

Additional info:

Comment 1 Kay Sievers 2012-03-19 18:06:41 UTC
Please paste the output of:
  $ udevadm info --query=property --name=/dev/snd/controlC0

  $ udevadm info --attribute-walk --name=/dev/snd/controlC0

  $ udevadm info --query=property --path=/sys/class/sound/card0

with 0 replaced with the right current number of your card.

Comment 2 Jay Fenlason 2012-03-19 18:31:04 UTC
Here's the output for both FireWire devices.  The iSight came up as C2, and the FireWave came up as C3.

[hack@precision ~]$ udevadm info --query=property --name=/dev/snd/controlC2
UDEV_LOG=3
DEVPATH=/devices/pci0000:00/0000:00:1e.0/0000:10:02.0/fw1/fw1.1/sound/card2/controlC2
MAJOR=116
MINOR=13
DEVNAME=/dev/snd/controlC2
SUBSYSTEM=sound
ID_PATH=pci-0000:10:02.0
ID_PATH_TAG=pci-0000_10_02_0
DEVLINKS=/dev/snd/by-path/pci-0000:10:02.0
TAGS=:uaccess:
[hack@precision ~]$ udevadm info --attribute-walk --name=/dev/snd/controlC2

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:1e.0/0000:10:02.0/fw1/fw1.1/sound/card2/controlC2':
    KERNEL=="controlC2"
    SUBSYSTEM=="sound"
    DRIVER==""

  looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:10:02.0/fw1/fw1.1/sound/card2':
    KERNELS=="card2"
    SUBSYSTEMS=="sound"
    DRIVERS==""
    ATTRS{id}=="iSight"
    ATTRS{number}=="2"

  looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:10:02.0/fw1/fw1.1':
    KERNELS=="fw1.1"
    SUBSYSTEMS=="firewire"
    DRIVERS=="snd_isight"
    ATTRS{rom_index}=="23"
    ATTRS{specifier_id}=="0x000a27"
    ATTRS{version}=="0x000010"
    ATTRS{model}=="0x000008"
    ATTRS{model_name}=="iSight"

  looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:10:02.0/fw1':
    KERNELS=="fw1"
    SUBSYSTEMS=="firewire"
    DRIVERS==""
    ATTRS{guid}=="0x000a2700040239a9"
    ATTRS{units}=="0x00a02d:0x000102 0x000a27:0x000010 0x000a27:0x000011 0x000a27:0x000012"
    ATTRS{vendor}=="0x080007"
    ATTRS{model}=="0x000008"
    ATTRS{vendor_name}=="Apple Computer, Inc."
    ATTRS{model_name}=="iSight"

  looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:10:02.0':
    KERNELS=="0000:10:02.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="firewire_ohci"
    ATTRS{vendor}=="0x104c"
    ATTRS{device}=="0x8023"
    ATTRS{subsystem_vendor}=="0x103c"
    ATTRS{subsystem_device}=="0x12f1"
    ATTRS{class}=="0x0c0010"
    ATTRS{irq}=="16"
    ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000f"
    ATTRS{local_cpulist}=="0-3"
    ATTRS{numa_node}=="-1"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}==""

  looking at parent device '/devices/pci0000:00/0000:00:1e.0':
    KERNELS=="0000:00:1e.0"
    SUBSYSTEMS=="pci"
    DRIVERS==""
    ATTRS{vendor}=="0x8086"
    ATTRS{device}=="0x244e"
    ATTRS{subsystem_vendor}=="0x0000"
    ATTRS{subsystem_device}=="0x0000"
    ATTRS{class}=="0x060400"
    ATTRS{irq}=="0"
    ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000f"
    ATTRS{local_cpulist}=="0-3"
    ATTRS{numa_node}=="-1"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}=="1"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

[hack@precision ~]$ udevadm info --query=property --path=/sys/class/sound/card2
UDEV_LOG=3
DEVPATH=/devices/pci0000:00/0000:00:1e.0/0000:10:02.0/fw1/fw1.1/sound/card2
SUBSYSTEM=sound
ID_PATH=pci-0000:10:02.0
ID_PATH_TAG=pci-0000_10_02_0
ID_FOR_SEAT=sound-pci-0000_10_02_0
SOUND_INITIALIZED=1
ID_VENDOR_FROM_DATABASE=Texas Instruments
ID_MODEL_FROM_DATABASE=TSB43AB22A IEEE-1394a-2000 Controller (PHY/Link) [iOHCI-Lynx]
ID_BUS=pci
ID_VENDOR_ID=0x104c
ID_MODEL_ID=0x8023
SYSTEMD_WANTS=sound.target
TAGS=:seat:systemd:
[hack@precision ~]$ udevadm info --query=property --name=/dev/snd/controlC3
UDEV_LOG=3
DEVPATH=/devices/pci0000:00/0000:00:1e.0/0000:10:02.0/fw2/fw2.0/sound/card3/controlC3
MAJOR=116
MINOR=15
DEVNAME=/dev/snd/controlC3
SUBSYSTEM=sound
ID_PATH=pci-0000:10:02.0
ID_PATH_TAG=pci-0000_10_02_0
DEVLINKS=/dev/snd/by-path/pci-0000:10:02.0
TAGS=:uaccess:
[hack@precision ~]$ udevadm info --attribute-walk --name=/dev/snd/controlC3

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:1e.0/0000:10:02.0/fw2/fw2.0/sound/card3/controlC3':
    KERNEL=="controlC3"
    SUBSYSTEM=="sound"
    DRIVER==""

  looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:10:02.0/fw2/fw2.0/sound/card3':
    KERNELS=="card3"
    SUBSYSTEMS=="sound"
    DRIVERS==""
    ATTRS{id}=="FireWave"
    ATTRS{number}=="3"

  looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:10:02.0/fw2/fw2.0':
    KERNELS=="fw2.0"
    SUBSYSTEMS=="firewire"
    DRIVERS=="snd_firewire_speakers"
    ATTRS{rom_index}=="12"
    ATTRS{specifier_id}=="0x00a02d"
    ATTRS{version}=="0x010001"
    ATTRS{model}=="0x00f970"
    ATTRS{model_name}=="Griffin FireWave Surround"

  looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:10:02.0/fw2':
    KERNELS=="fw2"
    SUBSYSTEMS=="firewire"
    DRIVERS==""
    ATTRS{guid}=="0x0012920600520481"
    ATTRS{units}=="0x00a02d:0x010001"
    ATTRS{vendor}=="0x001292"
    ATTRS{model}=="0x00f970"
    ATTRS{vendor_name}=="Griffin Technology"
    ATTRS{model_name}=="FireWave"

  looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:10:02.0':
    KERNELS=="0000:10:02.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="firewire_ohci"
    ATTRS{vendor}=="0x104c"
    ATTRS{device}=="0x8023"
    ATTRS{subsystem_vendor}=="0x103c"
    ATTRS{subsystem_device}=="0x12f1"
    ATTRS{class}=="0x0c0010"
    ATTRS{irq}=="16"
    ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000f"
    ATTRS{local_cpulist}=="0-3"
    ATTRS{numa_node}=="-1"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}==""

  looking at parent device '/devices/pci0000:00/0000:00:1e.0':
    KERNELS=="0000:00:1e.0"
    SUBSYSTEMS=="pci"
    DRIVERS==""
    ATTRS{vendor}=="0x8086"
    ATTRS{device}=="0x244e"
    ATTRS{subsystem_vendor}=="0x0000"
    ATTRS{subsystem_device}=="0x0000"
    ATTRS{class}=="0x060400"
    ATTRS{irq}=="0"
    ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,0000000f"
    ATTRS{local_cpulist}=="0-3"
    ATTRS{numa_node}=="-1"
    ATTRS{dma_mask_bits}=="32"
    ATTRS{consistent_dma_mask_bits}=="32"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}=="1"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

[hack@precision ~]$ udevadm info --query=property --path=/sys/class/sound/card3
UDEV_LOG=3
DEVPATH=/devices/pci0000:00/0000:00:1e.0/0000:10:02.0/fw2/fw2.0/sound/card3
SUBSYSTEM=sound
ID_PATH=pci-0000:10:02.0
ID_PATH_TAG=pci-0000_10_02_0
ID_FOR_SEAT=sound-pci-0000_10_02_0
SOUND_INITIALIZED=1
ID_VENDOR_FROM_DATABASE=Texas Instruments
ID_MODEL_FROM_DATABASE=TSB43AB22A IEEE-1394a-2000 Controller (PHY/Link) [iOHCI-Lynx]
ID_BUS=pci
ID_VENDOR_ID=0x104c
ID_MODEL_ID=0x8023
SYSTEMD_WANTS=sound.target
TAGS=:seat:systemd:
[hack@precision ~]$

Comment 3 Kay Sievers 2012-03-19 19:35:03 UTC
Created attachment 571219 [details]
read firewire device descriptions

A bit of guessing around might be needed. :)

Can you add the content of the patch to the rules file in:
  /lib/udev/rules.d/78-sound-card.rules

and run:
  udevadm trigger

and check the udev properties with:
  udevadm info --query=property --path=/sys/class/sound/card0

?

Comment 4 Jay Fenlason 2012-03-20 23:49:57 UTC
This is progress, but still not completely working.  I think we need to modify /lib/udev/path_id to understand firewire devices as well.  With the rules change applied (I had to hand-add it because it did not apply cleanly to my F-16 rules file), I get

[hack@precision ~]$ udevadm info --query=property --path=/sys/class/sound/card3
UDEV_LOG=3
DEVPATH=/devices/pci0000:00/0000:00:1e.0/0000:10:02.0/fw2/fw2.0/sound/card3
SUBSYSTEM=sound
ID_PATH=pci-0000:10:02.0
ID_PATH_TAG=pci-0000_10_02_0
ID_FOR_SEAT=sound-pci-0000_10_02_0
SOUND_INITIALIZED=1
ID_BUS=firewire
ID_VENDOR=Griffin Technology
ID_MODEL=FireWave
SYSTEMD_WANTS=sound.target
TAGS=:seat:systemd:

and

[hack@precision ~]$ udevadm info --query=property --path=/sys/class/sound/card2
UDEV_LOG=3
DEVPATH=/devices/pci0000:00/0000:00:1e.0/0000:10:02.0/fw1/fw1.1/sound/card2
SUBSYSTEM=sound
ID_PATH=pci-0000:10:02.0
ID_PATH_TAG=pci-0000_10_02_0
ID_FOR_SEAT=sound-pci-0000_10_02_0
SOUND_INITIALIZED=1
ID_BUS=firewire
ID_VENDOR=Apple Computer, Inc.
ID_MODEL=iSight
SYSTEMD_WANTS=sound.target
TAGS=:seat:systemd:

But they still have identical ID_PATH entries, which appears to confuse PulseAudio.

Comment 5 Kay Sievers 2012-03-21 01:13:59 UTC
Nice, the descriptions look great now. Committed to upstream udev.

Not sure if PA really use ID_PATH and how. I'll ask Lennart ...

Comment 6 Kay Sievers 2012-03-21 16:26:08 UTC
Can you try adding that:
  SUBSYSTEMS=="firewire", ATTRS{guid}=="?*", ENV{ID_ID}="firewire-$attr{guid}"
to:
  78-sound-card.rules
just before the:
  SUBSYSTEMS=="firewire", GOTO="skip_pci"
?

Comment 7 Jay Fenlason 2012-03-22 02:23:45 UTC
That did the trick.  Now both the iSight and the FireWave show up as separate devices in pavucontrol.

Comment 8 Fedora End Of Life 2013-01-16 20:36:27 UTC
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '16'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 16's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 16 is end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" and open it against that version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 9 Fedora End Of Life 2013-02-14 00:01:12 UTC
Fedora 16 changed to end-of-life (EOL) status on 2013-02-12. Fedora 16 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.