Commit graph

572 commits

Author SHA1 Message Date
sergystepanov
4c883cf8e4
Fix x264 build trash (#282)
* Check x264 lib version with some conditional hacks for versions < 159
2021-02-21 21:41:10 +03:00
Sergey Stepanov
98ca6e7ace
Skip normal ErrServerClosed errors 2021-02-21 16:13:29 +03:00
Sergey Stepanov
0f54e0fb15
Fix copy-by-value of sync.Lock in the monitoring server struct 2021-02-21 15:52:01 +03:00
sergystepanov
bd701f10fc
Use modified x264 lib (#275)
* Use modified x264 lib

* Add x264 system lib

* Set x264 version 155 for Debian (Buster)

* Add h264 config params

* Set vp8 codec
2021-02-21 13:51:44 +03:00
sergystepanov
b56069c96e
Fix stream freeze (#279)
* Fix D-pad key and overlay

* Add Video element error reporting

* Terminate clientside ws ping on the connection terminate
2021-02-20 18:45:43 +03:00
Sergey Stepanov
c37c2c3004
Fix D-pad key and overlay 2021-02-20 00:12:05 +03:00
sergystepanov
92d0dd76f4
Refactor input for safe concurrency (#278)
* Extract input stuff

* Move d-pad option into the main screen

* Add mutex lock on the whole input user sessions struct
2021-02-19 20:33:58 +03:00
sergystepanov
55208e59d3
Update the Go version to 1.16 in the CI 2021-02-17 13:58:38 +03:00
giongto35
5de666d4af
Fix small bug, to not response on Empty Packet 2021-02-16 22:30:43 +08:00
sergystepanov
c01ddc869b
Don't hide save/load after the help show 2021-02-08 23:24:01 +03:00
sergystepanov
7bc9661b3d
Add experimental core's SRAM save/load (#273)
* Add experimental core's SRAM save/load

* Clean room.go

* Update Save RAM states

* Update dependencies

* Extract emulator states into a separate module

* Google Cloud saves don't support save RAM persistence, but save state (.dat) files only.

* Add emulator storage path into the configuration file

* Verify offline storage path
2021-02-06 01:12:24 +03:00
sergystepanov
6584d8219c
Disable PIE (ASLR) build mode for Windows (#272)
Since Go version 1.15 ASLR security mode is enabled by default for Windows builds. In order to make it work without random NPE crashes in the cores (as example in PSX games during load), you have to (re)compile every core with ASLR support or just disable this mode.

See: https://github.com/golang/go/issues/35192
2021-01-30 01:29:01 +03:00
sergystepanov
816b210150
Client game screen configuration support (#269)
* Move game screen to a separate [stream] module

* Add a simple canvas video mirror for post-processing

* Add video mirroring to the options
2021-01-25 12:58:05 +03:00
Sergey Stepanov
69bc3cbb6f
Use new OPUS buffer every audio frame for less garbage 2021-01-21 19:25:19 +03:00
sergystepanov
76b7cafb71
Refactor OPUS encoder for quality and speed (#262)
* Refactor OPUS encoder for quality and speed.

Use OPUS low delay mode (https://www.opus-codec.org/docs/opus_api-1.1.3/group__opus__ctlvalues.html#ga592232fb39db60c1369989c5c5d19a07)

* Slightly tweak linear resample function and disable it on 48kHz input

* Rewrite OPUS encoder as a struct with some internal buffer

* Use OPUS 192Kbps preset by default

* Add encoder callback function on a full buffer

* Reuse OPUS output buffer

* Add write limiter for samples
2021-01-18 23:20:50 +03:00
Sergey Stepanov
f7152c7d21
Fix control buttons width 2021-01-18 22:49:47 +03:00
sergystepanov
28f0409262
Use host network by default in docker-compose 2021-01-15 19:18:57 +03:00
Sergey Stepanov
f05e149b0e
Remove unnecessary logging 2021-01-13 20:48:12 +03:00
Sergey Stepanov
949f713060
Remove unnecessary rotation 2021-01-13 20:44:32 +03:00
Sergey Stepanov
9df10f5d12
Add explicit file close when reading game size 2021-01-12 04:32:51 +03:00
Sergey Stepanov
328236ed53
Add explicit file close when reading game size 2021-01-12 03:25:51 +03:00
Sergey Stepanov
70170a6c87
Use embedded mutex for emulator structs 2021-01-12 02:03:40 +03:00
Sergey Stepanov
fa46267e60
Fix wording 2021-01-11 02:41:59 +03:00
Sergey Stepanov
d141898794
Remove old game save files name separator 2021-01-11 02:35:01 +03:00
Sergey Stepanov
646e0d6039
Change wording for worker rooms and sessions inside 2021-01-11 02:31:31 +03:00
Sergey Stepanov
7984534fa7
Remove unused in workers ws upgrade function 2021-01-11 02:11:10 +03:00
Sergey Stepanov
6b8cad6ef8
Clean room run check condition 2021-01-11 02:09:49 +03:00
Sergey Stepanov
8a41c830bd
Update GitHub CI build 2021-01-09 16:45:47 +03:00
Sergey Stepanov
07b7479af2
Update Docker configs 2021-01-09 16:39:18 +03:00
Sergey Stepanov
072f7b5d1a
Remove NeoGeo from the default cores list 2021-01-09 16:28:57 +03:00
Sergey Stepanov
6f4e27d0fa
Optimize images 2021-01-09 13:55:33 +03:00
sergystepanov
924d6ade67
Fix Docker run for bridged Docker network in Windows, macOS (#259)
* Add port and IP config and env params for bridged Docker network in Windows, macOS

- CLOUD_GAME_WEBRTC_ICEIPMAP -- replaces IP of any ICE candidates on the server
- CLOUD_GAME_WEBRTC_ICEPORTS_MIN/MAX -- limits WebRTC random port range on the server
2021-01-08 22:43:15 +03:00
sergystepanov
a77985f44a
Add fallback repo for not found cores (#258)
* Add fallback repo for not found cores
2021-01-07 13:38:53 +03:00
sergystepanov
162c4b9bc8
Update README.md
Add disclaimer about Docker.
2021-01-06 18:59:49 +03:00
Sergey Stepanov
6568c83aeb
Add SSL certificates for HTTPS downloads 2021-01-06 18:41:09 +03:00
sergystepanov
53d15728fb
Use an interceptor for changing video timestamps (#255) 2021-01-06 14:09:11 +03:00
Sergey Stepanov
8bed364bb3
Remove useless lock in the custom track sample struct 2021-01-05 00:22:37 +03:00
Sergey Stepanov
a3d08637e0
Show server modules info properly 2021-01-05 00:14:59 +03:00
sergystepanov
62d8240e7c
Migrate to pion/webrtc v3 (#254)
* Add initial pion/webrtc v3 migration

* Use custom timestamps when sending video packets

* Update dependencies
2021-01-04 21:09:03 +03:00
sergystepanov
980a97a526
Handle no config situation for workers (#253)
(experimental feature)

Before a worker can start, it should have a configuration file. In case if such a file is not found it may request configuration from the coordinator to which it connected.

Added example logic if a worker is needed to be blocked until a successful packet exchange with a coordinator is being made.

* Add error return for config loader

* Add config loaded flag to worker

* Add zone flag

* Add a custom mutex lock with timout

* Refactor worker runtime

* Refactor internal api

* Extract monitoring server config

* Extract worker HTTP(S) server

* Add generic sub-server interface

* Add internal coordinator API

* Add internal routes and handlers to worker

* Add internal worker API

* Refactor worker run

* Migrate serverId call to new API

* Add packet handler to cws

* Extract handlers for internal worker routes in coordinator

* Pass worker to the worker internal heandlers

* Cleanup worker handlers in coordinator

* Add closeRoom packet handler to the API

* Add GetRoom packet handler to the API

* Add RegisterRoom packet handler to the API

* Add IceCandidate packet handler to the API (internal and browser)

* Add Heartbeat packet handler to the API (internal and browser)

* Rename worker routes init function

* Extract worker/coordinator internal ws handlers

* Update timed locker

* Allow sequential timed locks

* Add config request from workers

* Add nil check for the route registration functions
2021-01-03 21:23:55 +03:00
Sergey Stepanov
6cee6061b6
Handle more core diff cases 2021-01-01 22:04:19 +03:00
sergystepanov
1fcf34ee02
Add new Libretro core manager module (#249)
* Add initial external configuration files support.

These external configuration files allow changing app params at the runtime without recompilation.

* Find config files with specified directory in the tests

* Add aspect ratio recalculation config

* Clean code

* Add new configuration files into the Docker container image

* Add shared core and config paths into the Libretro cores config

* Split ROM <-> Emulator mapping between workers and coordinators

* Extract coordinator config

* Add shared worker/coordinator server config

* Add explicit embedded shared worker/coordinator struct for auto-config reflection fill

* Remove default stun/turn servers from the config

* Extract and add new ice servers config structures

* Update coordinator config params

* Add auto emulation lib loader based on the runtime OS/arch

* Update configuration structures

* Remove shared config embedding

* Add missing network config params

* Add game library external config

* Remove unused config parameters

* Add WebRTC encoder external options

* Add user dir for config search

* Update config loader

* Update config

* Add generic downloader with Grab lib implementation

* Add a simple file downloader backed by the grab lib

* Add initial Libretro core repos abstractions

* Expose compression info for Libretro cores repository records

* Add pipe-based abstract file downloader

* Refactor downloader

* Refactor Libretro repos

* Add worker coresync stubs

* Add multiprocess-safe HTTP-based core manager implementation

* Remove Libretro cores from the repo

* Keep custom N64 cores in te repo for now

* Add Libretro cores repo select in the config

* Fix http manager repo switch

* Cleanup code

* Add greedy Libretro lib loader

* Don't crash when arch map is not set

* Disable dynamic recompiler for pcsx core by default since it's could cause a crash

* Use global Libretro dynalib handler

* Shorten the default Libretro cores store path

* Update zip extractor implementation

* Remove explicit fig lib field markings

* Add config note to the README file

* Add GitHub repo backend for the core downloader

* Fix GitHub repo param list in the manager factory

* Add env variables reader with CLOUD_GAME prefix

* Re-optimize ice server info struct custom marshaler
2020-12-31 13:24:27 +03:00
Sergey Stepanov
7299ecc6d1
Add art credits 2020-11-25 20:57:46 +03:00
sergystepanov
3837e020cd
Enable legacy Github Docker Registry publishing workflow (#247)
* Update Docker publishing script
2020-11-25 00:22:37 +03:00
giongto35
569c76a2f8
Update README.md 2020-11-13 19:21:10 +08:00
giongto35
b945e81895
Update README.md 2020-11-13 19:20:35 +08:00
sergystepanov
bd6e146e64
Fix errors/misuse with OpenGL-based core API (#237)
* Follow Go standard for naming constants

* Use reformatted pixFormats for Libretro cores

* Use OpenGL 2.1 Core profile bindings for render instead 4.1

* Cleanup the code

* SDL attributes should be set before the sdl.Init call

* Use simple vertical frame flip function instead imaging lib with OpenGL renderer

* Use the separate control flow for the macOS OpenGL context handling

* Add OpenGL pixel type/format switch based on cores callback

* Use unified log instead of fmt

* Clean code

* Remove unnecessary SDL init flag

* Printout errors with SDL / OpenGL functions

* Add CGO Libretro logging output

* Use main thread lock for windows and OpenGL context

* Remove Darwin OS switch

* Add extended OpenGL version info print

* Update Libretro cores info print

* Add game library module (#232)

* Add game library

* Add missing local game lib files

* Add missing return statement

* Use v2 suffix

* Bump the dependencies

* Update Libretro modules to support headless test runners

* Port old savestates tests as example for Libretro cores runner testing

* Add n64 core example game and a test

* Update room tests for various games

* Add frame dump support for CI builds

* Add frame rendering to image output for core testing

* Update ROM frame exporter in tests

* Disable Docker image publishing

* Add frame rendering output for non-gl cores for CI

* Add auto GL context override for headless, gpu-less machines (e.g. Github CI Xeon)

* Add Windows CI headless cores frame render config

* Add missing Mesa OpenGL drivers to Ubuntu CI

* Add mupen n64 core download into CI tests

* Add Linux, macOS, Windows core frame render tests into CI

* Remove unnecessary var

* Add some comments

* Revert Y flip

* Move OpenGL into a separate package

* Add SDL package

* Update modules
2020-11-04 18:59:12 +08:00
sergystepanov
50762e95c7
Remove excessive Libretro pixel format logging (#244) 2020-11-02 00:51:53 +08:00
sergystepanov
5d28d6f94b
Add missing Ubuntu packages in the guide (#243)
* Add missing Ubuntu packages in the guide

* Bump expected Go language version for the app
2020-10-31 01:38:45 +08:00
giongto35
ea0a433ee9
Update README.md 2020-10-20 11:24:52 +08:00