Linux AE/Pulseaudio Digital Output discussion
#1
I would like to throw some ideas on how to improve AE/Pulseaudio Digital Output support.

Pulseaudio unlike alsa has the concept of card and sink. Currently xbmc only checks for sink information to decide if it supports digital output or is capable of passthrough. There is a limitation on this method. Let's see my example here (my usb sound card detected by pulseaudio)

[pactl list sink output]
Code:
Sink #1
        State: SUSPENDED
        Name: alsa_output.usb-ACTIONS_USB_Audio-00-Audio.analog-stereo
        Description: USB Audio Analog Stereo
        Driver: module-alsa-card.c
        Sample Specification: s16le 2ch 22050Hz
        Channel Map: front-left,front-right
        Owner Module: 1
        Mute: no
        Volume: 0: 100% 1: 100%
                0: -0.01 dB 1: -0.01 dB
                balance 0.00
        Base Volume:   1%
                     -120.01 d
        Monitor Source: alsa_output.usb-ACTIONS_USB_Audio-00-Audio.analog-stereo.monitor
        Latency: 0 usec, configured 0 usec
        Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
        Properties:
                alsa.resolution_bits = "16"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "USB Audio"
                alsa.id = "USB Audio"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.card = "0"
                alsa.card_name = "USB Audio"
                alsa.long_card_name = "ACTIONS USB Audio at usb-bcm2708_usb-1.3, full speed"
                alsa.driver_name = "snd_usb_audio"
                device.bus_path = "platform-bcm2708_usb-usb-0:1.3:1.0"
                sysfs.path = "/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0/sound/card0"
                udev.id = "usb-ACTIONS_USB_Audio-00-Audio"
                device.bus = "usb"
                device.vendor.id = "10d6"
                device.vendor.name = "ACTIONS"
                device.product.id = "1100"
                device.product.name = "USB Audio"
                device.serial = "ACTIONS_USB_Audio"
                device.string = "front:0"
                device.buffering.buffer_size = "176400"
                device.buffering.fragment_size = "88200"
                device.access_mode = "mmap+timer"
                device.profile.name = "analog-stereo"
                device.profile.description = "Analog Stereo"
                device.description = "USB Audio Analog Stereo"
                alsa.mixer_name = "USB Mixer"
                alsa.components = "USB10d6:1100"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-usb"
        Ports:
                analog-output: Analog Output (priority: 9900)
        Active Port: analog-output
        Formats:
                pcm
[pactl list cards]
Code:
Card #0
        Name: alsa_card.usb-ACTIONS_USB_Audio-00-Audio
        Driver: module-alsa-card.c
        Owner Module: 1
        Properties:
                alsa.card = "0"
                alsa.card_name = "USB Audio"
                alsa.long_card_name = "ACTIONS USB Audio at usb-bcm2708_usb-1.3, full speed"
                alsa.driver_name = "snd_usb_audio"
                device.bus_path = "platform-bcm2708_usb-usb-0:1.3:1.0"
                sysfs.path = "/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0/sound/card0"
                udev.id = "usb-ACTIONS_USB_Audio-00-Audio"
                device.bus = "usb"
                device.vendor.id = "10d6"
                device.vendor.name = "ACTIONS"
                device.product.id = "1100"
                device.product.name = "USB Audio"
                device.serial = "ACTIONS_USB_Audio"
                device.string = "0"
                device.description = "USB Audio"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-usb"
        Profiles:
                output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority. 6000)
                output:iec958-stereo: Digital Stereo (IEC958) Output (sinks: 1, sources: 0, priority. 5500)
                off: Off (sinks: 0, sources: 0, priority. 0)
        Active Profile: output:analog-stereo
        Ports:
                analog-output: Analog Output (priority: 9900)
                        Part of profile(s): output:analog-stereo
                iec958-stereo-output: Digital Output (S/PDIF) (priority: 0)
                        Part of profile(s): output:iec958-stereo

If you look carefully you will notice that the sink#1 only has analog-output port attached but it does not necessary mean it's not capable of digital-output. Unlike alsa pulseaudio does not expose analogue output and digital output as difference devices instead it uses profile/ports therefore you will need to switch profile first by pactl set-card-profile 0 iec958-stereo-output which will make sink#1 to switch to digital output.

This also affects the passthrough devices as well since the xbmc code checks for format support for available sinks. It's not surprised that without switching profile first you will not have any devices that is marked capable of digital passthrough by xmbc under pulseaudio.

With the current solution to get xbmc digital/passthroughoutput working the end user will have to switch the profile to digital one first. I hope developers could have a look at the pulseaudio implementation to see if the card profile can be used to make it easier for end user.
Reply

Logout Mark Read Team Forum Stats Members Help
AE/Pulseaudio Digital Output discussion0