-
Notifications
You must be signed in to change notification settings - Fork 490
Add pipewire sound driver #2166
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
base: master
Are you sure you want to change the base?
Conversation
@akrram09 Feel free to check this out. I did start working on this over a year ago, but had totally missed how to get the default metadata. Still not sure which properties should be used though: const DEFAULT_SINK_KEY: &str = "default.configured.audio.sink";
const DEFAULT_SOURCE_KEY: &str = "default.configured.audio.source"; or const DEFAULT_SINK_KEY: &str = "default.audio.sink";
const DEFAULT_SOURCE_KEY: &str = "default.audio.source"; |
4ec751b
to
c71710f
Compare
@MaxVerevkin, I'm curious if you have any thoughts on removing the idle loop. I thought about spawning an async runtime so that we can select from all of the |
This comment was marked as resolved.
This comment was marked as resolved.
This is a good question, that I do not have a good answer to 😓 |
@MaxVerevkin, I found a solution to having the idle loop, there is a pw channel that you can attach to the mainloop: https://pipewire.pages.freedesktop.org/pipewire-rs/pipewire/channel/index.html |
This doesn't always work when I (un)plug my wired headphones. For example I click to toggle mute, but nothing happens. It usually starts working again after I open pavucontrol and manipulate the volume from there. |
Can you capture the output of When I do that I see something like:
|
23c0731
to
e4db55f
Compare
Sometimes it just doesn't work even without headphones, and restarting the bar does not help. But after manually toggling mute from pavucontrol it works again. But then I still haven't found a way to get back to the state in which it doesn't work. Anyway, below is the full log of plugging/unplugging. Plug:
Unplug:
|
Alright, so I hadn't tested it using a headphone jack on the computer before. I had been using a USB DAC which is a Also added in the equivalent of the |
@MaxVerevkin did that last push resolve the issue you were seeing? |
Still have the same issue. It sometimes doesn't work even without headphones, just the laptop speakers. |
I'll try to debug it in more depth when I gen some time. |
src/pipewire.rs
Outdated
} else if data.links.remove(&uid).is_some() { | ||
update_copy2.replace_with(|v| *v | EventKind::LINK_REMOVED); | ||
} else if data.ports.remove(&uid) { | ||
update_copy2.replace_with(|v| *v | EventKind::PORT_ADDED); |
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.
This should have been PORT_REMOVED
🤦♂️
I found that when I use the headphone jack with the Pro Audio profile that setting the volume doesn't work, but updates to the volume (made in another tool) do show up in the status bar. |
I found that some outputs update the Node+Device while others only require the Node to be updated. Please let me know if you see any issue after this change 🙏 Node+Device
Node only.
|
Still the same 😢 |
@MaxVerevkin assuming that at the very least #!/bin/python
import sys
import re
section = None
id = None
type_ = None
param = ""
section_re = re.compile(r"^(added|removed|changed):$")
param_id = re.compile(r"^[\* ]\t id:")
for line in sys.stdin:
section_match = section_re.match(line)
if section_match:
section = section_match.group(1)
id = None
type_ = None
param = ""
elif line.startswith("\tid:"):
id = line.rstrip()
elif line.startswith("\ttype:"):
type_ = line.rstrip()
if section == "changed":
if param_id.match(line):
if "channelVolumes" in param:
print(id)
print(type_)
print(param)
param = ""
param += line If you could run In the case that |
I just restarted my computer and noticed that the mute/setting the volume using the pipewire block didn't work (nor did changes made with the pulse block cause updates to the pipewire block). I ran the script I previously shared while setting the volume with the pulse block and got nothing. Upon opening pavucontrol (end even after exiting) both blocks started working again... I checked the relevant services and the all seem to be enabled and running 😕 |
Resolves #2164