see CHANGELOG

This commit is contained in:
philippe44
2024-01-19 16:14:08 -08:00
parent ccc7b86369
commit 6b2eb1b3c0
3 changed files with 13 additions and 5 deletions

View File

@@ -1,8 +1,13 @@
2024-01-19
- fixed libflac with OggFlac
- AirPlay missed frame logging
2024-01-16 2024-01-16
- catch-up with cspot latest - catch-up with cspot latest
- refactor airplay flush/first packet - refactor airplay flush/first packet
- new libFLAC that supports multi-stream OggFlac - new libFLAC that supports multi-stream OggFlac
- fix output threshold - fix output threshold
- log missed frames
2024-01-10 2024-01-10
- add OggFlac to stream metadata - add OggFlac to stream metadata

Binary file not shown.

View File

@@ -96,6 +96,7 @@ typedef struct __attribute__((__packed__)) audio_buffer_entry { // decoded aud
u16_t len; u16_t len;
u8_t ready; u8_t ready;
u8_t allocated; u8_t allocated;
u8_t missed;
} abuf_t; } abuf_t;
typedef struct rtp_s { typedef struct rtp_s {
@@ -478,9 +479,10 @@ static void buffer_put_packet(rtp_t *ctx, seq_t seqno, unsigned rtptime, bool fi
ctx->cmd_cb(RAOP_PLAY, playtime); ctx->cmd_cb(RAOP_PLAY, playtime);
} }
abuf = ctx->audio_buffer + BUFIDX(seqno);
if (seqno == (u16_t) (ctx->ab_write+1)) { if (seqno == (u16_t) (ctx->ab_write+1)) {
// expected packet // expected packet
abuf = ctx->audio_buffer + BUFIDX(seqno);
ctx->ab_write = seqno; ctx->ab_write = seqno;
LOG_SDEBUG("packet expected seqno:%hu rtptime:%u (W:%hu R:%hu)", seqno, rtptime, ctx->ab_write, ctx->ab_read); LOG_SDEBUG("packet expected seqno:%hu rtptime:%u (W:%hu R:%hu)", seqno, rtptime, ctx->ab_write, ctx->ab_read);
} else if (seq_order(ctx->ab_write, seqno)) { } else if (seq_order(ctx->ab_write, seqno)) {
@@ -504,16 +506,15 @@ static void buffer_put_packet(rtp_t *ctx, seq_t seqno, unsigned rtptime, bool fi
LOG_DEBUG("[%p]: packet newer seqno:%hu rtptime:%u (W:%hu R:%hu)", ctx, seqno, rtptime, ctx->ab_write, ctx->ab_read); LOG_DEBUG("[%p]: packet newer seqno:%hu rtptime:%u (W:%hu R:%hu)", ctx, seqno, rtptime, ctx->ab_write, ctx->ab_read);
} }
abuf = ctx->audio_buffer + BUFIDX(seqno);
ctx->ab_write = seqno; ctx->ab_write = seqno;
} else if (seq_order(ctx->ab_read, seqno + 1)) { } else if (seq_order(ctx->ab_read, seqno + 1)) {
// recovered packet, not yet sent // recovered packet, not yet sent
abuf = ctx->audio_buffer + BUFIDX(seqno);
ctx->resent_rec++; ctx->resent_rec++;
LOG_DEBUG("[%p]: packet recovered seqno:%hu rtptime:%u (W:%hu R:%hu)", ctx, seqno, rtptime, ctx->ab_write, ctx->ab_read); LOG_DEBUG("[%p]: packet recovered seqno:%hu rtptime:%u (W:%hu R:%hu)", ctx, seqno, rtptime, ctx->ab_write, ctx->ab_read);
} else { } else {
// too late // too late
LOG_DEBUG("[%p]: packet too late seqno:%hu rtptime:%u (W:%hu R:%hu)", ctx, seqno, rtptime, ctx->ab_write, ctx->ab_read); if (abuf->missed) LOG_INFO("[%p]: packet too late seqno:%hu rtptime:%u (W:%hu R:%hu)", ctx, seqno, rtptime, ctx->ab_write, ctx->ab_read);
abuf = NULL;
} }
if (ctx->in_frames++ > 1000) { if (ctx->in_frames++ > 1000) {
@@ -524,6 +525,7 @@ static void buffer_put_packet(rtp_t *ctx, seq_t seqno, unsigned rtptime, bool fi
if (abuf) { if (abuf) {
alac_decode(ctx, abuf->data, data, len, &abuf->len); alac_decode(ctx, abuf->data, data, len, &abuf->len);
abuf->ready = 1; abuf->ready = 1;
abuf->missed = 0;
// this is the local rtptime when this frame is expected to play // this is the local rtptime when this frame is expected to play
abuf->rtptime = rtptime; abuf->rtptime = rtptime;
buffer_push_packet(ctx); buffer_push_packet(ctx);
@@ -567,6 +569,7 @@ static void buffer_push_packet(rtp_t *ctx) {
LOG_DEBUG("[%p]: created zero frame (W:%hu R:%hu)", ctx, ctx->ab_write, ctx->ab_read); LOG_DEBUG("[%p]: created zero frame (W:%hu R:%hu)", ctx, ctx->ab_write, ctx->ab_read);
ctx->data_cb(silence_frame, ctx->frame_size * 4, playtime); ctx->data_cb(silence_frame, ctx->frame_size * 4, playtime);
ctx->silent_frames++; ctx->silent_frames++;
curframe->missed = 1;
} }
} else if (curframe->ready) { } else if (curframe->ready) {
ctx->data_cb((const u8_t*) curframe->data, curframe->len, playtime); ctx->data_cb((const u8_t*) curframe->data, curframe->len, playtime);