feat(audiod): A3+DSD — ①24/32bit高清byte-exact(偏好S32) ②独立AUDIO_FMT_DOP DoP DSD透传+失败报错关流(拒BT) ③音量收编v2双组写PCM+DSD_VOLUME平方锥度audiod权威 ④/api/audio/monitor监控+前端音频页监控卡;宿主100/0,0warning;SDK meow_ui_audio ABI变大M6.34需重编meow_ui.a+重链四App
This commit is contained in:
1 parent
2dc4cad454
commit
effce6d0db
6 files changed
+533
-56
No files matched your search
@@ -139,7 +139,8 @@ static int fmt_bps(int fmt)
|
||||
case AUDIO_FMT_S16: return 2;
|
||||
case AUDIO_FMT_S24:
|
||||
case AUDIO_FMT_S32:
|
||||
case AUDIO_FMT_FLOAT: return 4;
|
||||
case AUDIO_FMT_FLOAT:
|
||||
case AUDIO_FMT_DOP: return 4;
|
||||
default: return 2;
|
||||
}
|
||||
}
|
||||
@@ -150,6 +151,7 @@ static const char *fmt_name(int fmt)
|
||||
case AUDIO_FMT_S24: return "S24";
|
||||
case AUDIO_FMT_S32: return "S32";
|
||||
case AUDIO_FMT_FLOAT: return "FLOAT";
|
||||
case AUDIO_FMT_DOP: return "DoP";
|
||||
default: return "?";
|
||||
}
|
||||
}
|
||||
@@ -318,14 +320,14 @@ static size_t gen_sine(uint8_t *buf, size_t bufcap, int grant_fmt, int grant_ch,
|
||||
return done;
|
||||
}
|
||||
|
||||
static int cmd_tone(int freq, int ms, int rate)
|
||||
static int cmd_tone(int freq, int ms, int rate, int fmt)
|
||||
{
|
||||
m_audio_open_t o;
|
||||
memset(&o, 0, sizeof o);
|
||||
snprintf(o.app_id, sizeof o.app_id, "audio-cli");
|
||||
o.rate = (uint32_t)rate;
|
||||
o.ch = 2;
|
||||
o.fmt = AUDIO_FMT_S16;
|
||||
o.fmt = (uint16_t)fmt;
|
||||
uint8_t rbuf[512]; uint16_t rt;
|
||||
int n = req_resp(MSG_AUDIO_OPEN, &o, sizeof o, &rt, rbuf, sizeof rbuf);
|
||||
if (n < 0) { fprintf(stderr, "meow_audio: no audiod (%s) — 音频服务不可用\n", g_sock); return 1; }
|
||||
@@ -386,7 +388,7 @@ static int cmd_tone(int freq, int ms, int rate)
|
||||
|
||||
static void usage(const char *argv0)
|
||||
{
|
||||
fprintf(stderr, "usage: %s status | tone [freq] [ms] [rate] | route <0|2|3> | vol [0-100] | output <dac|bt> | monitor [秒]\n"
|
||||
fprintf(stderr, "usage: %s status | tone [freq] [ms] [rate] [S16|S24|S32] | route <0|2|3> | vol [0-100] | output <dac|bt> | monitor [秒]\n"
|
||||
" output: 切换输出目标(dac=本地 hw:0,0 / bt=蓝牙 A2DP source;bt 时音量=AVRCP 侧控)\n"
|
||||
" monitor: 终端实时电平表(200ms 刷新+文本电平条;缺省 10s,0=持续到 Ctrl-C)\n"
|
||||
" env: MEOW_AUDIO_SOCK (socket 缺省 %s)\n", argv0, AUD_SOCK_DEFAULT);
|
||||
@@ -432,9 +434,16 @@ int main(int argc, char **argv)
|
||||
int freq = (argc >= 3) ? atoi(argv[2]) : 440;
|
||||
int ms = (argc >= 4) ? atoi(argv[3]) : 500;
|
||||
int rate = (argc >= 5) ? atoi(argv[4]) : 44100;
|
||||
int fmt = AUDIO_FMT_S16;
|
||||
if (argc >= 6) {
|
||||
if (!strcmp(argv[5], "S16")) fmt = AUDIO_FMT_S16;
|
||||
else if (!strcmp(argv[5], "S24")) fmt = AUDIO_FMT_S24;
|
||||
else if (!strcmp(argv[5], "S32")) fmt = AUDIO_FMT_S32;
|
||||
else { fprintf(stderr, "tone: fmt S16|S24|S32(DoP 由 App 侧生成,CLI 不产 DoP)\n"); return 2; }
|
||||
}
|
||||
if (freq <= 0 || ms <= 0 || rate <= 0) { fprintf(stderr, "tone: bad params\n"); return 2; }
|
||||
if (g_fd < 0) { fprintf(stderr, "meow_audio: no audiod (%s) — 音频服务不可用\n", g_sock); return 1; }
|
||||
return cmd_tone(freq, ms, rate);
|
||||
return cmd_tone(freq, ms, rate, fmt);
|
||||
} else if (!strcmp(cmd, "monitor")) {
|
||||
int secs = (argc >= 3) ? atoi(argv[2]) : 10;
|
||||
if (secs < 0) secs = 10;
|
||||
|
||||
Reference in new issue
Block a user