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

Fix naming of audio devices under PipeWire #358

Merged
merged 1 commit into from
Nov 12, 2022

Conversation

kdkasad
Copy link
Contributor

@kdkasad kdkasad commented Aug 21, 2022

Under PulseAudio, the user-friendly name for each audio device was
stored under its device.description property. Under PipeWire,
device.description is the name of the sound card, not the source/sink.
This results in all source devices showing their sound card's name in
NoiseTorch. Since I have multiple sources on the same sound card, it
meant all my microphones had the same name, making NoiseTorch unusable.

This commit changes the assignment of device names. When running under
PipeWire, the pulseaudio.Source.Description field holds the correct
device name, while the
pulseaudio.Source.PropList["device.description"] field that was being
used previously is the sound card's description.

The NoiseTorch context must now be passed to the getSources and
getSinks functions so they can check whether the program is running
under PulseAudio or PipeWire.

Screenshot

Before is on the left, after is on the right.
before/after screenshot
Ignore the first device on the left, as it is produced by the "fixed" NoiseTorch instance and would otherwise not be there.

@TheDukeofErl
Copy link
Collaborator

Hi, thanks for submitting the PR! It probably won't be merged for a while right now: we have to do a large degree of code rewriting around the pipewire code due to a licensing issue. After that, though, this is something that we can take a look at again.

@kdkasad
Copy link
Contributor Author

kdkasad commented Aug 23, 2022

we have to do a large degree of code rewriting around the pipewire code due to a licensing issue.

If that's something I can help with, let me know. Or is there already an issue describing what needs to be done?

@TheDukeofErl
Copy link
Collaborator

TheDukeofErl commented Aug 23, 2022

I greatly appreciate the offer! I'll make an issue, which probably should have been done a while ago anyways, ha.

As for helping, that depends a lot on what parts on what parts of the code you're familiar with. Since it's a cleanroom effort, people who are familiar with the code in question can't make the modifications, as they're "tainted" for some time. Issue number is #359

@kdkasad
Copy link
Contributor Author

kdkasad commented Aug 24, 2022

I greatly appreciate the offer! I'll make an issue, which probably should have been done a while ago anyways, ha.

As for helping, that depends a lot on what parts on what parts of the code you're familiar with. Since it's a cleanroom effort, people who are familiar with the code in question can't make the modifications, as they're "tainted" for some time. I'll make an issue and update this comment with the ticket number :)

I'm familiar with none of the code other than what I changed in this PR. Making those changes was the first time I've looked at NoiseTorch's sources.

@damajor
Copy link

damajor commented Nov 10, 2022

This patch should just be mandatory when using pipewire and custom nodes.

@AXDOOMER
Copy link
Collaborator

There is nothing that prevents this patch from being merged right now. It just has to be rebased on the latest code from master.

@TheDukeofErl
Copy link
Collaborator

That's fair. I was hoping to avoid a situation in which we had to keep pulling master into the reimplementation branch but it may make more sense to bring this in now.

Under PulseAudio, the user-friendly name for each audio device was
stored under its `device.description` property. Under PipeWire,
`device.description` is the name of the sound card, not the source/sink.
This results in all source devices showing their sound card's name in
NoiseTorch. Since I have multiple sources on the same sound card, it
meant all my microphones had the same name, making NoiseTorch unusable.

This commit changes the assignment of device names. When running under
PipeWire, the `pulseaudio.Source.Description` field holds the correct
device name, while the
`pulseaudio.Source.PropList["device.description"]` field that was being
used previously is the sound card's description.

The NoiseTorch context must now be passed to the `getSources` and
`getSinks` functions so they can check whether the program is running
under PulseAudio or PipeWire.
@kdkasad
Copy link
Contributor Author

kdkasad commented Nov 12, 2022

There is nothing that prevents this patch from being merged right now. It just has to be rebased on the latest code from master.

Done.

@AXDOOMER AXDOOMER merged commit 7563350 into noisetorch:master Nov 12, 2022
@AXDOOMER
Copy link
Collaborator

Thank you

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.

4 participants