-
Notifications
You must be signed in to change notification settings - Fork 443
feat: stable Device::id() #1014
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
Open
xephyris
wants to merge
34
commits into
RustAudio:master
Choose a base branch
from
xephyris:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
8cc6f25
feat: add device_id support for macOS to DeviceTrait
xephyris 9161bbb
fix: fix import statements for other APIs
xephyris 845baac
wip: use DeviceId enum instead to work around conflicting device_id i…
xephyris bd9b071
feat: transition to using DeviceId for enum for better cross compatib…
xephyris 60c3c26
docs: add description for DeviceId
xephyris 2a93a70
feat: implemented device id for windows wasapi
xephyris fb1efd0
docs: update description
xephyris 626b823
fix: reformat existing code and fix android build error
xephyris c9d6b05
feat: add ALSA support to device id() function
xephyris 6f8587f
fix: resolve merge conflicts
xephyris 24ef5ac
feat: add support for jack and aaudio (untested). fix naming structur…
xephyris 8b5b8d0
docs: update changelog
xephyris 068e171
fix: fix function names causing compile errors
xephyris f9301b8
fix: fix aaudio DeviceId type
xephyris 2972b52
feat: implement macos DeviceId to use kAudioDevicePropertyDeviceUID …
xephyris 99fc8b7
fmt: reformat with rustfmt
xephyris 43bc3e0
docs: update changelog
xephyris 6e93a1b
feat: add asio support and reformat macos id function
xephyris 59f4a9f
fmt: reformat code
xephyris b811266
feat: return default for ios, emscripten, and webaudio
xephyris eefc6ef
fix: Merge branch 'master' into master
xephyris f40bb9d
feat: add in rest of audio APIs to from_str()
xephyris 492a98e
fix: Merge branch 'master' into master
xephyris 30645a5
fix: change catch-all to todo!
xephyris 44ec96b
fix: resolve parse error on null and deviceid implementations
xephyris 01a240d
docs: fix changelog
xephyris 6eb9e7a
refactor: improve safety of get_id() function, remove CFStringRef
xephyris d516476
fmt: run rustfmt
xephyris 5c56868
fix: resolve wrap_under rule error for CFString
xephyris 82b4abd
fix: Merge branch 'master' into master
xephyris ab3b8a2
fix: add Stream import to coreaudio
xephyris fa1c0d7
Merge remote-tracking branch 'upstream/master'
xephyris 7bc3c4f
fix: return backend error on parse error for PWSTR
xephyris 3580a67
fmt: run cargo fmt
xephyris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"default" differs from "Default Device" in
name
. Maybe use shared const?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm slightly unsure about this change, as in most conventions an id would not have spaces inside of it, so I feel like
"default"
does a better job of this.DeviceId
s andname
s also do not intermix so I don't believe this will be much of an issue either.Of course if the general consensus is that
"Default Device"
is better than"default"
, I would be happy to change it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good rationale, let’s keep it like it this then.
How do you feel this’ll be for ALSA? Spaces in device names (e.g. for USB devices) would not be impossible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if we are to maintain no spaces in the
id
, then we could maybe just replace all the spaces with-
dashes or_
underscores.From what I've seen and researched though, it seems like the
hw:CARD="CARD_ID",DEV="DEVICE_NUM"
style inself.pcm_id
cannot contain spaces, as they are not permitted in card ids. Do you have any examples of such a case with spaces, or does thealsa
implementation incpal
use card names not card ids?My research in this is very basic, so what I'm saying may not be completely accurate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's possible that USB DACs show up with spaces, e.g. "Schiit Unison Modi Multi 2".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a USB DAC I can test with, but asking Copilot, this is what it said the card id would be for a USB DAC
File:
/proc/asound/cards
It seems like
alsa
just trims the device name for the first word. If this is the case, we could also do something similar, but one issue that might occur is that if two devices with the same starting word are plugged in,alsa
will just assign ids based on the first device detected.Do you have any suggestions as to resolve this?