Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Help: Compiling Chiaki - PS4 remote play



  • Hello, I saw that Chiaki, an opensource alternative for the PS4 remote play was released for linux, android, windows and Mac. So i wonder if its possible to compile this program to retropie.
    Since I dont know how to compile correctly or even if its possible to compile to the raspberry pi, i am asking to anyone to help me compile.
    Here is the link to Chiaki:

    https://github.com/thestr4ng3r/chiaki



  • 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:
    First download/clone the source files from the github repository -> Open Linux Terminal and go into the source files folder with the cd "source folder" command -> Try searching for the dependencies to install by using sudo 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.




  • Global Moderator

    @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.


  • Global Moderator

    @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.

    alt text

    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.

    https://github.com/zerojay/chiaki



  • 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,

    1. Install Qt5.12 from https://github.com/koendv/qt5-opengl-raspberrypi (please let me know if this is doable with apt?)

    2. 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!

    1. Build chiaki as usual.

    2. 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!



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.