From b41b7acf80ad6d49cfde49ae562aaf85ba4f8768 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Wed, 20 Nov 2024 09:57:49 -0500 Subject: Initial hardware config, refactor flake doc -> docs Signed-off-by: Andrew Opalach --- docs/design.dia | 1076 ++++++++++++++++++++++++++ docs/design.txt | 57 ++ docs/design_diagram.svg | 508 ++++++++++++ docs/network_independent_audio_pause.kra | Bin 0 -> 1332660 bytes docs/network_independent_audio_pause.png | Bin 0 -> 148138 bytes docs/references/pal_vs_ntsc_aspect_ratio.png | Bin 0 -> 72101 bytes docs/references/references.txt | 68 ++ docs/style.css | 13 + 8 files changed, 1722 insertions(+) create mode 100644 docs/design.dia create mode 100644 docs/design.txt create mode 100644 docs/design_diagram.svg create mode 100644 docs/network_independent_audio_pause.kra create mode 100644 docs/network_independent_audio_pause.png create mode 100644 docs/references/pal_vs_ntsc_aspect_ratio.png create mode 100644 docs/references/references.txt create mode 100644 docs/style.css (limited to 'docs') diff --git a/docs/design.dia b/docs/design.dia new file mode 100644 index 0000000..e78aeca --- /dev/null +++ b/docs/design.dia @@ -0,0 +1,1076 @@ + + + + + + + + + + + + + #A4# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Client (libclient)# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Sink (libsink)# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Server# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Node# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Remote Resource# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #Synced Stream (liana)# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #System Interface# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #The Internet# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #You# + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/design.txt b/docs/design.txt new file mode 100644 index 0000000..ef98961 --- /dev/null +++ b/docs/design.txt @@ -0,0 +1,57 @@ +:stylesheet: style.css + += CAMU - Self-Hosted Media Streamer/Organizer/Archiver + +image::design_diagram.svg[Diagram,820] + +Breif on Components +------------------- +Server +~~~~~~ +The server is the main hub responsible for all handling user account related functions and state, as well as managing the network of all other individual components. + +User Accounts +^^^^^^^^^^^^^ +Users accounts contain 4 main concepts: lists, media lists, history, and settings. + +* *Lists*: Transient lists of media connected to a user-selected set of sinks. Resources retrived via browse/search instances get added to a list for playback. A list's active sinks can be changed on the fly. + +* *Media Lists*: A more organized way to collect related media. They are stored to the user's account and therefore saved to the disk. + +* *History*: A detailed history that tracks what a user played and when. Also saved to a user's account. + +* *Settings*: Various per-user settings. For example, tag blacklist, start/stop times per resource, skip settings per collection (album tracks). + +Node +~~~~ +Nodes can be seen as distributed resource managers for the server. They each contain up to 3 main parts: A source manager and/or database, then a resource host. A node can have one or both of a source manager and database but a node without either is useless. + +Source Manager +^^^^^^^^^^^^^^ +A source manager implements any or all of browsing, searching, and custom resource actions. A big point of a source manager is to be able to work entirely behind a proxy. Some examples of sources may include a social media website, filesystem directory, dvd drive, or radio antenna. An example of browsing could be apple music's "New Music". An example of searching, youtube search. A custom action could be liking a post on twitter. + +Database +^^^^^^^^ +Stores resources along with as much metadata as possible. Simply used to retrive resources locally instead of going through the source manager. + +Resource Host +^^^^^^^^^^^^^ +Hosts node-local resources for the server to use for streaming. Should support anything a source manager can give it. + +Client +~~~~~~ +Clients are the only way a user interacts with the rest of the network besides the special case of play, pause, skip and seek which can be done from a sink. + +libclient +^^^^^^^^^ +C library that integrates with the rest of the code-base to abstract communicating with the server as a client. + +Sink +~~~~ +A sink's only purpose is to be a minimal, yet optimal, way to view the entries in a list. + +libsink +^^^^^^^ +C library that abstracts communicating with the server as a sink in a platform- and environment-independent way. + +// vim: set syntax=asciidoc: diff --git a/docs/design_diagram.svg b/docs/design_diagram.svg new file mode 100644 index 0000000..693b086 --- /dev/null +++ b/docs/design_diagram.svg @@ -0,0 +1,508 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Client (libclient) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sink (libsink) + + + Server + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Node + + + + + + + + + + + + + + + + + Remote Resource + + + Synced Stream (liana) + + + + + + System Interface + + + + + + The Internet + + + You + + + diff --git a/docs/network_independent_audio_pause.kra b/docs/network_independent_audio_pause.kra new file mode 100644 index 0000000..91b391e Binary files /dev/null and b/docs/network_independent_audio_pause.kra differ diff --git a/docs/network_independent_audio_pause.png b/docs/network_independent_audio_pause.png new file mode 100644 index 0000000..8e696e2 Binary files /dev/null and b/docs/network_independent_audio_pause.png differ diff --git a/docs/references/pal_vs_ntsc_aspect_ratio.png b/docs/references/pal_vs_ntsc_aspect_ratio.png new file mode 100644 index 0000000..e570f70 Binary files /dev/null and b/docs/references/pal_vs_ntsc_aspect_ratio.png differ diff --git a/docs/references/references.txt b/docs/references/references.txt new file mode 100644 index 0000000..2ce8329 --- /dev/null +++ b/docs/references/references.txt @@ -0,0 +1,68 @@ +:stylesheet: ../style.css + += References + +Video +----- +Vsync/VRR +~~~~~~~~~ +* https://github.com/swaywm/sway/issues/5076 +* https://en.wikipedia.org/wiki/Motion_interpolation +* https://gamedev.stackexchange.com/questions/82318/what-problem-does-double-or-triple-buffering-solve-in-modern-games + - Good explanation of vsync and multiple buffering +* https://linustechtips.com/topic/1508075-no-vsync-with-no-screen-tearing-possible/?do=findComment&comment=15948456 +* https://forums.tomshardware.com/threads/games-screen-tearing-without-vsync.3272775/post-20062033 +* Current understanding of vsync and tearing: + - Vsync operates on an interupt. + - You cannot avoid tearing without vsync. + - VRR is completely ineffective outside of the display's supported range. + - A higher fps and refresh rate while tearing will be less noticable. +* https://blurbusters.com/gsync/gsync101-input-lag-tests-and-settings/14/ +* https://blurbusters.com/gsync/gsync101-input-lag-tests-and-settings/15/ +* https://old.reddit.com/r/Amd/comments/4ypw5k/freesync_is_so_fcking_awesome/d6zl13v/ + +Latency/Present +~~~~~~~~~~~~~~~ +* https://themaister.net/blog/2023/11/12/my-scuffed-game-streaming-adventure-pyrofling/ + +Old Video Standards +~~~~~~~~~~~~~~~~~~~ +* https://en.wikipedia.org/wiki/24p +* https://en.wikipedia.org/wiki/Three-two_pull_down +* https://cinematography.com/index.php?/forums/topic/71346-why-23976-and-not-24-fps/&tab=comments#comment-455454 +* https://forum.doom9.org/archive/index.php/t-163655.html +* https://en.wikipedia.org/wiki/pixel_aspect_ratio +* https://en.wikipedia.org/wiki/display_aspect_ratio + - PAL and NTSC are both supposed to be displayed on 4:3 physical aspect ratio screens even though they are internally different aspect ratios and resolutions. The difference is the size of the "pixel" (PAL has more, shorter scanlines). + image:pal_vs_ntsc_aspect_ratio.png[PalVsNtsc,1100] +* https://en.wikipedia.org/wiki/Anamorphic_widescreen + +Audio +----- +Formats +~~~~~~~ +* https://github.com/derselbst/ANMP +* https://slack.net/~ant/libs/audio.html#Game_Music_Emu + +Drivers +~~~~~~~ +* https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/master/spa/plugins/alsa/test-timer.c +* https://stackoverflow.com/questions/41263580/what-exactly-does-alsas-snd-pcm-delay-return +* https://stackoverflow.com/questions/24040672/the-meaning-of-period-in-alsa + +Latency +^^^^^^^ +* https://blog.nirbheek.in/2018/04/a-simple-method-of-measuring-audio.html?m=1 + +User Interface +-------------- +Terminal +~~~~~~~~ +* https://www.amp-what.com/ +* https://www.unicode.org/charts/beta/nameslist/n_2B00.html + +Python +------ +* https://stackoverflow.com/questions/38243682/whats-the-standard-way-to-package-a-python-project-with-dependencies + +// vim: set syntax=asciidoc: diff --git a/docs/style.css b/docs/style.css new file mode 100644 index 0000000..f99c06c --- /dev/null +++ b/docs/style.css @@ -0,0 +1,13 @@ +body { + font-family: serif; + margin: 1em 35% 1em 5%; + background-color: #fef9fa; +} + +h3 { + text-decoration: underline; +} + +strong { + color: #423152; +} -- cgit v1.2.3-101-g0448