This is the continuity of #215
New modules pipewire #224
2dc65b17a7
71a9924927
(Responding to @Ogromny in #223 (comment))
@Ogromny, I tried the
icontag, but it is empty for me (both with and without headphones plugged in). Bothform_factorandbusare empty as well, unfortunately. Is this something that has to be configured manually in PipeWire?Hum, can you do a
pw-metadatait should list a source and a sink.
I get this:
$ pw-metadata
Found "default" metadata 36
update: id:0 key:'default.audio.source' value:'{"name":"alsa_input.pci-0000_00_1b.0.analog-stereo"}' type:'Spa:String:JSON'
update: id:0 key:'default.audio.sink' value:'{"name":"alsa_output.pci-0000_00_1b.0.analog-stereo"}' type:'Spa:String:JSON'
Now do a
pw-cli ls Node, you should see your Sink Node and your Source Node.Now take note of a Node id, let say that your Sink Node id is 35, do a
pw-dump 35and under thepropsobject (at the top of the output) you see adevice.icon-name, that's theicontag,device.busis thebustag anddevice.form-factoris theform-factortag.The
device.icon-nameanddevice.busshould be always present and non empty. So maybe it's a misconfigured pipewire (missing wireplumber or pipewire-media-session), missing configuration for pipewire-pulse or simply a bug.
pw-cli ls Node shows me that the sink node has ID 47, and pw-dump 47 gives the following output (I can post the full output if you want):
...
"props": {
"alsa.card": 1,
"alsa.card_name": "HDA Intel PCH",
"alsa.class": "generic",
"alsa.device": 0,
"alsa.driver_name": "snd_hda_intel",
"alsa.id": "ALC283 Analog",
"alsa.long_card_name": "HDA Intel PCH at 0x7eb1c000 irq 46",
"alsa.name": "ALC283 Analog",
"alsa.resolution_bits": 16,
"alsa.subclass": "generic-mix",
"alsa.subdevice": 0,
"alsa.subdevice_name": "subdevice #0",
"api.alsa.card.longname": "HDA Intel PCH at 0x7eb1c000 irq 46",
"api.alsa.card.name": "HDA Intel PCH",
"api.alsa.path": "front:1",
"api.alsa.pcm.card": 1,
"api.alsa.pcm.stream": "playback",
"audio.channels": 2,
"audio.position": "FL,FR",
"card.profile.device": 3,
"device.api": "alsa",
"device.class": "sound",
"device.id": 41,
"device.profile.description": "Analog Stereo",
"device.profile.name": "analog-stereo",
"device.routes": 2,
"factory.name": "api.alsa.pcm.sink",
"media.class": "Audio/Sink",
"node.description": "Built-in Audio Analog Stereo",
"node.name": "alsa_output.pci-0000_00_1b.0.analog-stereo",
"node.nick": "ALC283 Analog",
"node.pause-on-idle": false,
"object.path": "alsa:pcm:1:front:1:playback",
"priority.driver": 1009,
"priority.session": 1009,
"factory.id": 18,
"clock.quantum-limit": 8192,
"client.id": 35,
"node.driver": true,
"factory.mode": "merge",
"audio.adapt.follower": "",
"library.name": "audioconvert/libspa-audioconvert",
"object.id": 47,
"object.serial": 48
},
...
As you can see, device.icon-name, device.bus and device.form-factor are all missing. I tried removing ~/.local/state/{pipewire,wireplumber} (with pipewire and wireplumber stopped), but the issue remains.
Any ideas how I can investigate further what's going on here?
(Responding to @Ogromny in #223 (comment))
@Ogromny, I tried the
icontag, but it is empty for me (both with and without headphones plugged in). Bothform_factorandbusare empty as well, unfortunately. Is this something that has to be configured manually in PipeWire?Hum, can you do a
pw-metadatait should list a source and a sink.I get this:
$ pw-metadata Found "default" metadata 36 update: id:0 key:'default.audio.source' value:'{"name":"alsa_input.pci-0000_00_1b.0.analog-stereo"}' type:'Spa:String:JSON' update: id:0 key:'default.audio.sink' value:'{"name":"alsa_output.pci-0000_00_1b.0.analog-stereo"}' type:'Spa:String:JSON'Now do a
pw-cli ls Node, you should see your Sink Node and your Source Node.Now take note of a Node id, let say that your Sink Node id is 35, do a
pw-dump 35and under thepropsobject (at the top of the output) you see adevice.icon-name, that's theicontag,device.busis thebustag anddevice.form-factoris theform-factortag.The
device.icon-nameanddevice.busshould be always present and non empty. So maybe it's a misconfigured pipewire (missing wireplumber or pipewire-media-session), missing configuration for pipewire-pulse or simply a bug.
pw-cli ls Nodeshows me that the sink node has ID 47, andpw-dump 47gives the following output (I can post the full output if you want):... "props": { "alsa.card": 1, "alsa.card_name": "HDA Intel PCH", "alsa.class": "generic", "alsa.device": 0, "alsa.driver_name": "snd_hda_intel", "alsa.id": "ALC283 Analog", "alsa.long_card_name": "HDA Intel PCH at 0x7eb1c000 irq 46", "alsa.name": "ALC283 Analog", "alsa.resolution_bits": 16, "alsa.subclass": "generic-mix", "alsa.subdevice": 0, "alsa.subdevice_name": "subdevice #0", "api.alsa.card.longname": "HDA Intel PCH at 0x7eb1c000 irq 46", "api.alsa.card.name": "HDA Intel PCH", "api.alsa.path": "front:1", "api.alsa.pcm.card": 1, "api.alsa.pcm.stream": "playback", "audio.channels": 2, "audio.position": "FL,FR", "card.profile.device": 3, "device.api": "alsa", "device.class": "sound", "device.id": 41, "device.profile.description": "Analog Stereo", "device.profile.name": "analog-stereo", "device.routes": 2, "factory.name": "api.alsa.pcm.sink", "media.class": "Audio/Sink", "node.description": "Built-in Audio Analog Stereo", "node.name": "alsa_output.pci-0000_00_1b.0.analog-stereo", "node.nick": "ALC283 Analog", "node.pause-on-idle": false, "object.path": "alsa:pcm:1:front:1:playback", "priority.driver": 1009, "priority.session": 1009, "factory.id": 18, "clock.quantum-limit": 8192, "client.id": 35, "node.driver": true, "factory.mode": "merge", "audio.adapt.follower": "", "library.name": "audioconvert/libspa-audioconvert", "object.id": 47, "object.serial": 48 }, ...As you can see,
device.icon-name,device.busanddevice.form-factorare all missing. I tried removing~/.local/state/{pipewire,wireplumber}(withpipewireandwireplumberstopped), but the issue remains.Any ideas how I can investigate further what's going on here?
Thanks for the informations, that's weird... I tried to find similar issues on the pipewire gitlab but no one seems to have thing like that. Hum what's your pipewire/wireplumber version ? And I don't know if pulseaudio provide same informations like icon or form-factor. From memory you can do a pactl info or something similar and it'll show you the corresponding icon for the currently selected profile. Or maybe it's pactl list cards, IIRC it'll show a Selected Profile or thing like that with a icon-name field
Yeah, I couldn't find any relevant pipewire/wireplumber issues either.
I'm using pipewire 0.3.57 and wireplumber 0.4.11.
pactl list cards shows the properties device.bus, device.form_factor and device.icon_name for the card, and just device.icon_name for each port; pactl list sinks shows all three properties for the sink.
I have another laptop lying around here that also uses Intel HD Audio; I'll see if it is any different there.
Update: I tried the other laptop, and got the same results.
By the way, I noticed that devices (PipeWire:Interface:Device) do have the properties device.bus, device.form-factor and device.icon-name on my machine.
Hum, okay I think I know how to find/provide theses informations. I will try to do that by tomorrow
Edit: I found how to get icon, form-factor, etc, exactly like pactl does, I'm quite busy right now, I think it will be finished in 2-3 days, just to let you know.
f65eb02921
7bd38909ce
@wvdk Can you retry please, it should be good
@Ogromny, it seems to work now, nice! For the sink, icon gives me audio-headphones/audio-speakers, form_factor gives me headphones/speaker, and bus is empty. For the source, icon gives me audio-input-microphone and form_factor gives me mic (and bus is empty).
I do have one other issue though: the module causes yambar to hang sometimes (when pressing Ctrl-C). I noticed you don't listen on abort_fd; maybe that's what causes this behavior?
@wvdk yeah bus for me is almost always empty except for the bluetooth source/sink, do you think we should keep it or we should remove it ?
Concerning the hang issue, I experiences it too, let me some days and it will be fixed too !
Glad to hear that the module now work almost properly for you now.
@wvdk Sorry for the delay, should be good, the module listens to abort_fd now
@Ogromny, that seems to have fixed the hangs indeed!
c13dd6bde7
1247e7b844
Are there any outstanding issues remaining?
Thanks! Looks mostly good. It's missing a changelog entry, and I have a couple of questions (below), but that's just about it.
@ -0,0 +167,4 @@
bool is_sink;
};
static struct node_data node_data_sink;
static struct node_data node_data_source;
This isn't multi-thread safe? What if the user instantiates two, or more, pipewire modules?
I've just tested running 2+ instances of yambar with the pipewire module, seems to run fine, pipewire spawn a new process everytime. I'm not really really sure if this is thread safe tho, I never did multi-thread programming related things. Maybe I can just make these global non static ? What do you think ?
Removing static wont help. They'll still be globals. The only way to make this thread safe is to move them into one of the module structs. The data struct seems like a good candidate.
I've just tested running 2+ instances of yambar with the pipewire module, seems to run fine, pipewire spawn a new process everytime
Well, multithreading bugs often don't trigger consistently :) Sometimes they can be super hard to trigger. But that doesn't mean they're not there.
In almost all cases, using globals is a very bad idea in a multithreaded environment.
Fixed ! Thanks for the infos.
@ -0,0 +830,4 @@
mtx_lock(&module->lock);
static struct exposable *exposables[2];
static size_t exposables_length = ARRAY_LENGTH(exposables);
Why are these static?
No particular reason, without static it'll work fine too, do you want me to make thoses non static ?
Yes please. As static variables, they are very similar to globals, and are thus not multithread safe.
Done
1247e7b844
17ea959880
17ea959880
to 794ac70666
Looks good. Though, I still don't see a changelog entry...
794ac70666
to 03768ea159
My bad I forgot, added now
Looks good! Please clean up the commit list as you see fit (squashing is fine), then I'll merge.
03768ea159
to bd5da260ba
bd5da260ba
to 19a9f099e2
Should be good !
Awesome job, thanks!
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?