Skip to content

jack: only open as many channels as requested, option to not autoconnect to default device  #851

@digitalsignalperson

Description

@digitalsignalperson

Current behavior:

My default device has 8 channels. If I request 2 channels it creates a jack device with 8 outputs and auto-connect them all.

Desired behavior:

  • Request 2 channels, get 2 channels
  • Request 32 channels, get 32 (regardless if the default device has less)
  • Ability to enable or disable autoconnecting to the default device

Details

With this config

    ma_device_config deviceConfig = ma_device_config_init(ma_device_type_playback);
    deviceConfig.playback.format = ma_format_f32;
    deviceConfig.playback.channels = 2;
    deviceConfig.sampleRate = 48000.0f;

The result is:
image

Proposed solution

Number of channels

  • Since in device config the .playback.channels is ignored for jack, then I suggest if it is default 0 to use the number of channels in the default device.
  • If .playback.channels is non-zero, then in ma_device_init__jack() simply create as many channels with (ma_jack_port_register_proc)() instead of basing it off the default device specs.

Autoconnect

  • in the context config add a .jack.autoconnect setting
  • in ma_device_start__jack() don't do calls to (ma_jack_connect_proc)() if .jack.autoconnect is false

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions