fix(ncm §30): 真机四连症状——JSON unescape + 封面流式 + 歌单豆腐/分隔符 tofu + 首屏诊断日志

症状/根因/修法(0 真实 NCM 业务请求;宿主+qemu 全绿):
- ③ LRC 挤一行/时间戳未解析:ncm_json_get_str_at 不做 JSON 转义还原,
  lrc.lyric 的 \n 转义原样进串 → lrc_parse 无真实换行整段一行。修:ncm_json.c 加
  json_unescape(RFC8259 全转义 + \uXXXX/代理对),get_str_at 返回前还原。
- ⑤ 封面全 failed→give up:cover.c 静态 g_buf 288KB < 封面 1.34MB → NCM_ERR_FULL。
  设备 RAM 仅 56MB。修:cover.c 改流式写文件(ncm_http_download cb→ncm_cache_write +
  meow_img_load_file 临时文件),NCM_COVER_MAX 8MB 改下载上限(非缓冲,bss 未涨)。
- ① 162 首歌单所有条目「三个豆腐」+「加载中」:占位符 ···(U+00B7)在 default 字体缺
  该字形 → 3 豆腐(font.idx glyph 扫实证 U+00B7 MISSING)。修:占位 ···→...、全 App
  · 分隔符→/;playlist_worker 首屏打 first-screen 诊断日志。
- ② 返回首页歌单列表 1 秒方框:字体缺 U+00B7/特殊字形(◢◤/Kannada)tofu;瞬态疑 glyph
  atlas 冷缓存(SDK 内部未深挖)。修:·→/。
验证:test_ncm_core(+test_json_unescape, host+qemu) / listvirt44 / dispatch / box42 /
scroll17 / anim32 / widgets / overlay_suppress / sdk_input_keys / theme / vol / ime_fix /
pinyin / notif_gesture / notif_open / sdk_fixes / sb_collapse / ui_audio_host / notify_ipc /
notify_integration + playlist_race_sim / window_sim / search_sim / cache_evict_sim(1-9) /
player_flow_sim(P1-12) / stream_sim(16+2resume) 全 PASS;mipsel -Wall -Wextra 0 warning。
新 md5:ncm d91cd906、ncm_host b731654a、test_ncm_core_host 7a38194c。

(症状④ VOL_DOWN×3 杀 App 的 launcher 源修复 app_launcher.c 门控 !a->framework 已随
 并发 commit 54a6e82 存入 HEAD;launcher 二进制 03dfcf76 留主会话/固件打包。)
注:build_ncm_host.sh 补 SDK 292/295 的 anim/box/scroll 源(宿主链接)。
This commit is contained in:
AskaEth committed 2026-09-02 02:25:37 +08:00
1 parent 54a6e828b7
commit 3397a702aa
15 files changed
+384 -88

No files matched your search

