openframeworks / openFrameworks

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
http://openframeworks.cc
Other
9.83k stars 2.56k forks source link

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

Open EvergreenTheTree opened 3 weeks ago

EvergreenTheTree commented 3 weeks ago

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 commented 1 week ago

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 https://github.com/openframeworks/openFrameworks/pull/7889

EvergreenTheTree commented 1 day ago

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 commented 1 day ago

Please tag your head change, then rebase it ontop of current upstream master.

What we can do is use RT audio defines for the meantime set in code while we await the fix for msys2.

On Thu, 4 Jul 2024 at 2:26 PM, Evergreen @.***> wrote:

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?

— Reply to this email directly, view it on GitHub https://github.com/openframeworks/openFrameworks/pull/8017#issuecomment-2208095946, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGK2HEEIQHAVJQ5QCHOOU3ZKTFITAVCNFSM6AAAAABJFSCUXWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBYGA4TKOJUGY . You are receiving this because you commented.Message ID: @.***>

EvergreenTheTree commented 1 day ago

Rebased; also made a pull request for updating RtAudio in msys2: https://github.com/msys2/MINGW-packages/pull/21319

UPDATE: the msys2 rtaudio 6.0.1 package update has now been merged and is in the repository.