Skip to content

Instantly share code, notes, and snippets.

#!/usr/local/bin/wpexec
info = Core:get_info()
Log.message("Pipewire version " .. info["version"] )
om = ObjectManager {
Interest {
type = "node",
Constraint { "node.name", "=", "Some node name" },
#include <pipewire/pipewire.h>
#include <strings.h>
struct pw_main_loop *loop;
struct pw_registry *registry;
struct proxy_data;
typedef void (*info_func_t) (struct proxy_data *pd);
#include <pipewire/pipewire.h>
#include <strings.h>
static int roundtrip(struct pw_core *core, struct pw_main_loop *loop)
{
struct spa_hook core_listener;
int pending, done = 0;
void core_event_done(void *object, uint32_t id, int seq) {
if (id == PW_ID_CORE && seq == pending) {
done = 1;
diff --git a/plugins/gtkui/ddbseekbar.c b/plugins/gtkui/ddbseekbar.c
index c9f7b4a66..37cd034a1 100644
--- a/plugins/gtkui/ddbseekbar.c
+++ b/plugins/gtkui/ddbseekbar.c
@@ -191,6 +191,7 @@ static void ddb_seekbar_class_init (DdbSeekbarClass * klass) {
GTK_WIDGET_CLASS (klass)->button_release_event = ddb_seekbar_real_button_release_event;
GTK_WIDGET_CLASS (klass)->motion_notify_event = ddb_seekbar_real_motion_notify_event;
GTK_WIDGET_CLASS (klass)->configure_event = ddb_seekbar_real_configure_event;
+ // GTK_WIDGET_CLASS (klass)->scroll_event = ddb_seekbar_real_scroll_event;
G_OBJECT_CLASS (klass)->constructor = ddb_seekbar_constructor;
// Excerpt from my client code. bits that calls pw_stream_connect
static int ddbpw_set_spec(ddb_waveformat_t *fmt)
{
memcpy (&plugin.fmt, fmt, sizeof (ddb_waveformat_t));
if (!plugin.fmt.channels) {
// generic format
plugin.fmt.bps = 16;
plugin.fmt.is_float = 0;
plugin.fmt.channels = 2;
// Our global variable
static int gotfirstvolumeupdate;
static void
set_volume(int dolock) {
if (data.stream) {
float plvol;
float vol[SPA_AUDIO_MAX_CHANNELS];
int i;
PangoAttrList *
convert_escapetext_to_pango_attrlist (char *text, float *fg, float *bg, float *highlight) {
const int maxTintStops = 100;
tint_stop_t tintStops[maxTintStops];
int numTintStops;
char *plainString;
numTintStops = calculate_tint_stops_from_string (text, tintStops, maxTintStops, &plainString);
guint strLength = strlen(plainString);

Overly long sound card descriptions is a problem and they sometimes cause problems for some GUIs as pavucontrol where you need to make the window very wide in order to accommodate the strings. With pulseaudio you can rename them directly in pavucontrol by right-clicking the Port dropdown as long as you have the module-device-manager pulseaudio module loaded. Here is how to do the same in pipewire:

Add something like the following to your `/etc/pipewire/media-session.d/alsa-monitor.conf/ file:

    {
        matches = [
            {
                node.name = "alsa_output.pci-0000_02_02.0.analog-stereo"
            }
[
{
"id": 58,
"type": "PipeWire:Interface:Device",
"version": 3,
"permissions": [ "r", "w", "x", "m" ],
"info": {
"change-mask": [ "props", "params" ],
"props": {
"device.api": "bluez5",
# alsa-monitor config file
properties = {
#alsa.jack-device = true
}
rules = [
# an array of matches/actions to evaluate
{
# rules for matching a device or node. It is an array of
# properties that all need to match the regexp. If any of the