FDH2 / UxPlay

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

-march-native not respected #187

Closed alexmyczko closed 1 year ago

alexmyczko commented 1 year ago

somehow disabling according to the document of uxplay doesn't work:

https://buildd.debian.org/status/fetch.php?pkg=uxplay&arch=amd64&ver=1.62-1&stamp=1675236674&raw=0

fduncanh commented 1 year ago

Hi! I dont see any problem in your output, you DON'T want the -march=native flag< right?

If I run cmake .. -DNO_MARCH_NATIVE=ON which means NO_MARCH_NATIVE is swtched "ON" I get

-- Not using -march=native
-- using CMAKE_CFLAGS: -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Wall -O2 

If I just run "cmake .." I get the -march=native flag.

 -- *** CFLAGS "" from build environment will be postpended to CMAKE_CFLAGS
-- Using CFLAGS with  -march=native
-- *** ONLY USE THIS WHEN COMPILING ON THE MACHINE THAT WILL RUN UXPLAY
--   run "cmake -DNO_MARCH_NATIVE=ON" to switch off this compiler option
-- using CMAKE_CFLAGS: -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Wall -Ofast -march=native 

Looking at your output -DNO_MARCH_NATIVE seems to have worked? (i.e. no march_native)

below is your cmake output: you dont have -march=native.

dh_auto_configure -- \
    -DNO_MARCH_NATIVE=ON
    cd obj-x86_64-linux-gnu && cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DCMAKE_INSTALL_RUNSTATEDIR=/run -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON "-GUnix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu -DNO_MARCH_NATIVE=ON ..
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Project name: uxplay
-- Found X11: /usr/include   
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Will compile using X11 Libraries  (use cmake option -DNO_X11_DEPS=ON if X11 dependence is not wanted)
-- *** CFLAGS "-g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2" from build environment will be postpended to CMAKE_CFLAGS
-- Not using -march=native
-- using CMAKE_CFLAGS: -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Wall -O2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2
-- Looking for include file sys/endian.h
-- Looking for include file sys/endian.h - not found
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1") 
-- Checking for one of the modules 'libplist>=2.0'
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found suitable version "3.0.7", minimum required is "1.1.1")  
-- Checking for one of the modules 'avahi-compat-libdns_sd'
-- Will use X_DISPLAY_FIX
-- Checking for module 'gstreamer-1.0>=1.20'
--   Found gstreamer-1.0, version 1.22.0
--   ZOOMFIX will NOT be applied as Gstreamer version is >= 1.20
-- Looking for remove
-- Checking for modules 'gstreamer-1.0>=1.4;gstreamer-sdp-1.0>=1.4;gstreamer-video-1.0>=1.4;gstreamer-app-1.0>=1.4'
--   Found gstreamer-1.0, version 1.22.0
--   Found gstreamer-sdp-1.0, version 1.22.0
--   Found gstreamer-video-1.0, version 1.22.0
--   Found gstreamer-app-1.0, version 1.22.0
-- Configuring done
-- Generating done
CMake Warning:
fduncanh commented 1 year ago

BTW: uxplay-1.63 has some significant improvements (in gstreamer audio-video synchronization, using timestamps, available in new options -vsync and -async, probably most important for R. Pi without hardware video decoding: ). I left these options off by default, but probably should in future switch to making -vsync the default, with the option to switch it off if desired.

Some user (on windows!!) did some accurate checks on synchronization. I was surprised to find that the gstreamer was ignoring the Airplay timestamps in the audio and video streams , and using a simpler method to keep audio and video in sync, that works well enough. I finally got to understand how to get gstreamer to use time stamps. It doesn't seen needed on regular desktops, but its a huge improvement for low-power systems like R. Pi if hardware video acceleration is not available. (hw acceleration uses an out-of-mainline kernel module maintained by Raspberry PI, and only available on Ubuntu, and Manjaro, other than on Raspberry Pi OS itself).

fduncanh commented 1 year ago

Hi is there still an issue?

fduncanh commented 1 year ago

UxPlay 1.64 is available.

fduncanh commented 1 year ago

cant reproduce. 'Is this really an issue? reopen if it is '

alexmyczko commented 1 year ago

nope, it's not an issue anymore afaik, thanks!