[pulseaudio-discuss] Autocreate both HDMI and analog sink when detecting audiocard

Lode Cools lode.cools1 at gmail.com
Fri May 27 14:11:29 UTC 2016


Hello,

I have a particular audio card which provides both analog and HDMI output.

    CARDINFO:
      CARDINFO{id}="PCH"
      CARDINFO{card}="0"
      CARDINFO{driver}="HDA-Intel"
      CARDINFO{name}="HDA Intel PCH"
      CARDINFO{longname}="HDA Intel PCH at 0xdf140000 irq 127"
      CARDINFO{mixername}="Intel Skylake HDMI"
      CARDINFO{components}="HDA:10ec0283,80862063,00100003
HDA:80862809,80860101,00100000"
    sysfs:
      ATTR{class}="0x040300"
      ATTR{driver}="snd_hda_intel"
      ATTR{vendor}="0x8086"
      ATTR{device}="0x9d70"
      ATTR{subsystem_vendor}="0x8086"
      ATTR{subsystem_device}="0x2063"

Both outputs are working fine and I can play audio on both outputs
independently.
(eg. 'aplay song1.wav -D hdmi' and 'aplay song2.wav -D hw:0' can run
simultaneously).
So hardware-wise, everything seems fine.

When PulseAudio detects the card (module-udev-detect) it realizes that
the card can play on audio on
analog and HDMI, because it creates various profiles.

  1 card(s) available.
    index: 0
    name: <alsa_card.pci-0000_00_1f.3>
    driver: <module-alsa-card.c>
    owner module: 3
    properties:
        alsa.card = "0"
        alsa.card_name = "HDA Intel PCH"
        alsa.long_card_name = "HDA Intel PCH at 0xdf140000 irq 127"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:1f.3"
        sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
        device.bus = "pci"
        device.vendor.id = "8086"
        device.vendor.name = "Intel Corporation"
        device.product.id = "9d70"
        device.form_factor = "internal"
        device.string = "0"
        device.description = "Built-in Audio"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    profiles:
        input:analog-stereo: Analog Stereo Input (priority 60,
available: unknown)
        output:analog-stereo: Analog Stereo Output (priority 6000,
available: unknown)
        output:analog-stereo+input:analog-stereo: Analog Stereo Duplex
(priority 6060, available: unknown)
        output:hdmi-stereo: Digital Stereo (HDMI) Output (priority
5400, available: unknown)
        output:hdmi-stereo+input:analog-stereo: Digital Stereo (HDMI)
Output + Analog Stereo Input (priority 5460, available: unknown)
        output:hdmi-surround: Digital Surround 5.1 (HDMI) Output
(priority 300, available: unknown)
        output:hdmi-surround+input:analog-stereo: Digital Surround 5.1
(HDMI) Output + Analog Stereo Input (priority 360, available: unknown)
        output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output
(priority 300, available: unknown)
        output:hdmi-surround71+input:analog-stereo: Digital Surround
7.1 (HDMI) Output + Analog Stereo Input (priority 360, available:
unknown)
        output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output
(priority 5200, available: unknown)
        output:hdmi-stereo-extra1+input:analog-stereo: Digital Stereo
(HDMI 2) Output + Analog Stereo Input (priority 5260, available:
unknown)
        output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2)
Output (priority 100, available: unknown)
        output:hdmi-surround-extra1+input:analog-stereo: Digital
Surround 5.1 (HDMI 2) Output + Analog Stereo Input (priority 160,
available: unknown)
        output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2)
Output (priority 100, available: unknown)
        output:hdmi-surround71-extra1+input:analog-stereo: Digital
Surround 7.1 (HDMI 2) Output + Analog Stereo Input (priority 160,
available: unknown)
        output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output
(priority 5200, available: unknown)
        output:hdmi-stereo-extra2+input:analog-stereo: Digital Stereo
(HDMI 3) Output + Analog Stereo Input (priority 5260, available:
unknown)
        output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3)
Output (priority 100, available: unknown)
        output:hdmi-surround-extra2+input:analog-stereo: Digital
Surround 5.1 (HDMI 3) Output + Analog Stereo Input (priority 160,
available: unknown)
        output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3)
Output (priority 100, available: unknown)
        output:hdmi-surround71-extra2+input:analog-stereo: Digital
Surround 7.1 (HDMI 3) Output + Analog Stereo Input (priority 160,
available: unknown)
        off: Off (priority 0, available: unknown)
    active profile: <output:analog-stereo+input:analog-stereo>
    sinks:
        alsa_output.pci-0000_00_1f.3.analog-stereo/#1: Built-in Audio
Analog Stereo
    sources:
        alsa_output.pci-0000_00_1f.3.analog-stereo.monitor/#1: Monitor
of Built-in Audio Analog Stereo
        alsa_input.pci-0000_00_1f.3.analog-stereo/#2: Built-in Audio
Analog Stereo
    ports:
        analog-input-mic: Microphone (priority 8700, latency offset 0
usec, available: no)
            properties:
                device.icon_name = "audio-input-microphone"
        analog-output-headphones: Headphones (priority 9000, latency
offset 0 usec, available: no)
            properties:
                device.icon_name = "audio-headphones"
        hdmi-output-0: HDMI / DisplayPort (priority 5900, latency
offset 0 usec, available: no)
            properties:
                device.icon_name = "video-display"
        hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency
offset 0 usec, available: no)
            properties:
                device.icon_name = "video-display"
        hdmi-output-2: HDMI / DisplayPort 3 (priority 5700, latency
offset 0 usec, available: no)
            properties:
                device.icon_name = "video-display"

The default profile 'output:analog-stereo+input:analog-stereo'
autocreates 1 sink.
If I switch to an HDMI card profile, the analog-sink is replaced by an
HDMI-sink.

If I want to play audio on both outputs independently, I have to
manually add a new sink:
  load-module  module-alsa-sink device=hdmi:0

My question is:
  * Why isn't there a profile which autocreates both sinks?  I think
that should be the default
    profile for this card.
  * How are the profiles created?  Is it the responsibility of ALSA?

Thank you for your input,
Lode


More information about the pulseaudio-discuss mailing list