some fields not present on sinks/sources · Issue #3 · mk-fg/python-pulse-control (original) (raw)

Hi there. Thanks for this library! I've been looking for something like this, and am extremely grateful that someone has put in the hard work to make it possible.

I am interested (it seems) in a feature that isn't present in your wrapper, or perhaps it isn't present in libpulse...

When I use pacmd, and list-sinks, I get output like this:

2 sink(s) available.
    index: 4
    name: <alsa_output.pci-0000_00_1b.0.analog-surround-71>
    driver: <module-alsa-card.c>
    flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
    state: RUNNING
    suspend cause: 
    priority: 9959
    volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB,   rear-left: 65536 / 100% / 0.00 dB,   rear-right: 65536 / 100% / 0.00 dB,   front-center: 65536 / 100% / 0.00 dB,   lfe: 65536 / 100% / 0.00 dB,   side-left: 65536 / 100% / 0.00 dB,   side-right: 65536 / 100% / 0.00 dB
            balance 0.00
    base volume: 65536 / 100% / 0.00 dB
    volume steps: 65537
    muted: no
    current latency: 46.21 ms
    max request: 63 KiB
    max rewind: 64 KiB
    monitor source: 7
    sample spec: s32le 8ch 44100Hz
    channel map: front-left,front-right,rear-left,rear-right,front-center,lfe,side-left,side-right
                 Surround 7.1
    used by: 1
    linked by: 1
    configured latency: 46.44 ms; range is 0.50 .. 46.44 ms
    card: 1 <alsa_card.pci-0000_00_1b.0>
    module: 2
    properties:
        alsa.resolution_bits = "32"
        device.api = "alsa"
        device.class = "sound"
        alsa.class = "generic"
        alsa.subclass = "generic-mix"
        alsa.name = "ALC883 Analog"
        alsa.id = "ALC883 Analog"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.device = "0"
        alsa.card = "0"
        alsa.card_name = "HDA Intel"
        alsa.long_card_name = "HDA Intel at 0xfe6f4000 irq 31"
        alsa.driver_name = "snd_hda_intel"
        device.bus_path = "pci-0000:00:1b.0"
        sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
        device.bus = "pci"
        device.vendor.id = "8086"
        device.vendor.name = "Intel Corporation"
        device.product.id = "293e"
        device.product.name = "82801I (ICH9 Family) HD Audio Controller"
        device.form_factor = "internal"
        device.string = "surround71:0"
        device.buffering.buffer_size = "65536"
        device.buffering.fragment_size = "32768"
        device.access_mode = "mmap+timer"
        device.profile.name = "analog-surround-71"
        device.profile.description = "Analog Surround 7.1"
        device.description = "Built-in Audio Analog Surround 7.1"
        alsa.mixer_name = "Realtek ALC883"
        alsa.components = "HDA:10ec0883,1043829e,00100002"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card-pci"
    ports:
        analog-output-lineout: Line Out (priority 9900, latency offset 0 usec, available: yes)
            properties:

    active port: <analog-output-lineout>

And doing pulse.sink_list() gives me a python list representation of this (awesome!). But if I inspect one of the sink objects, I get fewer attributes:

s.c_struct_fields      s.index                s.port_active
s.channel_count        s.latency              s.port_list
s.channel_list         s.monitor_source       s.proplist
s.configured_latency   s.monitor_source_name  s.sample_spec
s.description          s.mute                 s.volume
s.driver               s.name                 
s.flags                s.owner_module         

In particular, I'm looking for "state: RUNNING", "suspend cause:"... I'd like to write some code that detects when sound is flowing, or at least when PA thinks it hasn't and has therefore suspended a sink.

Am I missing something?

Thanks again!