Skip to content

Use getDeviceIds function to list audio devices instead of relying on contiguous IDs #8017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

EvergreenTheTree
Copy link
Contributor

@EvergreenTheTree EvergreenTheTree commented Jun 12, 2024

Fixes #8013

As of RtAudio 6.0.0 you cannot assume that devices will fall in the range [0, getDeviceCount() - 1]. Doing so will potentially cause errors or out of bounds array accesses depending on the platform.

I am not super familiar with this project, but as far as I can tell I couldn't find any documentation or example projects that would need to be updated as a result of this change. However, I do know of at least two projects (audiostellar and ofxPDSP) that make this assumption, so it is definitely worth noting in the change log.

@danoli3
Copy link
Member

danoli3 commented Jun 25, 2024

msys2:
mingw-w64-ucrt-x86_64-rtaudio
using 5.2.0-1 for some reason...

macOS will be fixed for 6.0.1 after merge of #7889

@EvergreenTheTree
Copy link
Contributor Author

I'll see about contributing an update to RtAudio 6.0.1 on msys2's end; based on the PKGBUILD it seems like it should be relatively straightforward. Also, the Linux build is failing due to what appears to be a missing dependency (curl specifically). Is that something that needs to be fixed too?

@danoli3
Copy link
Member

danoli3 commented Jul 4, 2024 via email

As of RtAudio 6.0.0 you cannot assume that devices will fall in the
range [0, getDeviceCount() - 1]. Doing so will potentially cause errors
or out of bounds array accesses depending on the platform.
@EvergreenTheTree EvergreenTheTree force-pushed the rtaudio_device_list_fix branch from 88226ce to aa70b92 Compare July 4, 2024 18:01
@EvergreenTheTree
Copy link
Contributor Author

EvergreenTheTree commented Jul 4, 2024

Rebased; also made a pull request for updating RtAudio in msys2: msys2/MINGW-packages#21319

@EvergreenTheTree
Copy link
Contributor Author

The rtaudio 6.0.1 package update has now been merged into msys2 and is in the msy2 repositories. This branch should be okay to merge now.

@danoli3 danoli3 merged commit 0a44618 into openframeworks:master Jul 7, 2024
12 checks passed
@danoli3
Copy link
Member

danoli3 commented Jul 16, 2024

having some issues with linux 22.04 / 24.04

#8035
image

https://packages.ubuntu.com/search?keywords=librtaudio-dev

22.04 still living in 5.0 rtaudio can we update that package manager ?

@danoli3
Copy link
Member

danoli3 commented Jul 16, 2024

Figured out a dynamic way using the version Define

#if RTAUDIO_VERSION_MAJOR >= 6
		for (unsigned int i: audioTemp.getDeviceIds()) {
#else
		auto deviceCount = audioTemp.getDeviceCount();
		for (unsigned int i = 0; i < deviceCount; i++) {
#endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

ofSoundStream broken with RtAudio 6.0.0
2 participants