Commit graph

119 commits

Author SHA1 Message Date
sergystepanov
e2f3e005ef Fix speex build libs 2025-12-14 16:31:13 +03:00
sergystepanov
410610349b Switch to UCRT toolchain in MSYS2 2025-04-17 09:11:26 +03:00
Sergey Stepanov
82aebf6647 Fix Package 'libgl1-mesa-glx' has no installation candidate 2024-12-14 14:14:56 +03:00
Sergey Stepanov
8fa53f4e32
Disable macos 2024-12-04 22:16:58 +03:00
Sergey Stepanov
45cc9e8245 Move library config to the top level 2024-11-17 12:59:43 +03:00
Sergey Stepanov
7da993a4c7 Add the uniqueSaveDir option
This option allows for the safe use of distinct filesystem snapshots of games with some cores (e.g., DosBox). Keep in mind that with this option enabled, game changes won't be saved (the unique save folder will be deleted on exit) until you explicitly call the save (or share) function. Thus, you will need files like dosbox.conf along with the games to use some default behaviors with each new game session.
2024-08-21 18:52:26 +03:00
Sergey Stepanov
e2521eea94
Update cr docker-compose for X11 2024-08-11 13:04:50 +03:00
Sergey Stepanov
20e9449bb1
Fix for build.yml 2024-05-21 20:20:21 +03:00
sergystepanov
c2e9d67bcb
Update Windows software OpenGL Mesa drivers to 24.0.7 (#454)
Needed for Zink (Vulkan OpenGL) in the future.
2024-05-21 20:14:52 +03:00
Sergey Stepanov
3989a735ac
Update dependencies 2024-05-20 22:46:59 +03:00
Sergey Stepanov
99976dd560
Add frame-options option 2024-05-13 19:29:13 +03:00
Sergey Stepanov
9b56ffc87c
Fix macOS tests
Main thread locking hangs OpenGL emulators.
2024-05-07 21:05:12 +03:00
Sergey Stepanov
a4f0dbbca8
Add a health check in cloudretro.io 2024-05-07 19:11:55 +03:00
Sergey Stepanov
b812887f6e
LibJPEG linking is broken on macOS 14 Sonoma :/ 2024-04-23 21:09:48 +03:00
Sergey Stepanov
4e241d0448 Swap x264-git dep to libx264 in Msys2/Arch 2024-02-10 21:13:49 +03:00
Sergey Stepanov
ccb0f410ab Revert "Revert Go version back to 1.20"
This reverts commit 1a44b94c85.
2024-02-10 21:13:49 +03:00
Sergey Stepanov
1a44b94c85
Revert Go version back to 1.20
Go 1.22 crashes under Windows with h264 encoder.
2024-02-08 16:38:40 +03:00
Sergey Stepanov
53a3624aef
Upload test frames separately 2024-02-07 12:48:59 +03:00
Sergey Stepanov
d6ceaad220
Enable overwrite for the upload-artifact action 2024-02-07 12:39:17 +03:00
Sergey Stepanov
e67b98d6fe
Update Github actions 2024-02-07 12:33:29 +03:00
Sergey Stepanov
610e087bcd Update to Go 1.22.0 2024-02-07 11:55:40 +03:00
Sergey Stepanov
f7c2524098
Add libjpeg to builds 2023-10-18 14:24:47 +03:00
Sergey Stepanov
f8fb128e97 Update CI 2023-10-16 14:57:25 +03:00
Sergey Stepanov
f11cad157b Use static libyuv for macs 2023-10-16 01:50:06 +03:00
Sergey Stepanov
b1b33713d6 Add the initial libyuv support
The main benefit of libyuv, apart from shortening the video pipeline, is quite noticeable latency and CPU usage decrease due to various assembler/SIMD optimizations of the library. However, there is a drawback for macOS systems: libyuv cannot be downloaded as a compiled library and can only be built from the source, which means we should include a cropped source code of the library (~10K LoC) into the app or rise the complexity of macOS dev and run toolchains. The main target system -- Linux, and Windows will use compiled lib from the package managers and macOS will use the lib included as a shortened source-code.

Building the app with the no_libyuv tag will force it to use libyuv from the provided source files.
2023-10-15 18:55:53 +03:00
Sergey Stepanov
ae3f91dfc6
Add diagnostic input to FBNeo on crio 2023-08-24 10:16:58 +03:00
Sergey Stepanov
882aae9daf
Use Go 1.20.7 for builds 2023-08-24 00:37:56 +03:00
Sergey Stepanov
8e92f6822e
Revert Go version to 1.20 due to MacOS crash 2023-08-09 19:19:10 +03:00
Sergey Stepanov
b2e4848ed3
Update to Go 1.21.0 2023-08-09 19:08:25 +03:00
Sergey Stepanov
4a627a30f2
Use alt pcsx-rearmed build for prod 2023-07-08 23:07:38 +03:00
Sergey Stepanov
39c63ec44a
Update cloudretro.io deployments 2023-05-12 16:49:15 +03:00
Sergey Stepanov
1dc0cabc2b Add special Dockerfile for tiny coordinator (<10Mib) and worker (<150Mib) containers 2023-05-12 14:31:21 +03:00
Sergey Stepanov
b227260060 Embed config.yaml into both apps 2023-05-12 14:31:21 +03:00
Sergey Stepanov
7455ad3f47
Update deployment to cloudretro.io 2023-04-26 23:27:00 +03:00
Sergey Stepanov
b65e8dc3f3
Use master for deploy 2023-04-20 22:53:44 +03:00
Sergey Stepanov
137d1b63d8
Fix build-args for Docker GHA 2023-04-20 21:59:52 +03:00
Sergey Stepanov
31638b0805
Update Docker GH Action
Now it will push the master tag instead of dev for the main branch.
2023-04-20 21:49:52 +03:00
Sergey Stepanov
ec5bcbc9c7
Update deployment 2023-04-06 12:59:48 +03:00
sergystepanov
cfd5b1ae8d
Libretro cores config in yaml (#392)
Removes separate config files for Libretro cores stored in the cores folder and replaces them with options in the main config.yaml file.
2023-04-06 11:25:49 +03:00
Sergey Stepanov
583e4659ad
Update deployment 2023-04-03 00:13:37 +03:00
Sergey Stepanov
40c8867e44
Update docker-compose for deployments 2023-03-30 18:27:56 +03:00
Sergey Stepanov
d7f61c4b30
Update the default deployments 2023-03-29 20:53:16 +03:00
Sergey Stepanov
361c3a67ee
Use builtin Docker Compose in the deployment script 2023-03-29 14:04:38 +03:00
Sergey Stepanov
4a686e9fce
Use single server deploy by default 2023-03-27 22:20:14 +03:00
Sergey Stepanov
f30e017101
Disable Oracle provider for the default deployment 2023-03-25 23:59:40 +03:00
Sergey Stepanov
8006939d69
Update versions 2023-02-04 22:54:18 +03:00
sergystepanov
3bd959b4ef
Refactored v3 (#350)
This PR contains refactored code.

**Changelog**
- Added new net code (the communication architecture was left intact).
- All network client IDs now have custom type `network.Uid` backed by github.com/rs/xid lib.
  ```
  The string representation of a UUID takes 32 bytes, and the new type will take just 16.
  Because of Golang JSON serialization problems with omitting zero-length empty slices (it can't) 
  and the need to use UID values as map keys (maps don't support slices as keys), 
  IDs are stored as strings (for now).
  ```
- A whole new WebSocket client/server implementation was added, as well as a new communication layer with synchronous and async call handlers.
  - WebSocket connections now support dedicated Ping/Pong frames as opposed to original ping text messages.
  - Used Gorilla WebSocket library doesn't allow concurrent (simultaneous) reads and writes, so this part was handled via send channel synchronization.
- New API structures can be found in the `pkg/api` folder.
- New communication protocol can be found in the `pkg/com/*` folder.
- Updated communication protocol is based on JSON-encoded messaging through WebSocket and has the following structure:
  ```
  Packet
    [id] string — a globally unique identification tag for the packet to track it trough a chain of requests.
    t uint8 — contains packet type information (i.e. INIT_PACKET, SDP_OFFER_PACKET, ...).
    [p] any — contains packet data (any type).

  Each packet is a text message in JSON-serialized form (WebSocket control frames obviously not).
  ```
  ```
  The main principle of this protocol and the duplex data exchange is:
  the one who initializes connection is called a client, and 
  the one who is being connected to is called a server. 
  With the current architecture, the coordinator is the server, the user browsers and workers are the clients.

            ____           ____
           ↓    ↑         ↑    ↓
     browser ⟶ coordinator ⟵ worker
       (c)          (s)         (c)

  One of the most crucial performance vise parts of these interactions is that 
  all the server-initiated calls to clients should be asynchronous!
  ```
  - In order to track synchronous calls (packets) with an asynchronous protocol, such as WebSocket, each packet may have an `id` that should be copied in all subsequent requests/responses.
  - The old `sessionID` param was replaced by `id` that should be stored inside the `p` (payload) part of the packet.
- It is possible to skip the default ping check for all connected workers on every user connection and just pick the first available with the new roundRobin param in the coordinator config file `coordinator.roundRobin: true/false`.
- Added a dedicated package for the system API (pkg/api/*).
- Added structured logging system (zerolog) for better logging and cloud services integration.
- Added a visual representation of the network message exchange in logs:
  ```
  ...
  01:00:01.1078 3f98 INF w → c Handshake ws://localhost:8000/wso
  01:00:01.1138  994 INF c ← w Handshake localhost:8000
  01:00:01.1148  994 INF c ← w Connect cid=cep.hrg
  01:00:01.1158  994 DBG c     connection id has been changed to cepl7obdrc3jv66kp2ug cid=cep.hrg
  01:00:01.1158 3f98 INF w → c Connect cid=cep.2ug
  01:00:01.1158  994 INF c     New worker / addr: localhost, ...
  01:00:01.1158 3f98 INF w     Connected to the coordinator localhost:8000 cid=cep.2ug
  01:00:02.5834  994 INF c ← u Handshake localhost:8000
  01:00:02.6175  994 INF c ← u Connect cid=cep.hs0
  01:00:02.6209  994 INF c     Search available workers cid=cep.hs0
  01:00:02.6214  994 INF c     Found next free worker cid=cep.hs0
  01:00:02.6220  994 INF c → u InitSession cid=cep.hs0
  01:00:02.6527  994 INF c ← u WebrtcInit cid=cep.hs0
  01:00:02.6527  994 INF c → w ᵇWebrtcInit cid=cep.hrg
  01:00:02.6537 3f98 INF w ← c WebrtcInit cid=cep.2ug
  01:00:02.6537 3f98 INF w     WebRTC start cid=cep.2ug
  ...
  ```
- Replaced a monstrous Prometheus metrics lib.
- Removed spflag dependency.
- Added new `version` config file param/constant for compatibility reasons.
- Bump the minimum required version for Go to 1.18 due to use of generics.
- Opus encoder now is cached and the default config is 96Kbps, complexity 5 (was 196Kbps, 8).
- Changed the default x264 quality parameters to `crf 23 / superfast / baseline` instead of `crf 17 / veryfast / main`.
- Added a separate WebRTC logging config param `webrtc.logLevel`.
- Worker now allocates much less memory.
- Optimized and fixed RGB to YUV converter.
- `--v=5` logging cmd flag was removed and replaced with the `debug` config parameter.


**Breaking changes (migration to v3)**
- Coordinator server API changes, see web/js/api/api.js.
- Coordinator client event API changes:
  - c `GAME_PLAYER_IDX_CHANGE` (string) -> `GAME_PLAYER_IDX` (number)
  - c `GAME_PLAYER_IDX` -> `GAME_PLAYER_IDX_SET`
  - c `MEDIA_STREAM_INITIALIZED` -> `WEBRTC_NEW_CONNECTION`
  - c `MEDIA_STREAM_SDP_AVAILABLE` -> `WEBRTC_SDP_OFFER`
  - c `MEDIA_STREAM_CANDIDATE_ADD` -> `WEBRTC_ICE_CANDIDATE_RECEIVED`
  - c `MEDIA_STREAM_CANDIDATE_FLUSH` -> `WEBRTC_ICE_CANDIDATES_FLUSH`
  - x `MEDIA_STREAM_READY` -> **removed**
  - c `CONNECTION_READY` -> `WEBRTC_CONNECTION_READY`
  - c `CONNECTION_CLOSED` -> `WEBRTC_CONNECTION_CLOSED`
  - c `GET_SERVER_LIST` -> `WORKER_LIST_FETCHED`
  - x `KEY_STATE_UPDATED` -> **removed**
  - n `WEBRTC_ICE_CANDIDATE_FOUND`
  - n `WEBRTC_SDP_ANSWER`
  - n `MESSAGE`
- `rtcp` module renamed to `webrtc`.
- Controller state equals Libretro controller state (changed order of bits), see: web/js/input/input.js.
- Added new `coordintaor.selector` config param that changes the selection algorithm for workers. By default it will select any free worker. Set this param to `ping` for the old behavior.
- Changed the name of the `webrtc.iceServers.url` config param to `webrtc.iceServers.urls`.
2023-01-09 23:20:22 +03:00
Sergey Stepanov
046e272c5f
Clean old Docker images when deploying 2022-04-09 10:32:31 +03:00
sergystepanov
59c3d4a6c7
Pull all the images when deploying 2022-04-09 09:43:51 +03:00
Sergey Stepanov
242b8f0a1f
Update Go version to 1.18 for builds 2022-03-21 12:15:14 +03:00