Commit f007c790 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Added logs to understand what is the audio issue with qsa soundcard + improved bb10 display

parent 37870ca2
......@@ -543,7 +543,7 @@ static void ms_qsa_write_process(MSFilter *f) {
}
} else if ((status.status == SND_PCM_STATUS_READY) || (status.status == SND_PCM_STATUS_UNDERRUN)) {
err = snd_pcm_plugin_prepare(d->handle, SND_PCM_CHANNEL_PLAYBACK);
if (err != 0) {
if (err != 0) {min_voices
ms_error("%s: snd_pcm_plugin_prepare() failed: %s", __FUNCTION__, snd_strerror(err));
goto setup_failure;
}
......@@ -555,7 +555,7 @@ static void ms_qsa_write_process(MSFilter *f) {
ms_warning("%s: Removing extra data for sound card (%i bytes)", __FUNCTION__, ms_bufferizer_get_avail(d->bufferizer));
ms_bufferizer_flush(d->bufferizer);
}
return;
return;min_voices
setup_failure:
if (d->mixer_handle != NULL) {
......@@ -605,9 +605,11 @@ static void ms_qsa_write_uninit(MSFilter *f) {
static int ms_qsa_write_set_sample_rate(MSFilter *f, void *arg) {
MSQSAWriteData *d = (MSQSAWriteData *)f->data;
int hz = *((int *)arg);
ms_warning("[DEBUG] trying to set sample rate: %i", hz);
uint32_t pcm_rate = get_pcm_rate_from_hz(hz);
if ((pcm_rate != 0) && (d->info.rates & pcm_rate)) {
d->rate = hz;
ms_warning("[DEBUG] set sample rate: %i", hz);
return 0;
}
return -1;
......@@ -616,14 +618,17 @@ static int ms_qsa_write_set_sample_rate(MSFilter *f, void *arg) {
static int ms_qsa_write_get_sample_rate(MSFilter *f, void *arg) {
MSQSAWriteData * d = (MSQSAWriteData *)f->data;
*((int*)arg) = d->rate;
ms_warning("[DEBUG] get sample rate: %i", d->rate);
return 0;
}
static int ms_qsa_write_set_nchannels(MSFilter *f, void *arg) {
MSQSAWriteData *d = (MSQSAWriteData *)f->data;
int nchannels = *((int *)arg);
ms_warning("[DEBUG] nchannels: %i, min voices = %i, max voices = %i", nchannels, d->info.min_voices, d->info.max_voices);
if ((nchannels >= d->info.min_voices) && (nchannels <= d->info.max_voices)) {
d->nchannels = nchannels;
ms_warning("[DEBUG] nchannels set %i", nchannels);
return 0;
}
return -1;
......@@ -632,6 +637,7 @@ static int ms_qsa_write_set_nchannels(MSFilter *f, void *arg) {
static int ms_qsa_write_get_nchannels(MSFilter *f, void *arg) {
MSQSAWriteData *d = (MSQSAWriteData *)f->data;
*((int *)arg) = d->nchannels;
ms_warning("[DEBUG] get nchannels", d->nchannels);
return 0;
}
......
......@@ -107,18 +107,30 @@ static void bb10display_destroyWindow(BB10Display *d) {
ms_warning("[bb10_display] bb10display_destroyWindow window destroyed");
}
static void bb10display_fillWindowBuffer(BB10Display *d, MSPicture yuvbuf) {
unsigned char *ptr = NULL;
static void bb10display_fillWindowBuffer(BB10Display *d, MSPicture *yuvbuf) {
uint8_t *ptr = NULL;
screen_get_buffer_property_pv(d->pixmap_buffer, SCREEN_PROPERTY_POINTER, (void **)&ptr);
if (ptr) {
unsigned char *y = ptr;
unsigned char *u = y + (d->vsize.height * d->stride);
unsigned char *v = u + (d->vsize.height * d->stride) / 4;
uint8_t *dest_planes[3];
int dest_strides[3];
MSVideoSize roi = {0};
memcpy(y, yuvbuf.planes[0], yuvbuf.w * yuvbuf.h);
memcpy(u, yuvbuf.planes[1], yuvbuf.w * yuvbuf.h / 4);
memcpy(v, yuvbuf.planes[2], yuvbuf.w * yuvbuf.h / 4);
uint8_t *y = ptr;
uint8_t *u = y + (d->vsize.height * d->stride);
uint8_t *v = u + (d->vsize.height * d->stride) / 4;
dest_planes[0] = y;
dest_planes[1] = u;
dest_planes[2] = v;
dest_strides[0] = d->stride;
dest_strides[1] = d->stride / 2;
dest_strides[2] = d->stride / 2;
roi.width = yuvbuf->w;
roi.height = yuvbuf->h;
ms_yuv_buf_copy(yuvbuf->planes, yuvbuf->strides, dest_planes, dest_strides, roi);
screen_buffer_t buffer;
screen_get_window_property_pv(d->window, SCREEN_PROPERTY_RENDER_BUFFERS, (void**) &buffer);
......@@ -189,7 +201,7 @@ static void bb10display_process(MSFilter *f) {
}
if (d->window_created) {
bb10display_fillWindowBuffer(d, src);
bb10display_fillWindowBuffer(d, &src);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment