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

Display UID and allow setting by a substring of UID #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nbolender
Copy link

The device ID is not consistent when unplugging and re-plugging an external audio source (it is some sort of counter). So this presents a problem when you want to choose a specific device.

macOS exposes a UID string for each audio device. The format of this string is a black box. For example, for built-in devices it is a simple string like BuiltInSpeakerDevice, but for a DisplayPort device it may be something like AppleGFXHDAEngineOutputDP:30001:0:{AD19-43B2-5257260B}. In the second case, the same device may appear as AppleGFXHDAEngineOutputDP:30001:1:{AD19-43B2-5257260B} if it is the second DisplayPort device currently plugged in.

So to support switching inputs by UID, this PR checks against a substring and it is left to the user to find the unique portion of the string. For the above example, running SwitchAudioSource -u AD19-43B2-5257260B always selects the appropriate device.

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.

1 participant