FDH2 / UxPlay

AirPlay Unix mirroring server
GNU General Public License v3.0
1.34k stars 71 forks source link

Segfault on start after building from source on Raspberry Pi OS 64bit #267

Closed dylanchapell closed 5 months ago

dylanchapell commented 5 months ago

I built the application from source on Raspberry Pi OS 64-bit so I could use the -async option as the version in the repo was too old. I did a standard build, but added -DNO_X11_DEPS=ON . When I run /usr/local/bin/uxplay I get a segfault.

dylanchapell@raspberrypi:~ $ /usr/local/bin/uxplay UxPlay 1.68: An Open-Source AirPlay mirroring and audio-streaming server. Segmentation fault

Please let me know if there are logs or other information I can provide. Thank you.

Edit: Here is the output when running it in GDB `UxPlay 1.68: An Open-Source AirPlay mirroring and audio-streaming server. [New Thread 0x7fe942f080 (LWP 4635)]

Thread 2 "Fusion Dispatch" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fe942f080 (LWP 4635)] 0x0000007fe9495a44 in ?? () from /lib/aarch64-linux-gnu/libfusion-1.7.so.7`

fduncanh commented 5 months ago

We can't reproduce this (in a build without X11) on "Desktop" (full Raspberryi Pi OS)

From the fact you built without X11, I guess you are using the "lite" version? (no X11, use FrameBuffer video instead)

What segfaulted is not uxplay but libfusion-1.7. This appears to be related to the GStreamer directFB dfbvideosink.

I don't think this works on R Pi.

Try

uxplay -vs kmssink

to use kernel KMS for R Pi "lite"

give more details.

I assume the current Raspberry Pi OS (Bookworm)

* is this "lite" (why no X11)?) or full Desktop Definitely is "lite"

what is libfusion doing here? is your uxplay build linked to it somehow? this is NOT part of uxplay, and is what segfaulted

* what does "ldd /usr/local/bin/uxplay" show?

fduncanh commented 5 months ago

On Raspberry Pi OS (lite) current (Bookworm) 64bit, uxplay built with -DNO_X11_DEPS=ON,

I'm guessing that on your system (but not ours) autovideosink (the default if no -vs option is specified) selected "dfbvideosink" which segfaults on the R. Pi . (This is R Pi model 4B 8GB, what is yours?).

fduncanh commented 5 months ago

Please close this issue if it is now fixed for you

dylanchapell commented 5 months ago

You are correct, the Pi is running Raspberry Pi Os (Bookworm) Lite Version (sorry for not including this, I had forgotten since installing because I only use it over ssh.) It is the 4B 2GB model. I do not have a display attached and looking back at the documentation, I should have been using the -vs 0 option because I only want audio streaming. Running kmssink does not segfault, but does give an error which makes sense since there is no display.

I did not realize I needed to change this because the version in the Raspberry Pi OS repo handled the use case automatically and provided audio streaming (but did not support async). My issue is solved, thank you.

fduncanh commented 5 months ago

You should not need to use -vs 0 (though it can't hurt, and probably should be used if there is no display attached)

I think you are using the wrong AirPlay icon for audio streaming only.

There is one icon for mirror mode (two rounded rectangles) , a different one for audio-only mode (circles radiating from an upside-down V) https://www.digitaltrends.com/computing/how-to-use-airplay-stream-mirror-screen/

audio-only mode sends lossless ALAC audio, mirror mode sends lossy AAC audio.

dylanchapell commented 5 months ago

The problems I am having happen when I start UxPlay, not when I start streaming. And when I am streaming I do use the audio only mode (the airplay button in apple music.) When I start uxplay with -vs kmssink I get these errors:

dylanchapell@raspberrypi:~ $ /usr/local/bin/uxplay -vs kmssink
UxPlay 1.68: An Open-Source AirPlay mirroring and audio-streaming server.
*** ERROR: Failed to initialize GStreamer video renderer
using system MAC address <removed>
Initialized server socket(s)
GStreamer error: Could not get allowed GstCaps of device
*** ERROR: Failed to initialize GStreamer video renderer
Initialized server socket(s)
GStreamer error: Could not get allowed GstCaps of device
*** ERROR: Failed to initialize GStreamer video renderer
Initialized server socket(s)
GStreamer error: Could not get allowed GstCaps of device

The option to stream to the device shows up, but when I select it it fails to connect. So: uxplay segfaults uxplay -vs dfbvideosink segfaults uxplay -vs kmssink runs, but does not work. uxplay -vs 0 runs and works.

fduncanh commented 5 months ago

Yes, If you are running headless with no screen, -vs 0 seems exactly the correct thing to do