+1 -1
View File
@@ -134,7 +134,7 @@ static void home_draw(void *ctx)
ncm_fill_round(r_group.x, r_group.y, r_group.w, r_group.h, 8, pa->red_ctr);
meow_ui_fill_rect(r_group.x, r_group.y + 4, 4, r_group.h - 8, pa->red);
char ght[64];
snprintf(ght, sizeof ght, "%s · %d 个", tab_label(g_tab), tab_count(g_tab));
snprintf(ght, sizeof ght, "%s / %d 个", tab_label(g_tab), tab_count(g_tab));
meow_ui_text(r_group.x + 16, r_group.y + (r_group.h - th->font_body) / 2,
ght, th->font_body, pa->red);
meow_ui_text_right(r_group.x + r_group.w - 16, r_group.y + (r_group.h - th->font_body) / 2,
+2 -2
View File
@@ -39,7 +39,7 @@ static void login_draw(void *ctx)
/* 24px 红点 logo(标题左前) */
ncm_fill_round(W/2 - tw/2 - 36, 112 + 4, 24, 24, 12, pa->red_lit);
meow_ui_text_center(W/2, 160, "扫码登录 · 音樂的力量", 22, pa->on_red_dim);
meow_ui_text_center(W/2, 160, "扫码登录 / 音樂的力量", 22, pa->on_red_dim);
/* 弱分隔(hero 与内容衔接) */
meow_ui_fill_rect(0, 264, W, 1, th->outline);
@@ -76,7 +76,7 @@ static void login_draw(void *ctx)
meow_ui_text_center(W/2, 476, st, 20, scol);
/* 底部提示 */
meow_ui_text_center(W/2, H - 56, "由 MeowOS 驱动 · 仅本地解码", 18, th->dim);
meow_ui_text_center(W/2, H - 56, "由 MeowOS 驱动 / 仅本地解码", 18, th->dim);
}
/* 重绘 login 内容(QR+状态变化时)。 */
+1 -1
View File
@@ -323,7 +323,7 @@ static void plr_draw_lyrics(void *ctx)
ncm_song_t sm;
if (cur_song_meta(&sm) == 0) {
char mb[300];
snprintf(mb, sizeof mb, "%s · %s", sm.name, sm.art_name);
snprintf(mb, sizeof mb, "%s / %s", sm.name, sm.art_name);
meow_ui_text_center(W / 2, g_lyr_meta_y, ncm_text_fit(mb, W - 48, 18), 18, PLR_TEXT);
}
+12 -4
View File
@@ -72,16 +72,18 @@ static int pl_src2(int idx, meow_list_item *out, void *ctx)
if (idx < 0 || idx >= g_st.track_ids_count) return 0;
static ncm_song_t s_s; /* 锁内拷贝驻留缓冲(src2 由 UI 线程串行调用,title 指针对当次绘制有效) */
if (appstate_song_copy(idx, &s_s) != 0) {
/* 占位行:滑窗未覆盖/未物化(后台 ensure 完成后自愈)。 */
/* 占位行:滑窗未覆盖/未物化(后台 ensure 完成后自愈)。
* REPORT §30:旧 title="···"(U+00B7 中点)在 App 字体缺该字形时渲染成三个
* 豆腐块(真机「162 首歌单所有条目歌名显示三个豆腐和加载中」)——改 ASCII "..."。 */
out->icon_kind = MEOW_LIST_ICON_NONE;
out->title = "···";
out->title = "...";
out->subtitle = "加载中";
out->right = MEOW_LIST_RIGHT_ARROW;
out->on = 0; out->enabled = 1;
return 1;
}
static char sub[256];
if (s_s.art_name[0] && s_s.album_name[0]) snprintf(sub, sizeof sub, "%s · %s", s_s.art_name, s_s.album_name);
if (s_s.art_name[0] && s_s.album_name[0]) snprintf(sub, sizeof sub, "%s / %s", s_s.art_name, s_s.album_name);
else if (s_s.art_name[0]) snprintf(sub, sizeof sub, "%s", s_s.art_name);
else if (s_s.album_name[0]) snprintf(sub, sizeof sub, "%s", s_s.album_name);
else snprintf(sub, sizeof sub, "-");
@@ -133,7 +135,7 @@ static void pl_draw(void *ctx)
const char *nm = pl ? pl->name : "歌单名";
int nmx = r_cov.x + r_cov.w + 12;
char meta[256];
if (pl) snprintf(meta, sizeof meta, "创建者 · %d 首", pl->track_count);
if (pl) snprintf(meta, sizeof meta, "创建者 / %d 首", pl->track_count);
else snprintf(meta, sizeof meta, "曲目 %d 首", g_st.track_ids_count);
/* 歌单名(截断到卡片右缘:按 UTF-8 字符合法边界逐字累加测宽)。 */
{
@@ -246,6 +248,12 @@ static void *playlist_worker(void *arg)
/* 首屏:快照式加载(detail 全量 trackIds + 物化首段)。ctx 校验代次/目标,过期自动丢弃。 */
if (tidx < 0) rc = NCM_ERR_ARG;
else rc = appstate_load_playlist_songs_ctx(&tpl, tsearch, tgen, tidx, 0, NCM_SONG_BATCH);
/* REPORT §30(真机四连症状①):首屏结果打日志——tidx/track_ids_count/物化数/rc,
* 供「162 首歌单所有条目占位 加载中」定位(首屏 song_detail 失败/部分失败=非致命
* g_ens_err=rc,窗口空 → 行占位;g_st.song_count 为诊断竞态读,仅日志用途)。 */
meow_log(MEOW_LOG_INFO,
"playlist: first-screen idx=%d plid=%s trackIds=%d materialized=%d rc=%d",
tidx, tpl.id, g_st.track_ids_count, g_st.song_count, rc);
} else {
/* 滑窗补载:物化视口区间(盘缓存优先,批网格补载)。 */
rc = (lo < hi) ? appstate_song_ensure_range(lo, hi) : NCM_OK;
+2 -2
View File
@@ -100,7 +100,7 @@ static int sr_src2(int idx, meow_list_item *out, void *ctx)
static ncm_song_t s;
if (appstate_search_song(idx, &s) != 0) return 0;
static char sub[256];
if (s.art_name[0] && s.album_name[0]) snprintf(sub, sizeof sub, "%s · %s", s.art_name, s.album_name);
if (s.art_name[0] && s.album_name[0]) snprintf(sub, sizeof sub, "%s / %s", s.art_name, s.album_name);
else if (s.art_name[0]) snprintf(sub, sizeof sub, "%s", s.art_name);
else snprintf(sub, sizeof sub, "%s", s.album_name);
out->icon_kind = MEOW_LIST_ICON_NONE;
@@ -157,7 +157,7 @@ static void sr_draw_footer(void *ctx)
snprintf(foot, sizeof foot, "%s %d %s%s",
g_tab == 0 ? "单曲" : "歌单", n,
g_tab == 0 ? "个结果" : "个歌单",
appstate_search_has_more(g_tab) ? " · 加载更多" : "");
appstate_search_has_more(g_tab) ? " / 加载更多" : "");
ncm_draw_footer(r_cont, foot);
}
}
+7 -7
View File
@@ -85,7 +85,7 @@ static void settings_draw(void *ctx)
const char *gate_s = (gate == NCM_VIP_SVIP) ? "SVIP" : (gate == NCM_VIP_CVIP) ? "CVIP" : "";
int locked = (account_vip() < gate);
if (gate_s[0])
snprintf(rows[0].sub, sizeof rows[0].sub, "当前: %s (%s) · 需 %s%s",
snprintf(rows[0].sub, sizeof rows[0].sub, "当前: %s (%s) / 需 %s%s",
ncm_level_name(g_st.level), ncm_level_spec(g_st.level), gate_s,
locked ? ",将降级" : "");
else
@@ -95,10 +95,10 @@ static void settings_draw(void *ctx)
/* §22:歌词页背景模式(default=封面模糊置底 / power_save=封面+黑叠加层) */
snprintf(rows[1].sub, sizeof rows[1].sub, "当前: %s",
g_st.player_bg_mode == NCM_BG_POWER_SAVE ? "省电模式" : "默认(模糊置底)");
snprintf(rows[2].sub, sizeof rows[2].sub, "当前: %d GB · 上限 100", g_st.cache_limit_gb);
snprintf(rows[2].sub, sizeof rows[2].sub, "当前: %d GB / 上限 100", g_st.cache_limit_gb);
snprintf(rows[3].sub, sizeof rows[3].sub, "占用: %s", usetxt);
snprintf(rows[4].sub, sizeof rows[4].sub, "%s", g_st.nickname[0] ? g_st.nickname : "退出");
snprintf(rows[5].sub, sizeof rows[5].sub, "%s", "v0.1 · MeowOS");
snprintf(rows[5].sub, sizeof rows[5].sub, "%s", "v0.1 / MeowOS");
for (int i = 0; i < SETTINGS_ROWS; i++) {
int yy = y + i * (g_row_h + 8);
@@ -113,7 +113,7 @@ static void settings_draw(void *ctx)
/* 品牌红页脚小字。 */
int ny = y + SETTINGS_ROWS * (g_row_h + 8) + 4;
meow_ui_text(x, ny, "无损/Hi-Res 需 CVIP ・ 臻音/母带需 SVIP,不支持时自动降级", 20, th->onSurfaceVariant);
meow_ui_text(x, ny + 24, "网易云音乐 · MeowOS 移植版", 20, pa->red);
meow_ui_text(x, ny + 24, "网易云音乐 / MeowOS 移植版", 20, pa->red);
}
static int row_at(int x, int y)
@@ -174,8 +174,8 @@ int settings_on_tap(int x, int y)
* 以文字标注代替——允许选定,实际播放逐级降级到可用档) */
const char *gate_s = (gate == NCM_VIP_SVIP) ? "SVIP" : (gate == NCM_VIP_CVIP) ? "CVIP" : NULL;
if (gate_s)
snprintf(lbl, sizeof lbl, "%s (%s) · %s%s", ncm_level_name(lv),
ncm_level_spec(lv), gate_s, (vip < gate) ? "·未解锁" : "");
snprintf(lbl, sizeof lbl, "%s (%s) / %s%s", ncm_level_name(lv),
ncm_level_spec(lv), gate_s, (vip < gate) ? "/未解锁" : "");
else
snprintf(lbl, sizeof lbl, "%s (%s)", ncm_level_name(lv), ncm_level_spec(lv));
meow_sheet_add_item(s, lbl);
@@ -254,7 +254,7 @@ int settings_on_tap(int x, int y)
return 1;
}
if (row == 5) { /* 关于 */
ncm_snack("网易云音乐 v0.1 · MeowOS 移植版");
ncm_snack("网易云音乐 v0.1 / MeowOS 移植版");
return 1;
}
return 0;