FDH2 / UxPlay

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

license: gpl exception needed for openssl #22

Closed alexmyczko closed 2 years ago

alexmyczko commented 2 years ago

to be able to get packaged for debian and ubuntu, the following red point needs be resolved:

https://mentors.debian.net/package/uxplay/

fduncanh commented 2 years ago

It can be built linked to just-released openSSL 3.0.0 which has a new (Apache) license compatible with GPLv3. I'm testing.

But I seem to see choppy audio with OpenSSL 3.0.0 and not with OpenSSL1.1.1d, so I'm stiil testing

alexmyczko commented 2 years ago

true, i just tried to build/link against the openssl 3.x in debian experimental, appears to build. haven't gotten to test it yet though.

fduncanh commented 2 years ago

With some lib/CMakeLists.txt changes, I have also built both against debian experimental 3.x (libssl3 libssl-dev openssl) and also openssl3 built from source.

The only library involved is libcrypto.so.3

In both cases , when uxplay is built linked to this (checked with ldd) , the audio is broken up and choppy.

uxplay works perfectly when linked to libcrypto.so from OpenSSL-1.1.1f

so the upgrade breaks uxplay for now. I doubt I can fix it, and RPiPlay where the openssl integration was done is not really very active right now., so I'm not sure when and if the fix will happen...

It may be that only some tiny fix is needed, but I'm not a libcrypto expert. I'll try to get somebody at RPiPlay interested in the fix.

fduncanh commented 2 years ago

I verified that both UxPlay1.38 and current RPiPlay build (with no CMakeList.txt changes) if debian unstable libssl3 libssl-dev and opensll are installed in ubuntu 20.04LTS.

They behave identically: work perfectly when build with openssl-1.1.1 (ldd shows libcrypto.so.1.1) scattered instances of stuttering sound when built with openssl-3.0.0 (ldd shows libcrypto.so.3)

(tested on a The Who track from youtube)

fduncanh commented 2 years ago

I've posted an issue at the RPiPlay site, but dont expect that they will do anything (developers seem to have moved on to the rest of their lives..)

I'll probably have to explore where the problem is coming from. First thing I guess is to see if it is from decryption of audio or video or both. Some initial decryption happens when the connection is made, but this is ongoing during the streaming. Ideally contact with someone with openssl3 experience to offer guidance would help.

fduncanh commented 2 years ago

@alexmyczko I found a bug in RPiPlay's audio decryption, inherited by UxPlay, and fixed it.

UxPlay 1.39 now works great with OpenSSL3.0.0 which is GPLv3 compatible, so you can now package it.

alexmyczko commented 2 years ago

it appears libc6 dropped /usr/include/netdb.h:32:11: fatal error: rpc/netdb.h: No such file or directory and we have to sort out to libtirpc-dev

fduncanh commented 2 years ago

What system are you building on? debian experimental?

fduncanh commented 2 years ago

according to these older 2015 posts it should be in libc6-dev

https://forums.raspberrypi.com/viewtopic.php?t=105157

fduncanh commented 2 years ago

on OpenSUSE 15.3, netdb.h is supplied by glibc-devel-2.31-9.3.2.x86_64

alexmyczko commented 2 years ago

libc6-dev 2.32, debian sid (aka unstable)

fduncanh commented 2 years ago

yes, I see libc6 2.32 drops it, I couldnt see it in libtirpc-dev though. is it there?
let me see what it does in UxPlay

fduncanh commented 2 years ago

So for libc6 >= 2.32, one must install libtirpc-dev?

There is also a "new" libntirpc,

fduncanh commented 2 years ago

it provides functions getaddrinfo, freeaddrinfo, a struct addrinfo, and defines some possible values for addrinfo->ai

So its not just the include file that is needed, the library with functions getaddrinfo and freeaddrinfo is needed. I guess these are also gone from libc6

fduncanh commented 2 years ago

about getaddrinfo

https://en.wikipedia.org/wiki/Getaddrinfo

alexmyczko commented 2 years ago

well i'm not amused either :'(

fduncanh commented 2 years ago

libitrpc implements ipV6, the old 1990's sun RPC in libc6 didnt. in principle cmake can test for this issue.

alexmyczko commented 2 years ago

i have tried to patch and failed: https://sid.ethz.ch/debian/uxplay/uxplay-1.39a/debian/patches/

fduncanh commented 2 years ago

I installed debian testing on a spare partition and took openssl 3, libssl 3 and libssl-dev 3 from sid.

every thing worked fine.

I looked into the RPC issue: it seems the netdb.h is the ONLY part of RPC that is left behind in new libc6-dev and is still there in sid. (Also it is NOT included with either libtirpc or libntirpc) I dont think you need to patch, but at some point soon I will attempt to upgrade my testing to sid. to see.

I have released a UxPlay 1.40. Test build on that, but wait for an upcoming UxPlay 1.41 before makeing a release, there is an issue I am fixing.

alexmyczko commented 2 years ago

uploaded

fduncanh commented 2 years ago

@alexmyczko

Hi, when you say "uploaded" did you succeed in packaging UxPlay?

It turns out that a change in UxPlay 1.41 broke the "ZOOMFIX" cmake option, without it getting noticed. If you packaged, v. 1.41 or 1.42 before the just posted 1.42f release tag of 1.42, using cmake -DZOOMFIX=ON, could you package again? (CMakeLists.txt has been cleaned up and reorganized to now also support FreeBSD, so I hope it doesn't give you extra work)

1.42 also fixed detection of the MAC address on modern (non eth0) debian. No further changes in UxPlay are planned (unless bugs are reported).

Can I get a link to any successful packaging?

alexmyczko commented 2 years ago

Packages here: https://sid.ethz.ch/debian/uxplay/

NEW q here: https://ftp-master.debian.org/new.html

fduncanh commented 2 years ago

great!

I'm annoyed I missed the breakage of ZOOMFIX in 1.41. (This also caused sporadic mysterious X11 BadWindow errors when the mirror window was closed because X was continually being queried (instead of a one-time initialization) because of the bug, causing a crash when the window was closed in mid-query)

1.42f is the good one, works great with OpenSSL-3.0.0 because I found a serious AES decryption bug in RPiPlay that is now fixed in both RPiPlay and UxPlay, and fixing it allowed AirPlay audio-only lossless ALAC streams to be supported too. (And adds *BSD support)

alexmyczko commented 2 years ago

no worries I am not using the zoom fix and once it is through new it is easily updated.

alexmyczko commented 2 years ago

https://buildd.debian.org/status/package.php?p=uxplay&suite=experimental