async fn read_data<'a>(
    src_buf: AsyncCaptureBuffer<'a>,
    writer: Option<&mut Writer>,
    period_bytes: usize
) -> Result<u32, Error>