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 --- .gitignore | 2 +- doc/design.dia | 1076 -------------------------- doc/design.txt | 57 -- doc/design_diagram.svg | 508 ------------ doc/network_independent_audio_pause.kra | Bin 1332660 -> 0 bytes doc/network_independent_audio_pause.png | Bin 148138 -> 0 bytes doc/references/pal_vs_ntsc_aspect_ratio.png | Bin 72101 -> 0 bytes doc/references/references.txt | 68 -- doc/style.css | 13 - 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 + flake.lock | 37 +- flake.nix | 462 +++++------ hardware/cmsb-001/cma-overlay.dts | 36 + hardware/cmsb-001/configuration.nix | 168 ++++ hardware/cmsb-001/disable-bt-overlay.dts | 59 ++ hardware/cmsb-001/justboom-digi-overlay.dts | 41 + hardware/cmsb-001/vc4-fkms-v3d-overlay.dts | 44 ++ scripts/screenrc | 2 +- 25 files changed, 2316 insertions(+), 1979 deletions(-) delete mode 100644 doc/design.dia delete mode 100644 doc/design.txt delete mode 100644 doc/design_diagram.svg delete mode 100644 doc/network_independent_audio_pause.kra delete mode 100644 doc/network_independent_audio_pause.png delete mode 100644 doc/references/pal_vs_ntsc_aspect_ratio.png delete mode 100644 doc/references/references.txt delete mode 100644 doc/style.css 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 create mode 100644 hardware/cmsb-001/cma-overlay.dts create mode 100644 hardware/cmsb-001/configuration.nix create mode 100644 hardware/cmsb-001/disable-bt-overlay.dts create mode 100644 hardware/cmsb-001/justboom-digi-overlay.dts create mode 100644 hardware/cmsb-001/vc4-fkms-v3d-overlay.dts diff --git a/.gitignore b/.gitignore index dda3f04..66cf542 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ build*/ compile_commands.json data/ -doc/**/*.html +docs/**/*.html env/bin/ src/portal/cpy/portal.c src/portal/cpy/portal.h diff --git a/doc/design.dia b/doc/design.dia deleted file mode 100644 index e78aeca..0000000 --- a/doc/design.dia +++ /dev/null @@ -1,1076 +0,0 @@ - - - - - - - - - - - - - #A4# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Client (libclient)# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Sink (libsink)# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Server# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Node# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Remote Resource# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #Synced Stream (liana)# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #System Interface# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ## - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #The Internet# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #You# - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/design.txt b/doc/design.txt deleted file mode 100644 index ef98961..0000000 --- a/doc/design.txt +++ /dev/null @@ -1,57 +0,0 @@ -: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/doc/design_diagram.svg b/doc/design_diagram.svg deleted file mode 100644 index 693b086..0000000 --- a/doc/design_diagram.svg +++ /dev/null @@ -1,508 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Client (libclient) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Sink (libsink) - - - Server - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Node - - - - - - - - - - - - - - - - - Remote Resource - - - Synced Stream (liana) - - - - - - System Interface - - - - - - The Internet - - - You - - - diff --git a/doc/network_independent_audio_pause.kra b/doc/network_independent_audio_pause.kra deleted file mode 100644 index 91b391e..0000000 Binary files a/doc/network_independent_audio_pause.kra and /dev/null differ diff --git a/doc/network_independent_audio_pause.png b/doc/network_independent_audio_pause.png deleted file mode 100644 index 8e696e2..0000000 Binary files a/doc/network_independent_audio_pause.png and /dev/null differ diff --git a/doc/references/pal_vs_ntsc_aspect_ratio.png b/doc/references/pal_vs_ntsc_aspect_ratio.png deleted file mode 100644 index e570f70..0000000 Binary files a/doc/references/pal_vs_ntsc_aspect_ratio.png and /dev/null differ diff --git a/doc/references/references.txt b/doc/references/references.txt deleted file mode 100644 index 2ce8329..0000000 --- a/doc/references/references.txt +++ /dev/null @@ -1,68 +0,0 @@ -: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/doc/style.css b/doc/style.css deleted file mode 100644 index f99c06c..0000000 --- a/doc/style.css +++ /dev/null @@ -1,13 +0,0 @@ -body { - font-family: serif; - margin: 1em 35% 1em 5%; - background-color: #fef9fa; -} - -h3 { - text-decoration: underline; -} - -strong { - color: #423152; -} 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; +} diff --git a/flake.lock b/flake.lock index 09983e1..17191df 100644 --- a/flake.lock +++ b/flake.lock @@ -1,20 +1,18 @@ { "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, + "nixos-hardware": { "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "lastModified": 1731797098, + "narHash": "sha256-UhWmEZhwJZmVZ1jfHZFzCg+ZLO9Tb/v3Y6LC0UNyeTo=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "672ac2ac86f7dff2f6f3406405bddecf960e0db6", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "NixOS", + "ref": "master", + "repo": "nixos-hardware", "type": "github" } }, @@ -36,24 +34,9 @@ }, "root": { "inputs": { - "flake-utils": "flake-utils", + "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs" } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index ed4e79b..2cef025 100644 --- a/flake.nix +++ b/flake.nix @@ -1,238 +1,244 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - flake-utils.url = "github:numtide/flake-utils"; + nixpkgs = { + url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + nixos-hardware = { + url = "github:NixOS/nixos-hardware/master"; + }; }; - outputs = { self, nixpkgs, flake-utils }: - flake-utils.lib.eachDefaultSystem - (system: - let - overlays = [ - (self: super: { - libplacebo = super.libplacebo.overrideAttrs (old: { - patches = []; - }); - }) - (self: super: { - notcurses = super.notcurses.overrideAttrs (old: { - patches = [ - ./subprojects/packagefiles/notcurses/notcurses_tmux.diff - ]; - }); - }) - ]; - pkgs = import nixpkgs { - inherit system; - inherit overlays; - config = { - allowUnfree = true; - android_sdk.accept_license = true; - }; - }; - in - with pkgs; - rec { - packages.default = stdenv.mkDerivation { - name = "camu"; - version = "0.01"; - src = self; - outputs = [ "out" "dev" ]; - nativeBuildInputs = [ - git - gcc - nasm - pkg-config - autoconf - automake - autogen - libtool - ninja - meson - cmake - ant - jdk8 - wayland-scanner - ]; - buildInputs = [ - (curl.override { websocketSupport = true; }) - jansson - libspng - ffmpeg-headless - libcdio - libcdio-paranoia - libdvdcss - libdvdread - libdvdnav - alsa-lib - pipewire - libpulseaudio - libplacebo - xxHash - lcms - shaderc - libGL - vulkan-headers - libxkbcommon - glib - dbus - gtk3 - glew - glfw3 - xorg.libX11 - wayland - wayland-protocols - wlr-protocols - egl-wayland - (notcurses.override { multimediaSupport = false; qrcodegenSupport = false; }) - libsodium - ]; - meta = with lib; { - homepage = "https://akon.city/"; - description = ""; - changelog = ""; - license = [ licenses.gpl3Only ]; - maintainers = with lib.maintainers; []; - }; - }; - devShells.default = mkShell { - NIX_HARDENING_ENABLE = ""; - nativeBuildInputs = packages.default.nativeBuildInputs ++ [ - gdb - clang-tools - ruff - ruff-lsp - perf-tools - valgrind - kcachegrind - ((python3.override {}).withPackages (python-pkgs: [ - python-pkgs.setuptools - python-pkgs.pip - python-pkgs.cython - python-pkgs.certifi - python-pkgs.requests - python-pkgs.beautifulsoup4 - ])) - perl - asciidoctor - pandoc - ]; - buildInputs = packages.default.buildInputs ++ []; - shellHook = '' - export NIX_SHELL="camu" - unset SOURCE_DATE_EPOCH - exec ${pkgs.zsh}/bin/zsh -l - ''; + outputs = { self, nixpkgs, nixos-hardware }: let + forAllSupportedSystems = function: + nixpkgs.lib.genAttrs [ + "x86_64-linux" + "i686-linux" + "aarch64-linux" + ] (system: function nixpkgs.legacyPackages.${system}); + forAllDevSystems = function: + nixpkgs.lib.genAttrs [ + "x86_64-linux" + ] (system: + function (import nixpkgs { + inherit system; + config = { + allowUnfree = true; + android_sdk.accept_license = true; }; + })); + in rec { + packages = forAllSupportedSystems (pkgs: { + default = with pkgs; stdenv.mkDerivation { + name = "camu"; + version = "0.01"; + src = self; + outputs = [ "out" "dev" ]; + nativeBuildInputs = [ + git + gcc + nasm + pkg-config + autoconf + automake + autogen + libtool + ninja + meson + cmake + ant + jdk8 + wayland-scanner + ]; + buildInputs = [ + (curl.override { websocketSupport = true; }) + jansson + libspng + ffmpeg-headless + libcdio + libcdio-paranoia + libdvdcss + libdvdread + libdvdnav + alsa-lib + pipewire + libpulseaudio + libplacebo + xxHash + lcms + shaderc + libGL + vulkan-headers + libxkbcommon + glib + dbus + gtk3 + glew + glfw3 + xorg.libX11 + wayland + wayland-protocols + wlr-protocols + egl-wayland + (notcurses.override { multimediaSupport = false; qrcodegenSupport = false; }) + libsodium + ]; + meta = with lib; { + homepage = "https://akon.city/"; + description = ""; + changelog = ""; + license = [ licenses.gpl3Only ]; + maintainers = []; + }; + }; + }); - devShells.wsl = mkShell { - NIX_HARDENING_ENABLE = ""; - nativeBuildInputs = devShells.default.nativeBuildInputs; - buildInputs = devShells.default.buildInputs; - shellHook = '' - export NIX_SHELL="camu-wsl" - unset SOURCE_DATE_EPOCH - exec ${pkgs.zsh}/bin/zsh -l -c kitty - ''; - }; + devShells = forAllDevSystems (pkgs: rec { + default = with pkgs; mkShell { + NIX_HARDENING_ENABLE = ""; + nativeBuildInputs = packages.${system}.default.nativeBuildInputs ++ [ + gdb + clang-tools + ruff + ruff-lsp + perf-tools + valgrind + kcachegrind + ((python3.override {}).withPackages (python-pkgs: [ + python-pkgs.setuptools + python-pkgs.pip + python-pkgs.cython + python-pkgs.certifi + python-pkgs.requests + python-pkgs.beautifulsoup4 + ])) + perl + asciidoctor + pandoc + ]; + buildInputs = packages.${system}.default.buildInputs; + shellHook = '' + export NIX_SHELL="camu" + unset SOURCE_DATE_EPOCH + exec ${pkgs.zsh}/bin/zsh -l + ''; + }; - devShells.mingw64 = let - gcc = pkgsCross.ucrt64.buildPackages.wrapCC (pkgsCross.ucrt64.buildPackages.gcc-unwrapped.override ({ - threadsCross = { - model = "win32"; - package = null; - }; - })); - gccWin32Stdenv = overrideCC pkgsCross.ucrt64.stdenv gcc; - in mkShell.override { stdenv = gccWin32Stdenv; } { - NIX_HARDENING_ENABLE = ""; - nativeBuildInputs = [ - git - buildPackages.gcc - gdb - nasm - pkg-config - autoconf - automake - autogen - ninja - meson - cmake - wineWowPackages.staging - glslang - python3 - ]; - buildInputs = with pkgsCross.ucrt64; [ - (zlib.override { shared = false; static = true; }) - xxHash - openssl - libidn2 - ]; - shellHook = '' - export NIX_SHELL="camu-mingw64" - unset SOURCE_DATE_EPOCH - exec ${pkgs.zsh}/bin/zsh -l - ''; - }; + wsl = with pkgs; default // mkShell { + shellHook = '' + export NIX_SHELL="camu-wsl" + unset SOURCE_DATE_EPOCH + exec ${pkgs.kitty}/bin/kitty zsh -l + ''; + }; - devShells.mingw32 = let - gcc = pkgsCross.mingw32.buildPackages.wrapCC (pkgsCross.mingw32.buildPackages.gcc-unwrapped.override ({ - threadsCross = { - model = "win32"; - package = null; - }; - })); - gccWin32Stdenv = overrideCC pkgsCross.mingw32.stdenv gcc; - in mkShell.override { stdenv = gccWin32Stdenv; } { - NIX_HARDENING_ENABLE = ""; - nativeBuildInputs = [] ++ devShells.mingw64.nativeBuildInputs; - buildInputs = with pkgsCross.mingw32; [ - (zlib.override { shared = false; static = true; }) - xxHash - ]; - shellHook = '' - export NIX_SHELL="camu-mingw32" - unset SOURCE_DATE_EPOCH - exec ${pkgs.zsh}/bin/zsh -l - ''; - }; + mingw64 = with pkgs; let + gcc = pkgsCross.ucrt64.buildPackages.wrapCC + (pkgsCross.ucrt64.buildPackages.gcc-unwrapped.override ({ + threadsCross = { model = "win32"; package = null; }; + })); + gccWin32Stdenv = overrideCC pkgsCross.ucrt64.stdenv gcc; + in mkShell.override { stdenv = gccWin32Stdenv; } { + NIX_HARDENING_ENABLE = ""; + nativeBuildInputs = [ + git + buildPackages.gcc + nasm + pkg-config + autoconf + automake + autogen + ninja + meson + cmake + wineWowPackages.staging + python3 + ]; + buildInputs = with pkgsCross.ucrt64; [ + (zlib.override { shared = false; static = true; }) + xxHash + ]; + shellHook = '' + export NIX_SHELL="camu-mingw64" + unset SOURCE_DATE_EPOCH + exec ${pkgs.zsh}/bin/zsh -l + ''; + }; - devShells.android = let - cmakeVersion = "3.22.1"; - androidComposition = androidenv.composeAndroidPackages { - cmdLineToolsVersion = "13.0"; - toolsVersion = "26.1.1"; - platformToolsVersion = "34.0.5"; - buildToolsVersions = [ "34.0.0" ]; - includeEmulator = false; - emulatorVersion = "35.2.5"; - platformVersions = [ "34" ]; - includeSources = false; - includeSystemImages = false; - systemImageTypes = [ "google_apis_playstore" ]; - abiVersions = [ "armeabi-v7a" "arm64-v8a" ]; - cmakeVersions = [ cmakeVersion ]; - includeNDK = true; - ndkVersions = ["23.2.8568313"]; - useGoogleAPIs = false; - useGoogleTVAddOns = false; - includeExtras = [ "extras;google;gcm" ]; - }; - in pkgs.mkShell rec { - ANDROID_HOME = "${androidComposition.androidsdk}/libexec/android-sdk"; - ANDROID_NDK_ROOT = "${ANDROID_HOME}/ndk-bundle"; - nativeBuildInputs = [ - ninja - meson - androidComposition.androidsdk - ]; - shellHook = '' - export NIX_SHELL="camu-android" - export PATH="$(echo "$ANDROID_HOME/cmake/${cmakeVersion}"*/bin):$PATH" - export PATH="$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH" - exec ${pkgs.zsh}/bin/zsh -l - ''; - }; - } - ); + mingw32 = with pkgs; let + gcc = pkgsCross.mingw32.buildPackages.wrapCC + (pkgsCross.mingw32.buildPackages.gcc-unwrapped.override ({ + threadsCross = { model = "win32"; package = null; }; + })); + gccWin32Stdenv = overrideCC pkgsCross.mingw32.stdenv gcc; + in mkShell.override { stdenv = gccWin32Stdenv; } { + NIX_HARDENING_ENABLE = ""; + nativeBuildInputs = mingw64.nativeBuildInputs; + buildInputs = with pkgsCross.mingw32; [ + (zlib.override { shared = false; static = true; }) + xxHash + ]; + shellHook = '' + export NIX_SHELL="camu-mingw32" + unset SOURCE_DATE_EPOCH + exec ${pkgs.zsh}/bin/zsh -l + ''; + }; + + android = with pkgs; let + cmakeVersion = "3.22.1"; + androidComposition = androidenv.composeAndroidPackages { + cmdLineToolsVersion = "13.0"; + toolsVersion = "26.1.1"; + platformToolsVersion = "34.0.5"; + buildToolsVersions = [ "34.0.0" ]; + includeEmulator = false; + emulatorVersion = "35.2.5"; + platformVersions = [ "34" ]; + includeSources = false; + includeSystemImages = false; + systemImageTypes = [ "google_apis_playstore" ]; + abiVersions = [ "armeabi-v7a" "arm64-v8a" ]; + cmakeVersions = [ cmakeVersion ]; + includeNDK = true; + ndkVersions = ["23.2.8568313"]; + useGoogleAPIs = false; + useGoogleTVAddOns = false; + includeExtras = [ "extras;google;gcm" ]; + }; + in pkgs.mkShell rec { + ANDROID_HOME = "${androidComposition.androidsdk}/libexec/android-sdk"; + ANDROID_NDK_ROOT = "${ANDROID_HOME}/ndk-bundle"; + nativeBuildInputs = [ + ninja + meson + androidComposition.androidsdk + ]; + shellHook = '' + export NIX_SHELL="camu-android" + export PATH="$(echo "$ANDROID_HOME/cmake/${cmakeVersion}"*/bin):$PATH" + export PATH="$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH" + exec ${pkgs.zsh}/bin/zsh -l + ''; + }; + }); + + # Raspberry Pi 3 Model B V1.2 + JustBoom Digi HAT + nixosConfigurations.cmsb-001 = let + system = "aarch64-linux"; + source-pkgs = nixpkgs.legacyPackages.${system}; + nixpkgs-patched = source-pkgs.applyPatches { + name = "nixpkgs-patched"; + src = nixpkgs; + patches = [ ]; + }; + nixosSystem = import (nixpkgs-patched + "/nixos/lib/eval-config.nix"); + in nixosSystem { + system = "aarch64-linux"; + modules = [ + ({ pkgs, ... }: { nixpkgs.overlays = [ ]; }) + nixos-hardware.nixosModules.raspberry-pi-3 + ./hardware/cmsb-001/configuration.nix + ]; + }; + }; } diff --git a/hardware/cmsb-001/cma-overlay.dts b/hardware/cmsb-001/cma-overlay.dts new file mode 100644 index 0000000..b473793 --- /dev/null +++ b/hardware/cmsb-001/cma-overlay.dts @@ -0,0 +1,36 @@ +/* + * cma.dts + */ + +/dts-v1/; +/plugin/; + +/ { + compatible = "brcm,bcm2837"; + + fragment@0 { + target = <&cma>; + frag0: __overlay__ { + /* + * The default size when using this overlay is 256 MB + * and should be kept as is for backwards + * compatibility. + */ + size = <0x10000000>; + }; + }; + + __overrides__ { + cma-512 = <&frag0>,"size:0=",<0x20000000>; + cma-448 = <&frag0>,"size:0=",<0x1c000000>; + cma-384 = <&frag0>,"size:0=",<0x18000000>; + cma-320 = <&frag0>,"size:0=",<0x14000000>; + cma-256 = <&frag0>,"size:0=",<0x10000000>; + cma-192 = <&frag0>,"size:0=",<0xC000000>; + cma-128 = <&frag0>,"size:0=",<0x8000000>; + cma-96 = <&frag0>,"size:0=",<0x6000000>; + cma-64 = <&frag0>,"size:0=",<0x4000000>; + cma-size = <&frag0>,"size:0"; /* in bytes, 4MB aligned */ + cma-default = <0>,"-0"; + }; +}; diff --git a/hardware/cmsb-001/configuration.nix b/hardware/cmsb-001/configuration.nix new file mode 100644 index 0000000..d3525f7 --- /dev/null +++ b/hardware/cmsb-001/configuration.nix @@ -0,0 +1,168 @@ +# https://citizen428.net/blog/installing-nixos-raspberry-pi-3/ +{ config, lib, pkgs, modulesPath, ... }: { + imports = [ + #"${modulesPath}/installer/sd-card/sd-image.nix" + ]; + + users.users.akiyo = { + isNormalUser = true; + uid = 1000; + extraGroups = [ "wheel" "input" "audio" "video" "render" "disk" "cdrom" ]; + }; + + security.sudo.extraRules = [ + { users = [ "akiyo" ]; commands = [ { command = "ALL"; options = [ "NOPASSWD" ]; } ]; } + ]; + + nix = { + settings = { + experimental-features = [ "nix-command" "flakes" ]; + system-features = [ "big-parallel" ]; + auto-optimise-store = true; + download-buffer-size = 134217728; + trusted-users = [ "akiyo" ]; + }; + gc.automatic = false; + optimise.automatic = true; + }; + + fileSystems."/" = + { device = "/dev/disk/by-label/NIXOS_SD"; + fsType = "ext4"; + options = [ "noatime" ]; + }; + + # https://forums.gentoo.org/viewtopic-t-1101170-start-0.html + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; + boot.initrd.availableKernelModules = [ + "usbhid" + "usb_storage" + "vc4" + "reset-raspberrypi" + "bcm2835_dma" + "i2c_bcm2835" + ]; + boot.kernelModules = [ ]; + boot.kernelParams = [ "mitigations=off" "file_caps=1" ]; + boot.supportedFilesystems = [ ]; + boot.extraModulePackages = [ ]; + boot.initrd.kernelModules = [ ]; + + hardware.enableRedistributableFirmware = true; + hardware.graphics.enable = true; + + console = { + font = "Lat2-Terminus16"; + keyMap = "us"; + useXkbConfig = false; + }; + + time.timeZone = "America/New_York"; + i18n.defaultLocale = "en_US.UTF-8"; + i18n.supportedLocales = [ + "C.UTF-8/UTF-8" + "${config.i18n.defaultLocale}/UTF-8" + ]; + i18n.glibcLocales = pkgs.glibcLocales.override { + allLocales = false; + locales = [ + "C.UTF-8/UTF-8" + "${config.i18n.defaultLocale}/UTF-8" + ]; + }; + + networking = { + hostName = "cmsb-001"; + wireless = { + enable = true; + fallbackToWPA2 = false; + networks."Verizon_TMKS9N" = { + pskRaw = "794b2c76b39a7f83d08e028e20fb980cef890424ae0b69acdf2e37c590a9fb6a"; + authProtocols = [ "WPA-PSK" "WPA-EAP" "FT-PSK" "FT-EAP" ]; + }; + userControlled.enable = true; + }; + firewall = { + enable = true; + allowedTCPPorts = []; + }; + }; + + services.openssh.enable = true; + + programs.zsh.enable = true; + environment.shells = [ pkgs.zsh ]; + environment.pathsToLink = [ "/share/zsh" ]; + users.defaultUserShell = pkgs.zsh; + + environment.systemPackages = with pkgs; [ + libraspberrypi + dtc + alsa-utils + kitty.terminfo + htop + # https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/full.nix#L12 + ((vim-full.override { + features = "small"; + guiSupport = "off"; + luaSupport = false; + pythonSupport = false; + rubySupport = false; + cscopeSupport = false; + netbeansSupport = false; + ximSupport = false; + ftNixSupport = false; + sodiumSupport = false; + }).customize { + name = "vi"; + vimrcConfig = { customRC = ""; }; + }) + mesa-demos + vulkan-tools + mpv + ]; + + # https://pablo.tools/blog/computers/nixos-generate-raspberry-images/ + #sdImage = { + # populateFirmwareCommands = let + # configTxt = pkgs.writeText "config.txt" '' + # ''; + # in '' + # (cd ${pkgs.raspberrypifw}/share/raspberrypi/boot && cp bootcode.bin fixup*.dat start*.elf $NIX_BUILD_TOP/firmware/) + # cp ${configTxt} firmware/config.txt + # cp ${pkgs.ubootRaspberryPi3_64bit}/u-boot.bin firmware/u-boot-rpi3.bin + # ''; + # populateRootCommands = '' + # mkdir -p ./files/boot + # ${config.boot.loader.generic-extlinux-compatible.populateCmd} -c ${config.system.build.toplevel} -d ./files/boot + # ''; + #}; + + # https://github.com/NixOS/nixos-hardware/issues/631 + hardware.deviceTree = { + enable = true; + filter = "bcm2837-rpi-3-b*.dtb"; + overlays = [ + # brcm,bcm2835 -> brcm,bcm2837 + { # https://raw.githubusercontent.com/raspberrypi/linux/refs/heads/rpi-6.6.y/arch/arm/boot/dts/overlays/justboom-digi-overlay.dts + name = "justboom-digi"; + dtsFile = ./justboom-digi-overlay.dts; + } + { # https://raw.githubusercontent.com/raspberrypi/linux/refs/heads/rpi-6.6.y/arch/arm/boot/dts/overlays/cma-overlay.dts + name = "cma-overlay"; + dtsFile = ./cma-overlay.dts; + } + { # https://raw.githubusercontent.com/raspberrypi/linux/refs/heads/rpi-6.6.y/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts + name = "vc4-fkms-v3d"; + # remove '#include "cma-overlay.dts"' + dtsFile = ./vc4-fkms-v3d-overlay.dts; + } + { # https://raw.githubusercontent.com/raspberrypi/linux/refs/heads/rpi-6.6.y/arch/arm/boot/dts/overlays/disable-bt-overlay.dts + name = "disable-bt"; + dtsFile = ./disable-bt-overlay.dts; + } + ]; + }; + + system.stateVersion = "25.05"; +} diff --git a/hardware/cmsb-001/disable-bt-overlay.dts b/hardware/cmsb-001/disable-bt-overlay.dts new file mode 100644 index 0000000..48e06a6 --- /dev/null +++ b/hardware/cmsb-001/disable-bt-overlay.dts @@ -0,0 +1,59 @@ +/dts-v1/; +/plugin/; + +/* Disable Bluetooth and restore UART0/ttyAMA0 over GPIOs 14 & 15. */ + +#include + +/{ + compatible = "brcm,bcm2837"; + + fragment@0 { + target = <&uart1>; + __overlay__ { + status = "disabled"; + }; + }; + + fragment@1 { + target = <&uart0>; + __overlay__ { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; + status = "okay"; + }; + }; + + fragment@2 { + target = <&bt>; + __overlay__ { + status = "disabled"; + }; + }; + + fragment@3 { + target = <&uart0_pins>; + __overlay__ { + brcm,pins; + brcm,function; + brcm,pull; + }; + }; + + fragment@4 { + target = <&bt_pins>; + __overlay__ { + brcm,pins; + brcm,function; + brcm,pull; + }; + }; + + fragment@5 { + target-path = "/aliases"; + __overlay__ { + serial0 = "/soc/serial@7e201000"; + serial1 = "/soc/serial@7e215040"; + }; + }; +}; diff --git a/hardware/cmsb-001/justboom-digi-overlay.dts b/hardware/cmsb-001/justboom-digi-overlay.dts new file mode 100644 index 0000000..7fa757f --- /dev/null +++ b/hardware/cmsb-001/justboom-digi-overlay.dts @@ -0,0 +1,41 @@ +// Definitions for JustBoom Digi +/dts-v1/; +/plugin/; + +/ { + compatible = "brcm,bcm2837"; + + fragment@0 { + target = <&i2s_clk_consumer>; + __overlay__ { + status = "okay"; + }; + }; + + fragment@1 { + target = <&i2c1>; + __overlay__ { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + wm8804@3b { + #sound-dai-cells = <0>; + compatible = "wlf,wm8804"; + reg = <0x3b>; + PVDD-supply = <&vdd_3v3_reg>; + DVDD-supply = <&vdd_3v3_reg>; + status = "okay"; + }; + }; + }; + + fragment@2 { + target = <&sound>; + __overlay__ { + compatible = "justboom,justboom-digi"; + i2s-controller = <&i2s_clk_consumer>; + status = "okay"; + }; + }; +}; diff --git a/hardware/cmsb-001/vc4-fkms-v3d-overlay.dts b/hardware/cmsb-001/vc4-fkms-v3d-overlay.dts new file mode 100644 index 0000000..4c836fb --- /dev/null +++ b/hardware/cmsb-001/vc4-fkms-v3d-overlay.dts @@ -0,0 +1,44 @@ +/* + * vc4-fkms-v3d-overlay.dts + */ + +/dts-v1/; +/plugin/; + +/ { + compatible = "brcm,bcm2837"; + + fragment@1 { + target = <&fb>; + __overlay__ { + status = "disabled"; + }; + }; + + fragment@2 { + target = <&firmwarekms>; + __overlay__ { + status = "okay"; + }; + }; + + fragment@3 { + target = <&v3d>; + __overlay__ { + status = "okay"; + }; + }; + + fragment@4 { + target = <&vc4>; + __overlay__ { + status = "okay"; + }; + }; + fragment@5 { + target-path = "/chosen"; + __overlay__ { + bootargs = "clk_ignore_unused"; + }; + }; +}; diff --git a/scripts/screenrc b/scripts/screenrc index 9c84722..925703d 100644 --- a/scripts/screenrc +++ b/scripts/screenrc @@ -6,4 +6,4 @@ screen -t 'cmsrv' ./src/fruits/cmsrv/cmsrv split focus screen -t 'cmsrv_debug' -stuff 'gdb -p $(pgrep cmsrv) -ex cont ' +stuff 'sleep 1 && gdb -p $(pgrep cmsrv) -ex cont ' -- cgit v1.2.3-101-g0448