Skip to content

Commit e0fafff

Browse files
Johannes Lohbihlernevvkid
authored andcommitted
fix: remaining tbdsamples / dbup / data references missed in two prior path commits
After the user-asked thorough audit, six more user-visible stale refs: User-facing docs: - docs/get_started/20_storage.rst — substantial rewrite: the whole page was documenting the OLD pre-overlay SD card layout (/data/, /dbup/, /tbdsamples/). Rewritten to describe the current /factory/ + /user/ + /system/ overlay model, the /samples/factory/ + /samples/user/ split, and the recommended 'user-overlay-first' editing pattern. - docs/plugins/step-by-step.rst:219 — '/sdcard/tbdsamples/' → '/sdcard/samples/' with note about factory/user overlay. Active runtime code: - components/drivers/fs.cpp — removed two ESP_LOGI lines that lied about a '/dbup' backup being part of the SD card content archive. The current zip-archive build pipeline doesn't create /dbup at all; the messages surfaced in firmware logs as misleading noise. (The 'delete_dir_recursive /data' line earlier in the function is kept — that's legitimate cleanup of cruft from pre-restructure SD cards.) - sdcard_image/www/tools/dev-server.js:55 — SAMPLE_ROOT pointed at non-existent 'sample_rom/tbdsamples/'. Updated to the actual path 'sdcard_image/samples/factory/'. Used at lines 610 and 1023 to serve WAV previews and log the directory location — so this was a real broken feature, not just a comment. Developer tool labels: - tools/sample-tools/sample_bank_manager.html — three button/error-message labels said 'tbdsamples folder'. Renamed to 'samples folder' for consistency. (The tool itself still has a broken dependency on wav_info_short.json which doesn't exist anywhere in the repo — separate follow-up.) After this commit, 'git grep' for any of {sdcard_image/data, /data/sp/, tbdsamples, /dbup, /data/synthdef, /data/macro} returns zero hits across the whole tree. Pushed as a forward commit — no force-push, no re-squash.
1 parent 082c253 commit e0fafff

5 files changed

Lines changed: 43 additions & 30 deletions

File tree

components/drivers/fs.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,6 @@ static void check_and_update_sd_content(const std::string& base_path) {
523523

524524
ESP_LOGI("FS", "Content updated successfully");
525525

526-
// Backup is pre-created in the zip archive at /dbup
527-
ESP_LOGI("FS", "Note: Backup of /data is included in archive as /dbup");
528-
529526
// Create .version file to mark successful extraction
530527
std::ofstream version_out(version_file);
531528
if (version_out) {

docs/get_started/20_storage.rst

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ The TBD-16 has two micro-SD card slots, one for each processor:
2121
- Contents
2222
* - Middle slot
2323
- ESP32-P4
24-
- System config, web interface, audio samples (``/tbdsamples/``),
25-
backup (``/dbup/``), version file
24+
- Factory + user overlay (``/factory/``, ``/user/``), audio samples
25+
(``/samples/``), runtime caches (``/system/``), web interface
26+
(``/www/``)
2627
* - Edge slot
2728
- RP2350
2829
- Frontend firmware (``.uf2`` apps), RP2350 config
@@ -31,10 +32,11 @@ The TBD-16 has two micro-SD card slots, one for each processor:
3132
Factory Samples
3233
===============
3334

34-
The P4 SD card ships with a ``/tbdsamples/`` folder organized by category:
35+
The P4 SD card ships with a ``/samples/factory/`` folder organized by category:
3536

36-
- **drums/** --- Kicks, snares, hi-hats, claps, percussion, loops
37+
- **drums/** --- Kicks, snares, hi-hats, claps, percussion
3738
- **wavetables/** --- Wavetable banks for the wavetable oscillator plugins
39+
- **loops/** --- Long sample loops and beat material
3840
- **other/** --- Miscellaneous samples and textures
3941

4042
Samples are stored as **44.1 kHz, 16-bit mono WAV** files. At boot, the
@@ -49,7 +51,8 @@ Samples are organized into **banks** --- named collections of WAV files.
4951
The TBD-16 ships with a default sample bank (factory drums) and a default
5052
wavetable bank.
5153

52-
Banks are defined by JSON files inside ``/tbdsamples/``:
54+
Banks are defined by JSON files inside ``/samples/`` (factory and user
55+
overlays):
5356

5457
- ``sample_rom.json`` --- Master index listing all available banks and the
5558
currently active bank
@@ -72,18 +75,22 @@ Here's how to get your own samples onto the TBD-16:
7275
2. **Access the SD card** --- Either remove the P4 SD card and insert it in your
7376
computer, or boot into USB-MSC mode to access it over USB.
7477

75-
3. **Copy files** --- Place your ``.wav`` files into a subfolder of ``/tbdsamples/``
76-
(e.g. ``/tbdsamples/my_samples/``).
78+
3. **Copy files** --- Place your ``.wav`` files into a subfolder of
79+
``/samples/user/`` (e.g. ``/samples/user/my_samples/``). User-side
80+
files override the factory defaults of the same name; factory files
81+
stay read-only.
7782

78-
4. **Create a bank file** --- Create a ``.json`` file in ``/tbdsamples/`` listing
79-
your samples (see the existing ``def_smp.json`` as a template). Each entry needs:
83+
4. **Create a bank file** --- Create a ``.json`` file in ``/samples/user/``
84+
listing your samples (see the existing ``def_smp.json`` in
85+
``/samples/factory/`` as a template). Each entry needs:
8086

8187
- ``filename`` --- Stem name without extension (max 32 chars)
82-
- ``path`` --- Subfolder path relative to ``/tbdsamples/``
88+
- ``path`` --- Subfolder path relative to ``/samples/``
8389
- ``nsamples`` --- Number of sample frames in the file
8490

8591
5. **Register the bank** --- Add your bank file to the ``smp_banks`` array in
86-
``sample_rom.json``.
92+
``sample_rom.json`` (the user copy under ``/samples/user/sample_rom.json``
93+
if you want it overlayed on top of the factory list).
8794

8895
6. **Reboot** --- The TBD-16 will load the new bank data on the next start.
8996

@@ -92,20 +99,27 @@ data is loaded into PSRAM at boot, so total bank size is limited by available
9299
memory.
93100

94101

95-
System Configuration
96-
====================
102+
System Configuration & Overlay
103+
==============================
97104

98-
The P4 SD card also contains a ``/data/`` folder with system configuration
99-
files. These are managed automatically by the firmware:
105+
The P4 SD card uses an **overlay model** that separates immutable factory
106+
defaults from user-side overrides:
100107

101-
- ``spm-config.json`` --- Sound Processor Manager state (loaded plugins, patches)
102-
- ``/data/sp/`` --- Plugin parameter presets and UI definitions
108+
- ``/factory/`` --- read-only factory defaults written from the SD card
109+
image: ``synthdefinitions.json``, ``plugins/`` (the ``mui-*.json`` /
110+
``mp-*.json`` parameter and preset files for every sound processor),
111+
``presets/``, ``macros/``, ``kits/``, ``trackdefaults/``, ``config/``.
112+
- ``/user/`` --- user-side overrides created at runtime. Same subdirectory
113+
layout as ``/factory/``; the firmware reads ``/user/<path>`` first and
114+
falls back to ``/factory/<path>``. Writes always go to ``/user/``, so the
115+
factory tree stays clean and is the recovery baseline.
116+
- ``/system/`` --- runtime caches (firmware version, WebUI version, cached
117+
state). Rebuilt at boot when missing.
103118

104-
A backup of the ``/data/`` folder is stored in ``/dbup/`` and can be used
105-
for recovery.
106-
107-
Editing configuration files manually is not recommended unless you know what
108-
you're doing --- for normal use, the system manages these automatically.
119+
Editing configuration files manually is not recommended unless you know
120+
what you're doing --- for normal use the WebUI and the hardware UI manage
121+
these automatically. If you do hand-edit, prefer the ``/user/`` overlay so
122+
that wiping ``/user/`` always restores you to a known-good factory state.
109123

110124

111125
Recovery

docs/plugins/step-by-step.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,9 @@ real-world usage examples.
216216
SD Card Sample Layout
217217
~~~~~~~~~~~~~~~~~~~~~
218218

219-
Samples live in ``/sdcard/tbdsamples/`` on the P4 SD card. The structure is
219+
Samples live in ``/sdcard/samples/`` on the P4 SD card --- ``factory/``
220+
for the read-only factory content and ``user/`` for user-added banks
221+
(overlay model: ``user/`` overrides ``factory/``). The structure is
220222
defined by JSON descriptor files:
221223

222224
- ``sample_rom.json`` --- Master index with bank lists and active bank indices

sdcard_image/www/tools/dev-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const PORT = parseInt(process.argv[2], 10) || 3001;
5252
const REPO_ROOT = path.resolve(__dirname, '..', '..', '..');
5353
const WEBROOT = path.resolve(__dirname, '..');
5454
const FACTORY_DIR = path.resolve(REPO_ROOT, 'sdcard_image', 'factory');
55-
const SAMPLE_ROOT = path.resolve(REPO_ROOT, 'sample_rom', 'tbdsamples');
55+
const SAMPLE_ROOT = path.resolve(REPO_ROOT, 'sdcard_image', 'samples', 'factory');
5656
const SDCARD_ROOT = path.resolve(REPO_ROOT, 'sdcard_image');
5757
const DATA_DIR = SDCARD_ROOT; // Resolves to the sdcard_image/ root (factory/ + user/ overlays)
5858

tools/sample-tools/sample_bank_manager.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<h1>Sample Bank Builder (128)</h1>
5050
<div class="row">
5151
<input id="dirInput" type="file" webkitdirectory multiple hidden />
52-
<button id="pickBtn">Pick tbdsamples folder…</button>
52+
<button id="pickBtn">Pick samples folder…</button>
5353
<span id="summary" class="muted">No folder loaded</span>
5454
<span id="counter" class="pill">0/128 selected</span>
5555
<button id="enableAudioBtn" title="Click once if your browser blocks autoplay">Enable audio</button>
@@ -198,7 +198,7 @@ <h1>Sample Bank Builder (128)</h1>
198198
}
199199
if (!shortJsonFile) {
200200
summary.textContent = 'Could not find wav_info_short.json';
201-
showWarning('Select the tbdsamples folder that contains wav_info_short.json.');
201+
showWarning('Select the samples folder that contains wav_info_short.json.');
202202
return;
203203
}
204204
try {
@@ -588,7 +588,7 @@ <h1>Sample Bank Builder (128)</h1>
588588

589589
async function loadBankFromJson(arr) {
590590
if (!Array.isArray(arr)) throw new Error('Bank JSON must be an array');
591-
if (!entries.length) throw new Error('Load a tbdsamples folder first');
591+
if (!entries.length) throw new Error('Load a samples folder first');
592592
// Replace current bank
593593
selection = [];
594594
const usedIdx = new Set();

0 commit comments

Comments
 (0)