RustAudio / cpal

Cross-platform audio I/O library in pure Rust
Apache License 2.0
2.73k stars 363 forks source link

OSX "Error getting supported output configs" #528

Open jwinarske opened 3 years ago

jwinarske commented 3 years ago

I'm getting the following errors when enumerating devices on OSX. Both failure cases are 2 ch outputs set for 16-bit Integer, as viewed via the Mac Audio MIDI Setup app. If I set one of the erring output devices to 24-bit Integer, the error is no longer reported for that output.

The USB audio CODEC device is a MXL ProCon Series 1 AC-404USB PZM mic.

Also I would expect the sample format to be preserved, instead of being promoted to a F32.

Supported hosts:
  [CoreAudio]
Available hosts:
  [CoreAudio]
CoreAudio
2021-01-04 10:29:18.149907-0800 assistant[55109:6076096] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x7fe25e707590> F8BB1C28-BAE8-11D6-9C31-00039315CD46
2021-01-04 10:29:18.195276-0800 assistant[55109:6076096]  HALC_ShellDriverPlugIn::Open: Can't get a pointer to the Open routine
2021-01-04 10:29:18.200471-0800 assistant[55109:6076096]  HALC_ShellObject::HasProperty: initial inner method call failed, Error: 560947818 (!obj)
  Default Input Device:
    Some("USB audio CODEC")
  Default Output Device:
    Some("MacBook Pro Speakers")
  Devices: 
  1. "LG HDR DQHD"
    Error getting supported output configs: BackendSpecific { err: BackendSpecificError { description: "AudioUnit(InvalidPropertyValue)" } }
  2. "USB audio CODEC"
    Error getting supported output configs: BackendSpecific { err: BackendSpecificError { description: "AudioUnit(InvalidPropertyValue)" } }
  3. "USB audio CODEC"
    Default input stream config:
      SupportedStreamConfig { channels: 1, sample_rate: SampleRate(16000), buffer_size: Range { min: 5, max: 3072 }, sample_format: F32 }
    All supported input stream configs:
      3.1. SupportedStreamConfigRange { channels: 1, min_sample_rate: SampleRate(8000), max_sample_rate: SampleRate(8000), buffer_size: Range { min: 5, max: 3072 }, sample_format: F32 }
      3.2. SupportedStreamConfigRange { channels: 1, min_sample_rate: SampleRate(11025), max_sample_rate: SampleRate(11025), buffer_size: Range { min: 5, max: 3072 }, sample_format: F32 }
      3.3. SupportedStreamConfigRange { channels: 1, min_sample_rate: SampleRate(16000), max_sample_rate: SampleRate(16000), buffer_size: Range { min: 5, max: 3072 }, sample_format: F32 }
      3.4. SupportedStreamConfigRange { channels: 1, min_sample_rate: SampleRate(22050), max_sample_rate: SampleRate(22050), buffer_size: Range { min: 5, max: 3072 }, sample_format: F32 }
      3.5. SupportedStreamConfigRange { channels: 1, min_sample_rate: SampleRate(32000), max_sample_rate: SampleRate(32000), buffer_size: Range { min: 5, max: 3072 }, sample_format: F32 }
      3.6. SupportedStreamConfigRange { channels: 1, min_sample_rate: SampleRate(44100), max_sample_rate: SampleRate(44100), buffer_size: Range { min: 5, max: 3072 }, sample_format: F32 }
      3.7. SupportedStreamConfigRange { channels: 1, min_sample_rate: SampleRate(48000), max_sample_rate: SampleRate(48000), buffer_size: Range { min: 5, max: 3072 }, sample_format: F32 }
2021-01-04 10:29:18.260273-0800 assistant[55109:6076096]  HALC_ShellObject::HasProperty: initial inner method call failed, Error: 560947818 (!obj)
2021-01-04 10:29:18.275941-0800 assistant[55109:6076096]  HALC_ShellObject::HasProperty: initial inner method call failed, Error: 560947818 (!obj)
2021-01-04 10:29:18.283476-0800 assistant[55109:6076096]  HALC_ShellObject::HasProperty: initial inner method call failed, Error: 560947818 (!obj)
2021-01-04 10:29:18.283695-0800 assistant[55109:6076096]  HALC_ShellObject::HasProperty: initial inner method call failed, Error: 560947818 (!obj)
jwinarske commented 3 years ago

I'm moving to cubeb-coreaudio-rs / cubeb-pulse-rs. I figure cubeb-rs will become pure Rust sooner than later.

pietervandermeer commented 2 years ago

Same here, and Linux support is even worse. I appreciate the work on the API to get the interface to be fool proof: the application programmer cannot just poke around, he needs to use system defaults or match a configuration. That's great.. if it would also work then it'd be perfect. It seems the problem with cpal is the glue between the interface and the underlying OS API's..

pietervandermeer commented 2 years ago

This is what you need to do.. It effectively means that device selection in Cpal/OSX is broken. You can only use the default system configured device.

Screen Shot 2021-11-26 at 21 24 18