Skip to content
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

Detect available output sample formats, translate samples. #54

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

mdwn
Copy link
Owner

@mdwn mdwn commented Dec 13, 2024

Device sample formats are now autodetected and song samples are translated into the appropriate format for these devices. This should make MacOS support easier, since it looks like many of the devices there only support the float output format.

Closes #51

@mdwn mdwn mentioned this pull request Dec 13, 2024
Copy link

codecov bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 6.25000% with 45 lines in your changes missing coverage. Please review.

Project coverage is 46.60%. Comparing base (a9628d2) to head (d271040).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/audio/cpal.rs 6.25% 45 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #54      +/-   ##
==========================================
- Coverage   47.00%   46.60%   -0.40%     
==========================================
  Files          23       23              
  Lines        1368     1384      +16     
==========================================
+ Hits          643      645       +2     
- Misses        725      739      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ahcm
Copy link

ahcm commented Dec 13, 2024

It seems this fixes the problem by skipping the problematic entry/ies.
Enabling error output I get:

2024-12-13T19:37:16.324546Z ERROR mtrack::audio::cpal: Error getting output configs err="A backend-specific error has occurred: Invalid property value"
Devices:
- MacBook Air-Lautsprecher (Channels=2) (CoreAudio)
- Microsoft Teams Audio (Channels=2) (CoreAudio)

Is this a cpal problem?

@mdwn
Copy link
Owner Author

mdwn commented Dec 13, 2024

I think you're right. I just added the host_id and device_name to the output for that call, do you mind trying against the most recent pull?

Device sample formats are now autodetected and song samples are
translated into the appropriate format for these devices. This should
make MacOS support easier, since it looks like many of the devices there
only support the float output format.
@mdwn mdwn force-pushed the better-macos-support branch from 445b13e to d271040 Compare December 13, 2024 21:44
@mdwn mdwn merged commit f4ab2a9 into main Dec 13, 2024
6 of 8 checks passed
@mdwn mdwn deleted the better-macos-support branch December 13, 2024 21:50
@ahcm
Copy link

ahcm commented Dec 13, 2024

If I switch the system default speaker to the dongle I get:

$ ./target/release/mtrack devices
Devices:
- AKG N9 Hybrid (Channels=2) (CoreAudio)
- Microsoft Teams Audio (Channels=2) (CoreAudio)

Otherwise:

$ ./target/release/mtrack devices
Devices:
- MacBook Air-Lautsprecher (Channels=2) (CoreAudio)
- Microsoft Teams Audio (Channels=2) (CoreAudio)

@mdwn
Copy link
Owner Author

mdwn commented Dec 13, 2024

That is bizarre. So cpal doesn't report any available outputs there, it seems -- I'm not totally sure what I can do in this situation, unfortunately. Do you have any other apps open that might be interfering?

@ahcm
Copy link

ahcm commented Dec 14, 2024

It's a problem with cpal. There is even a merge request open since september last year:
RustAudio/cpal#799

I added some output form the cpal example enumerate.
Hopefully this leads to a merge.

Thanks!

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

Successfully merging this pull request may close these issues.

MacOS Support
2 participants