Initial commit: soothe2 RE workspace + roadmap
- Инфраструктура: RTTI-дампы (rtti_dsp/full.json), декомпиляции DSP-классов (decomp_*.txt), Ghidra-скрипты (Dump*.java, ImportRtti*.java, Diag.java), depthcurve/curve_fits LUT. - Поведенческая модель sim_v5.py + sim.py (RMSE ~0.3dB), утилиты (measure, tt_sweep, patchparam, sweep, harness_*, verify_sim). - summary.md + roadmap.md (контракт из manual M1-M12, топология пайплайна из OCR, фазы A-C). - pipeline_ocr.txt: OCR диаграммы Appendix A (mid/side ручка, trim/mix/bypass порядок).
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env python3
|
||||
import subprocess, os, glob, sys, time
|
||||
|
||||
RPP = sys.argv[1] if len(sys.argv) > 1 else "/home/m/soothe-bt/render_rt.rpp"
|
||||
OUT = sys.argv[2] if len(sys.argv) > 2 else "/home/m/re-tools/rt.bin"
|
||||
|
||||
proc = subprocess.Popen(
|
||||
['reaper', '-nosplash', '-renderproject', RPP],
|
||||
stdout=open('/tmp/rtdump.log', 'w'), stderr=subprocess.STDOUT)
|
||||
print('reaper', proc.pid, flush=True)
|
||||
|
||||
base = 0x180000000
|
||||
extent = 0x7000000
|
||||
host = None
|
||||
deadline = time.time() + 90
|
||||
while time.time() < deadline and proc.poll() is None:
|
||||
for p in glob.glob('/proc/[0-9]*'):
|
||||
try:
|
||||
pid = int(os.path.basename(p))
|
||||
cmd = open(p + '/cmdline', 'rb').read().replace(b'\0', b' ').decode('utf8', 'replace')
|
||||
if 'yabridge-host' not in cmd:
|
||||
continue
|
||||
maps = open(f'/proc/{pid}/maps').read()
|
||||
if 'soothe2' in maps:
|
||||
host = pid
|
||||
break
|
||||
except Exception:
|
||||
pass
|
||||
if host:
|
||||
break
|
||||
time.sleep(0.2)
|
||||
print('host', host, flush=True)
|
||||
if not host:
|
||||
proc.kill()
|
||||
sys.exit('no host')
|
||||
|
||||
readable = []
|
||||
maps = open(f'/proc/{host}/maps').read()
|
||||
for line in maps.splitlines():
|
||||
parts = line.split()
|
||||
lo, hi = (int(x, 16) for x in parts[0].split('-'))
|
||||
if 'r' in parts[1] and base <= lo < base + extent:
|
||||
readable.append((lo, hi, parts[1]))
|
||||
print('regions:', len(readable), flush=True)
|
||||
|
||||
mem = os.open(f'/proc/{host}/mem', os.O_RDONLY)
|
||||
outdir = OUT + '.regions'
|
||||
os.makedirs(outdir, exist_ok=True)
|
||||
with open(OUT, 'wb') as out:
|
||||
total = 0
|
||||
for lo, hi, _ in readable:
|
||||
try:
|
||||
d = os.pread(mem, hi - lo, lo)
|
||||
out.write(d)
|
||||
total += len(d)
|
||||
with open(os.path.join(outdir, f'{lo:08x}_{hi:08x}.bin'), 'wb') as rf:
|
||||
rf.write(d)
|
||||
except Exception as e:
|
||||
print('fail', hex(lo), e, flush=True)
|
||||
os.close(mem)
|
||||
print('dumped', total, flush=True)
|
||||
proc.kill()
|
||||
Reference in New Issue
Block a user