rodio: Error when opening default stream on iOS

Hi!

I’ve compiled a project for iOS (aarch64-apple-ios) in release mode. It compiles and runs on macOS, and without rodio the app runs fine on both iPhone and iPad. (iOS 18.1.1 and iOS 17.6.1 respectively)

However, even if rodio compiles and links successfully for the iOS target, when I run I get BuildStreamError(StreamConfigNotSupported)

I’m calling

let output = rodio::OutputStreamBuilder::open_default_stream().unwrap();

and using the latest commit on HEAD of the git repo as the version (70d01daf24)

the project is compiled as a static library and included as a library to link with in Xcode. Initially Xcode complained that it couldn’t find some symbols like _AudioComponentFindNext and _AudioUnitUninitialize and some more, but it went away when I explicitly added the AudioToolbox.framework as a linked library as well.

I get the same error in debug mode as well, and also if I try on the simulator with aarch64-apple-ios-sim target

How may I assist in debugging this?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (8 by maintainers)

Most upvoted comments

@dvdsk We may add a ticket to cpal regarding this. But I suspect CPAl may not be able to determine buffer size in some cases, so the defaulting logic has to be somewhere anyway.

Agreed but having that logic in cpal makes more sense since they have a Default bufferlenght right?

Anyway we cant make the issue till we are sure, and I do not have the hardware required. @EriKWDev there is no rush but to solve this correctly we do need your help yet again 😃

I will add an assertion in clamp_supported_buffer_size.

good idea

maybe we can silently replace Fixed(0) to Default.

I rather have it fixed in cpal to be honest. That may take a while, we could for now add the workaround in rodio we should document that with a comment linked to a cpal issue.

Can do it later but heading away at the moment. But yeah might be from cpal this is coming from

No worries! Yeah the config implements Debug but the builder doesn’t and the field is private…

fixed that OutputStreamConfig now implements Debug.

Fixed(0) looked a little suspicious. When I made it rodio::cpal::BufferSize::Default instead, it worked!

Thats super useful! thanks for that discovery!