saivert / pwvucontrol

Pipewire Volume Control
GNU General Public License v3.0
272 stars 8 forks source link

Headphone Port not showing up #34

Closed arminius-smh closed 2 months ago

arminius-smh commented 2 months ago

Hello, I am not sure if this is related to pwvucontrol or attributed to something else, but my Built-in Audio doesn't show the headphone option, for example here is pavucontrol showing both, and pwvucontrol only Line-Out(3), which doesn't change when I change the port in pavucontrol

I tried version 0.4.5 and git, but it's the same for both

pavucontrol pwvucontrol

There is one log message from the program that appears a few times while clicking around, but I am not sure if it's related:

C 19:23:28.492958        pwvucontrol src/backend/pwdeviceobject.rs:319:: Output Unable to get model index from route index in update_current_route_index_for_direction_sync
saivert commented 2 months ago

Currently it only shows available ports. In your example Headphones is a possible port but nothing it plugged in there.

It reads the Spa:Pod:Object:Param:Route:availableproperty of the Route and if this is No then it is not shown.

arminius-smh commented 2 months ago

Ah sorry, now I understand, then my problem is that the Headphone port isn't showing, even though something is plugged in there, using pw-dump I found at that my Headphone port doesn't seem to support the available property, if I plug my line-out in and out it shows correctly "available": "yes", and "available": "no", however my headphone always has "available": "unknown",

So is it maybe possible for those that are 'unknown' to also show up?

saivert commented 2 months ago

Yes will include "unknown" ports in the next version.

arminius-smh commented 2 months ago

Thanks! I also just figured out a patch I can apply so I can even start using it now :) I'm not sure if anything else is needed for it to be clean, so I won't make a pr

diff --git a/src/backend/pwroutefiltermodel.rs b/src/backend/pwroutefiltermodel.rs
index ce565f0..3733b54 100644
--- a/src/backend/pwroutefiltermodel.rs
+++ b/src/backend/pwroutefiltermodel.rs
@@ -68,7 +68,9 @@ mod imp {
                         .skip(position as usize)
                         .map_while(Result::ok)
                         .enumerate() {
-                        if routeobject.direction() == widget.direction() && routeobject.availability() == ParamAvailability::Yes {
+                        if (routeobject.direction() == widget.direction() && 
+                            (routeobject.availability() == ParamAvailability::Yes || 
+                            routeobject.availability() == ParamAvailability::Unknown)) {
                             hashset.insert(a as u32);
                         }
                     }