Tiny Core Extensions > TCE Talk

trouble compiling pipewire 1.0.1

(1/1)

GNUser:
I'm trying to compile pipewire 1.0.1 on TCL15-alpha x86_64 to tinker with sound and possibly submit it as an extension if it works.

I'm following the build notes here but am getting stuck at the complilation (ninja) step with this error:


--- Code: ---$ ninja
...
attribute=format -Wsign-compare -Wpointer-arith -Wpointer-sign -Wformat -Wformat-security -Wimplicit-fallthrough -Wmissing-braces -Wtype-limits -Wvariadic-macros -Wmaybe-uninitialized -Wno-missing-field-initializers -Wno-unused-parameter -Wno-pedantic -Wdeprecated-declarations -Wunused-result -Werror=return-type -D_GNU_SOURCE -DFASTPATH -Werror=implicit-function-declaration -Werror=int-conversion -Werror=old-style-declaration -Werror=old-style-definition -Werror=missing-parameter-type -Werror=strict-prototypes -fPIC -MD -MQ spa/plugins/v4l2/libspa-v4l2.so.p/v4l2-udev.c.o -MF spa/plugins/v4l2/libspa-v4l2.so.p/v4l2-udev.c.o.d -o spa/plugins/v4l2/libspa-v4l2.so.p/v4l2-udev.c.o -c ../spa/plugins/v4l2/v4l2-udev.c
../spa/plugins/v4l2/v4l2-udev.c: In function ‘remove_device’:
../spa/plugins/v4l2/v4l2-udev.c:136:21: error: void value not ignored as it ought to be
  136 |         device->dev = udev_device_unref(device->dev);
      |                     ^
[235/1217] Linking target spa/plugins/audioconvert/libspa-audioconvert.so
lto-wrapper: warning: using serial compilation of 4 LTRANS jobs
lto-wrapper: note: see the ‘-flto’ option documentation for more information
[236/1217] Linking target spa/plugins/bluez5/libspa-bluez5.so
lto-wrapper: warning: using serial compilation of 10 LTRANS jobs
lto-wrapper: note: see the ‘-flto’ option documentation for more information
ninja: build stopped: subcommand failed.
Command exited with non-zero status 1
--- End code ---
I've tried loading every extension with "udev" or "v4l" in the name, to no avail.

Does anyone know how to get past the "../spa/plugins/v4l2/v4l2-udev.c:136:21: error: void value not ignored as it ought to be" error?

curaga:
This is a coding thing, it expects a different version (API) of udev. Perhaps Ubuntu etc has a patch. It's not something a one-line sed can safely change.

Rich:
Hi GNUser

--- Quote from: GNUser on January 11, 2024, 06:19:26 AM --- ...
--- Code: --- ----- Snip -----
spa/plugins/v4l2/libspa-v4l2.so.p/v4l2-udev.c.o -c ../spa/plugins/v4l2/v4l2-udev.c
../spa/plugins/v4l2/v4l2-udev.c: In function ‘remove_device’:
../spa/plugins/v4l2/v4l2-udev.c:136:21: error: void value not ignored as it ought to be
  136 |         device->dev = udev_device_unref(device->dev);
      |                     ^
 ----- Snip -----

--- End code ---

--- End quote ---
Gcc is saying  udev_device_unref  returns a  void  and its being
assigned to a non-void variable (device->dev)

According to this:
https://manpages.debian.org/testing/libudev-dev/udev_device_unref.3.en.html#SYNOPSIS
udev_device_unref  returns a  struct udev_device  pointer.
And here it states:
https://manpages.debian.org/testing/libudev-dev/udev_device_unref.3.en.html#RETURN_VALUE
udev_device_unref  always returns  NULL.

According to this:
http://ftp.ntu.edu.tw/linux/utils/kernel/hotplug/libudev/libudev-udev-device.html#udev-device-unref
udev_device_unref  return type as  void.

/usr/local/include/libudev.h  from  udev-dev.tcz  also defines
udev_device_unref  return type as  void.

If you look in  spa/plugins/v4l2/libspa-v4l2.so.p/v4l2-udev.c  you'll
see  udev_device_unref  is used 3 times, but only 1 of those times
is there an attempt to use the return value:

--- Code: ---static void remove_device(struct impl *this, struct device *device)
{
        device->dev = udev_device_unref(device->dev);
        stop_watching_device(this, device);
        *device = this->devices[--this->n_devices];
}
--- End code ---
Based on the name of the function (remove_device) and what the
author did, it appears he wanted to set  device->dev  equal to  NULL
using the return value of  udev_device_unref.

If that is the case, the source should probably be changed to this:

--- Code: ---static void remove_device(struct impl *this, struct device *device)
{
        udev_device_unref(device->dev);
        device->dev = NULL;
        stop_watching_device(this, device);
        *device = this->devices[--this->n_devices];
}
--- End code ---

GNUser:
Hi curaga. I'm glad it's not a compilation issue. I was starting to feel stupid.

Hi Rich. I can feel lightning bolts of wizard-power through your post! Sure enough, compilation completes successfully with the edit you suggested. I will test the finished product to make sure everything seems to be working, given that the edit is probably a workaround for a udev API discrepancy as curaga suggested.

Navigation

[0] Message Index

Go to full version