Help: Compiling Chiaki - PS4 remote play
-
Hmm. Lets see.
According to the instructions on the github repository/page these are the dependencies that you need to install first before compiling.
Building from Source
Dependencies
are CMake, Qt 5 with QtMultimedia, QtOpenGL and QtSvg, FFMPEG (libavcodec with H264 is enough), libopus, OpenSSL 1.1, protoc and the protobuf Python library (only used during compilation for Nanopb). Then, Chiaki builds just like any other CMake project:These are the building/compiling instructions. This is the default way to compile anything from source with cmake in Linux.
git submodule update --init mkdir build && cd build cmake .. make
Prerequisites:
You will need the knowledge of how to use a Linux Terminal to compile otherwise you can not move any further into making this happen on a RPI. Also the dependencies must be compatible with the hardware specifications of a Raspberry Pi.How to proceed:
Firstdownload/clone
the source files from the github repository -> Open Linux Terminal and go into the source files folder with thecd
"source folder" command -> Try searching for the dependencies to install by usingsudo apt-get install
"dependency" -> Once installed, use the default instructions for compiling as written in the Chiaki githup repository and try to compile.Something extra to take note of:
- If you cannot find a dependency/package with sudo apt-get install, then it might be that the Raspbian repository does not have them included and you must search on the internet to find a way to install it. (This can involve additional compiling).
- If compiling fails it might be that the cmake files are looking for a dependency that is not installed on the system or the cmake version that Chiaki uses is not the same as the default installed version in Raspbian.
- A hardware limitation can also make compiling fail for example: like OpenGL or ES 3.0 not supported on a RPI.
I hope this can help you in the right direction. From what i can say, it might prove difficult to you as learning and understanding of how to compile from source is not an easy task.
-
@tpo1990 Thanks for the reply. I manage to install all dependencies. I only need to compile CMake, because it needs Cmake above 3.15. After i have solved all the issues, when I run "make", when is about 87% , there is an error with https://github.com/thestr4ng3r/chiaki/blob/master/gui/src/avopenglwidget.cpp . In this file the compiler cannot find glEnableVertexAttribArray, then, i removed that line only to see what happens, then the error was with "glCullFace", and every time i remove a instruction, another error. So from what i have researched its due the fact that this software needs OpenGL3.2 and the RPi3 its simple not compatible.
So apparently, at least for me, its a dead end. -
@tpo1990 Perhaps this might be a way: https://retropie.org.uk/forum/topic/23844/run-sdl2-application-on-retropie-for-raspberry-pi/3
-
@sergiohp said in Help: Compiling Chiaki - PS4 remote play:
@tpo1990 Perhaps this might be a way: https://retropie.org.uk/forum/topic/23844/run-sdl2-application-on-retropie-for-raspberry-pi/3
No, it's not. Both Pi3 and the PI4 support only OpenGL 2.1. The Pi3 supports OpenGL ES 2.0 and the PI4 OpenGL ES 3.0 (3.1 coming soon), so the requirements for this are a bit to high for a SBC - though maybe the requirements for OpenGL ES systems are different.
-
@mitu So its really a dead end. Thanks for the explanation.
-
@sergiohp said in Help: Compiling Chiaki - PS4 remote play:
So its really a dead end.
Not necessarily - I see there are binaries for Android systems, which I assume it means support for OpenGL ES, that's what I meant by 'maybe the requirements for OpenGL ES are different'.
-
@mitu Yeah, but that is way beyond my knowledge. But thanks anyway.
-
@sergiohp Yes any port or application that uses a higher OpenGl version than 2.1 and OpenGL ES 2.0 will simply not work. If you can get it to use SDL1 or even better SDL2 and OpenGL ES that works with a RPI, it might just work. This requires an even greater knowledge of working with different video renders that i simply can not help you with.
Maybe there are other applications or ports out there that does a similar thing.
-
@tpo1990 Yeah, the error is the following:
[ 86%] Linking CXX executable chiaki
/usr/bin/ld: CMakeFiles/chiaki.dir/src/avopenglwidget.cpp.o: undefined reference to symbol 'glEnableVertexAttribArray'
//usr/lib/arm-linux-gnueabihf/libGLESv2.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
gui/CMakeFiles/chiaki.dir/build.make:410: recipe for target 'gui/chiaki' failed
make[2]: *** [gui/chiaki] Error 1
CMakeFiles/Makefile2:371: recipe for target 'gui/CMakeFiles/chiaki.dir/all' failed
make[1]: *** [gui/CMakeFiles/chiaki.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2 -
Not sure if bad form to reply to this old thread but it seems to make sense so I'll just go ahead.
Has anyone manage to build this for the RPi? This seems super cool and I'd love to try it. If the main stumbling block is openGL I'm thinking it should be possible to work around in the source code. (I'm not saying it would be easy though, I don't know) as if this is a purely streaming type software it shouldn't need advanced 3d?
It should just need a textured surface to render to right?
Cheers
Fred -
Apparently there was some progress and I just didn't find the thread.
https://github.com/thestr4ng3r/chiaki/issues/126 -
I managed to get this running pretty well!
The big monitor is the PS4 screen and the small monitor is the RPi4.It seems like the sound is not forwarded or coming through for me but I think I saw a note on how that might be fixable so i'll try that.
The latency is noticeable but not too bad. This is running over LAN and I'm using a wired (to the Pi) PS4 controller.
I filmed these screens with the slow motion setting of my iphone which records at 240fps. I then counted frames in Premiere and the delay was about 113ms (27 high speed frames).
I'm not sure yet if my build is using mmal hardware video decoding.
This build was made by merging the latest master branch into the last version by charliebanks. (https://github.com/charliebanks/chiaki/tree/feature/RPi-Effort)
Don't ask me how to do it as I'm really bad at Git and its probably better you figure out for yourself. :)
Next I'm hoping to try to pin down where the latencies are coming from and see if its possible to improve.
Oh and btw at first when I ran it it crashed as soon as I tried to start a game. Then I started the game first and only after that I engaged with chiaki. That seems to have worked around that issue.
-
@RedMarsBlueMoon said in Help: Compiling Chiaki - PS4 remote play:
This build was made by merging the latest master branch into the last version by charliebanks. (https://github.com/charliebanks/chiaki/tree/feature/RPi-Effort)
Don't ask me how to do it as I'm really bad at Git and its probably better you figure out for yourself. :)
With a mind towards helping people out with this, I've forked the latest Chiaki and cherry-picked the OpenGLes code from Charliebanks so there's no need to do this work manually anymore.
-
Nice one @zerojay I just tested your version and it works for me!
One issue is that this seems to now run at a considerably lower frame rate now than on my very first run when I took the latency numbers. I'd now say that Im only getting 8-10 fps. It would be interesting to hear if others experience the same?
Or if I have just mucked up my pi environment somehow.I looked int the sound but wasn't able to solve it yet. My modest findings can be read here, https://github.com/thestr4ng3r/chiaki/issues/126#issuecomment-712631993
There's a few people who complain that the streaming worsens after some time playing, like 30 mins or so. And I'm reading that the creators say that 'Congestion Control' has not been added yet so I'm thinking maybe there's a buildup of packets or stream data in a queue and that eventually clogs things up too much?
I think there are some hints pointing to something like that in the shell output. -
Iv'e got the sound working on the raspberry pi4 now!! :)
What I had to do was,-
Install Qt5.12 from https://github.com/koendv/qt5-opengl-raspberrypi (please let me know if this is doable with apt?)
-
Add the following lines to chiaki/gui/CMakeLists.txt
set(Qt5Core_DIR "/usr/lib/qt5.12/lib/cmake/Qt53DCore") set(Qt5_DIR "/usr/lib/qt5.12/lib/cmake/Qt5") set(QT_QMAKE_EXECUTABLE "/usr/lib/qt5.12/bin/qmake")
(assuming that's where the new version got installed on your system)
NOTE: cmake will get confused because its doubling up the paths and including the old paths as well but luckily these new ones have priority. Again please if you know how to not get the doubling up please let me know!
-
Build chiaki as usual.
-
Do 'ldd gui/chiaki' and look for the paths to the Qt libraries. They need to point to the 5.12 versions, Like so,
libQt5Multimedia.so.5 => /usr/lib/qt5.12/lib/libQt5Multimedia.so.5 (0xb6e6a000)
Now run chiaki and you should hear the sound streaming!
-
-
Update.
Small screen is the Raspberry!
Sorry about the camera work I was trying to record with my phone and do some moves at the same time. :DSo just got this working pretty well now using Chiaki that I hacked in RPi specific hardware video decoding to. I'm playing over Ethernet here.
The game sound you (almost) hear is also coming over the stream and playing through the RPi.720p30 atm but I'm hoping to be able to do 60fps. (I can't test 1080 as I haven't got a PS4-Pro)
The code is just hacked in atm but I'm hoping it could get properly added to the project.
-
Awesome guys! Really appreciate your work !
I own PS4 Pro, followed your guide and build Chiaki based on https://github.com/zerojay/chiaki fork. Streaming works fine on Pi4 2GB (30FPS; 720p) but without sound.
When i follow Qt5.12 workaround:
set(Qt5Core_DIR "/usr/lib/qt5.12/lib/cmake/Qt53DCore")
set(Qt5_DIR "/usr/lib/qt5.12/lib/cmake/Qt5")
set(QT_QMAKE_EXECUTABLE "/usr/lib/qt5.12/bin/qmake")adding to CMakeLists.txt and create new build i got error when trying run Chiaki :
"* failed to add service - already in use?"
any idea whats wrong? I put new set line on the begining of CMakeList.txt file.
-
hi, this is really great i tried to compile on fedora by installing all the dependencies .. my nothing wrong there error on error. nevertheless I was wondering if we could compile it directly on the raspberry? (rpi-os) which would be really nice it would be a tutorial to describe step by step :) I will try again because I like to progress ... unfortunately with the covid not had much school and therefore not really advanced in this 1 year. i hope a tutorial comes out .. have a nice day.
-
I have just been working 'offline' so far and not merged my stuff back in.
You could try a code upload I did last night that might work better.https://github.com/Fredrum/test_01
Note, you still have to add Qt5.12 as mentioned above!
The resolution is hardcoded in right now but if you get it generally working first you could try changin to 1080p in,
/home/pi/chiaki/chiaki_rpi/gui/src/pihwdecode.cpp
around line 116.Also note there's still issues with garbled video stream at startup (should clear up when you start playing)
And I'm having trouble with the PS4 Joypad connected to the Pi I have to take it in and out + press PS button 3-4 times before it starts working.So yeah, this is a rough version.
-
thanks, but getting below error once trying to make your test version:
-- The C compiler identification is GNU 8.3.0 -- The CXX compiler identification is GNU 8.3.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PythonInterp: /usr/bin/python3 (found suitable version "3.7.3", minimum required is "3") -- Found PythonInterp: /usr/bin/python3 (found suitable version "3.7.3", minimum required is "2.7") -- Found Opus: /usr/include -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Found OpenSSL: /usr/lib/arm-linux-gnueabihf/libcrypto.so (found version "1.1.1d") -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29") -- Checking for module 'libudev' -- Found libudev, version 241 -- Checking for module 'libevdev' -- Found libevdev, version 1.6.0 -- Found Udev: udev (found version "241") -- Found Evdev: evdev (found version "1.6.0") -- Setsu enabled -- QT5 version chosen: /usr/lib/qt5.12/include//usr/lib/qt5.12/include/QtMultimedia/usr/lib/qt5.12/include/QtNetwork/usr/lib/qt5.12/include/QtCore/usr/lib/qt5.12/.//mkspecs/linux-rpi3-g++/usr/lib/qt5.12/include/QtGui/usr/include -- Found SDL2: /usr/lib/arm-linux-gnueabihf/cmake/SDL2/sdl2-config.cmake -- Checking for module 'libavutil' -- Found libavutil, version 56.22.100 -- Checking for module 'libswresample' -- Found libswresample, version 3.3.100 -- Checking for module 'libswscale' -- Found libswscale, version 5.3.100 -- Checking for module 'libavcodec' -- Found libavcodec, version 58.35.100 -- Found FFMPEG: avcodec;avutil (found version "56.22.100") found components: avcodec avutil -- Configuring done CMake Error at gui/CMakeLists.txt:50 (add_executable): Cannot find source file: /home/pi/chiaki/chiaki_rpi/third-party/h264bitstream/h264_stream.h Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx CMake Error at gui/CMakeLists.txt:50 (add_executable): No SOURCES given to target: chiaki
i think CMakeLists reffers to non existing directory - "chiaki_rpi". Once correcting to /home/pi/chiaki/third-party/
i get bellow during make in 60%
[ 60%] Building CXX object gui/CMakeFiles/chiaki.dir/src/main.cpp.o In file included from /home/pi/chiaki/gui/include/videodecoder.h:38, from /home/pi/chiaki/gui/include/streamsession.h:28, from /home/pi/chiaki/gui/include/streamwindow.h:23, from /home/pi/chiaki/gui/src/main.cpp:6: /home/pi/chiaki/gui/include/pihwdecode.h:9:10: fatal error: Limelight.h: Nie ma takiego pliku ani katalogu #include "Limelight.h" // from moonlight ^~~~~~~~~~~~~ compilation terminated. make[2]: *** [gui/CMakeFiles/chiaki.dir/build.make:73: gui/CMakeFiles/chiaki.dir/src/main.cpp.o] BĹ‚Ä…d 1 make[1]: *** [CMakeFiles/Makefile2:442: gui/CMakeFiles/chiaki.dir/all] BĹ‚Ä…d 2 make: *** [Makefile:163: all] BĹ‚Ä…d 2
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.