Commit graph

122 commits

Author SHA1 Message Date
Sergey Stepanov
a73c0e8c5f
Update re-time interceptor.
Update re-time video frame interceptor to the latest pion WebRTC changes and keep it shared between all RTC peer connections.
2021-10-14 19:47:08 +03:00
Masaya Watanabe
c27e1fe2ab
Don't ignore cloud save download errors (#352) 2021-10-08 19:47:30 +03:00
Sergey Stepanov
be52ee18c5
Use default WebRTC codecs 2021-09-28 13:28:44 +03:00
Sergey Stepanov
891e397104
Update Buildbot arm file ext 2021-09-27 21:49:52 +03:00
Sergey Stepanov
03107ba902
Use unsigned return value for the Libretro frame rotation 2021-09-23 14:42:16 +03:00
sergystepanov
69ff8ae896
Update cloud data storage functionality (#349)
Add Oracle Data Storage support for cloud saves.
2021-09-20 10:17:59 +03:00
sergystepanov
47a9d70b74
Add the ability to set emulator ROM folder (#348)
Emulators now can load games with the same file extensions if you either place ROMs into the folder named as the emulator in the config file (libretro.core.list value) or any folder as you specify in the `libretro.core.list.{emulator}.folder` config param.
2021-08-30 19:50:35 +03:00
Sergey Stepanov
ed33460f38
Don't crash emulator on no core config 2021-08-26 15:22:01 +03:00
Sergey Stepanov
904b0ae1bb
Set coordinator server address to :http for cloudretro 2021-08-26 14:39:17 +03:00
Sergey Stepanov
25483b27b3
Enable http-01 challenge 2021-08-26 11:58:26 +03:00
Sergey Stepanov
5f941bf593
Use HTTPS redirect with HTTPS domain 2021-08-26 11:20:12 +03:00
Sergey Stepanov
048617373a
Use empty auto cert http handler 2021-08-25 23:13:27 +03:00
Sergey Stepanov
cd41759265
Try without auto cert wrapper redirect 2021-08-25 22:31:37 +03:00
sergystepanov
fb8ee791df
Update the prod deployment script (#341)
Test new deployment workflow.
2021-08-24 21:54:32 +03:00
Sergey Stepanov
c7b259f63d
Use zone prefix in the autocert whitelist 2021-08-16 23:34:41 +03:00
Sergey Stepanov
c865e83143
Expose a multi process mutex lock file config 2021-08-16 01:36:07 +03:00
Sergey Stepanov
8246fc6723
Use old ping-address generation logic 2021-08-15 21:25:50 +03:00
Sergey Stepanov
12312edd03
Add missing core downloader call 2021-08-12 22:22:46 +03:00
Sergey Stepanov
b4b199c244
Add public ping address option for worker 2021-08-09 17:54:49 +03:00
sergystepanov
431d215eee
Update server HTTPS configuration (#337)
* Merge HTTP and HTTPS routes builder in coordinator

* Extract HTTP/S routes

* Rename config in coordinator

* Generalize child services

* Extract games library helper function

* Use string address instead of port for HTTP/S

* Use a dedicated port extractor function

* Add missing GA tag templating

* Rename shared server address and port params

* Introduce TLS config parameters

* Simplify HTTP/S server constructors

* Update server auto port roll

* Extract init function in worker

* Reorder return params of address type port fn

* Refactor config handler names

* Update TLS default config params

* Extract HTTP to HTTPS redirect function

* Use httpx in monitoring

* Don't log echo requests

* Remove error return from the abstract server

* Add WSS option to the worker-coordinator connection

* Change default worker config

* Make worker send its internal connection params

* Decouple gamelib from the coordinator

* Expose HTTP/S listener address

* Keep original HTTP/S addresses

* Remove no config handler in worker

* Use HTTP-HTTPS redirection

* Wrap net.Listener into a struct

* Clean http server creation fn

* Redirect to https with a generated address

* Use URL in the redirector

* Use zone address param in worker

* Make use of actual addr and port in the monitoring servers

* Use auto-justified monitoring addresses info

* Add the non-HTTPS worker to HTTPS coordinator connection warning

* Embed TLS struct

* Move connection API struct into cws package
2021-08-09 10:42:06 +03:00
Sergy Stepanov
a3d2549028 Remove old is_mobile init param 2021-07-31 12:33:25 +03:00
Sergey Stepanov
03fb03a71a
Rename old app references 2021-07-30 13:30:15 +03:00
Sergey Stepanov
95f65b2b72
Add useless cache for worker's echo response 2021-07-30 12:48:36 +03:00
sergystepanov
d3e16a4a09
Make Google Analytics injection optional (#336)
This allows switching GA client statistics on the client by setting these params in the config.yaml file:
 analytics:
   inject: false/true
   gtag: (your tag)
By default, GA analytics will be disabled.
2021-07-30 12:29:16 +03:00
sergystepanov
cbabe69f30
Track connected user count of workers. (#328)
If a worker (game) is shared, then without tracking players it's impossible to tell when it becomes available for a new game which leads to emulator share and crashes.
2021-07-05 19:11:12 +03:00
Sergey Stepanov
fffe4813c4
Use OS aware file path concat with ROMs 2021-06-26 22:32:23 +03:00
giongto35
bc6027bf2b
Fix override env flag (#316) 2021-05-23 23:52:59 +08:00
Sergey Stepanov
ae5260fb47
Handle recover in VPX tests 2021-05-07 13:09:47 +03:00
sergystepanov
3e2a650b14
Fix the main save file path
Broken file check by just room name without the .dat extension always fails.
2021-04-22 20:09:24 +03:00
Sergey Stepanov
a7d8e53dac
Add video encoder tests 2021-04-17 12:55:54 +03:00
Sergey Stepanov
efd8679de3
Fix some mistakes 2021-04-14 11:37:43 +03:00
sergystepanov
602b9ea47c
Make executables ready for static linking (#307)
* Disable CGO (C libs) for coordinator

Needed for static linking.

* Fix "error strings should not be capitalized (ST1005)"

* Fix SA1015

Using time.Tick leaks the underlying ticker, consider using it only in endless functions, tests and the main package, and use time.NewTicker here (SA1015)

* Fix SA9004

Only the first constant in this group has an explicit type (SA9004).

* Remove unused code in the webrtc package

* Fix S1000

Should use a simple channel send/receive instead of select with a single case (S1000).

* Force dir creation/check for core downloader

* Update Makefile release script

* Disable ASLR for worker builds

* Remove WORKER_BUILD_PARAMS flag from the CI

* Don't force recompilation in release

* Add Debian packages installer script

* Build worker app without libopusfile

* Test worker app without libopusfile

* Add opus wrapper without opusfile

* Make install.sh executable

* Add opus lib in Win builds

* Make insecure HTTPS requests when downloading libs

* Add ca-certificates for Docker build stage

go mod download works only with SSL certificates installed.

* Move libx264 wrapper into the repo

That way we can get rid of a lot of not needed external Go dependencies.

* Update the dependencies
2021-04-06 18:16:52 +03:00
sergystepanov
d778a7e084
Allow to disable default Pion interceptors (#306)
For performance reasons.
2021-03-30 21:57:46 +03:00
sergystepanov
cbab5a1c71
Add deprecation note for libx264 < v160 (#301)
Deprecation due to libx264 version below v160 shouldn't work properly, and it's hard to support both v155, v160 in Golang.
2021-03-26 18:51:10 +03:00
sergystepanov
c7e67d5c3e
Use just one video/audio RTP codec (#298)
Negate exact matches with multiple video codecs when a negotiated list of codecs will be stripped of partially matched ones.
As an example, if we want to use the h264 codec along with vp8 then in some browsers we'll have the exact match on vp8 and some partial matches on h264 (different browsers have different SDP Fmtp) which leads to the forced use of vp8 when the app is streaming h264.
As a workaround, we should add only one codec (vp8 or h264) into the list.
2021-03-19 17:25:48 +03:00
sergystepanov
ccf082e46b
Set controller types explicitly (#295) 2021-03-17 18:27:13 +03:00
sergystepanov
a779353569
Reduce coordinator dependencies tree (#292)
* Reduce coordinator dependencies tree

* Parallelize build/check

* Update dependencies
2021-03-15 13:08:15 +03:00
sergystepanov
d5780acc75
Fix Pion WebRTC codecs (#289)
Since Pion's webrtc v3.0.13 and this fix if both peers have some fmtp set then codecs should match exactly. By default Pion defines a list of supported codecs with fmtp set but different browsers set their own fmtp values by default as well therefore they may not match.
To fix this we can define our own list of codecs on the server with empty fmtp so it will match any client codecs.

See: e5c8c659ca/rtpcodec.go (L99)
2021-03-08 17:22:43 +03:00
sergystepanov
f4c3a8cfef
Add new YUV converter with avg color calc (#287)
Add new YUV converter with 2x2 pixel matrix YUV color estimation.

The new YUV color converter, as opposed to the original one, uses more precise color calculations based on four neighboring pixels' average color values which helps a great deal with image aliasing / shimmering artifacts.
By default, it runs in the multithreaded mode with the game frames sliced between 2*(CPU cores) goroutines.
In case if this estimation mode doesn't work as expected it is possible to switch back to the original mode.

The default encoder is switched to x264 since it's faster now.
2021-03-07 18:17:52 +03:00
sergystepanov
fa28197390
Refactor and update VPX codec (#285)
* Refactor and update VPX codec

* Add VPX codec options support

* Add generic video encoding pipe

* Tweak in/out channels for the pipe

* Update YUV encoder

* Clean VP8 encoder
2021-02-27 18:09:55 +03:00
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
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
giongto35
5de666d4af
Fix small bug, to not response on Empty Packet 2021-02-16 22:30:43 +08: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
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
f05e149b0e
Remove unnecessary logging 2021-01-13 20:48:12 +03:00