From 588abac50b90c2b4b7c7336a895f48cdc6c91c45 Mon Sep 17 00:00:00 2001 From: BPanther Date: Tue, 5 Mar 2019 07:27:13 +0100 Subject: [PATCH 1/2] small fix for vusolo4k Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/e16eba920a07c9b633a394593dfaf921d474f6dd Author: BPanther Date: 2019-03-05 (Tue, 05 Mar 2019) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/audio.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libarmbox/audio.cpp b/libarmbox/audio.cpp index 48e3d6b..a524440 100644 --- a/libarmbox/audio.cpp +++ b/libarmbox/audio.cpp @@ -319,6 +319,9 @@ int cAudio::StopClip() hal_info("%s: clipfd not yet opened\n", __FUNCTION__); return -1; } +#if BOXMODEL_VUSOLO4K + ioctl(clipfd, SNDCTL_DSP_RESET); +#endif close(clipfd); clipfd = -1; if (mixer_fd > -1) { From 143d5769bd94251eb835e99949a52e62753c6264 Mon Sep 17 00:00:00 2001 From: Frankenstone Date: Thu, 7 Mar 2019 20:41:45 +0100 Subject: [PATCH 2/2] libarm clipplay-retry, thx DboxOldie Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/4d6fcc8f4351092274329edd28b8c9936271d58b Author: Frankenstone Date: 2019-03-07 (Thu, 07 Mar 2019) Origin message was: ------------------ - libarm clipplay-retry, thx DboxOldie ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/audio.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/libarmbox/audio.cpp b/libarmbox/audio.cpp index a524440..e2c331b 100644 --- a/libarmbox/audio.cpp +++ b/libarmbox/audio.cpp @@ -12,6 +12,7 @@ #include "audio_lib.h" #include "hal_debug.h" +#include #define AUDIO_DEVICE "/dev/dvb/adapter0/audio0" #define hal_debug(args...) _hal_debug(HAL_DEBUG_AUDIO, this, args) @@ -245,8 +246,10 @@ int cAudio::PrepareClipPlay(int ch, int srate, int bits, int little_endian) perror("SNDCTL_DSP_CHANNELS"); if (ioctl(clipfd, SNDCTL_DSP_SPEED, &srate)) perror("SNDCTL_DSP_SPEED"); +#if !BOXMODEL_HD51 if (ioctl(clipfd, SNDCTL_DSP_RESET)) perror("SNDCTL_DSP_RESET"); +#endif if (!mix_dev) return 0; @@ -299,15 +302,30 @@ int cAudio::PrepareClipPlay(int ch, int srate, int bits, int little_endian) int cAudio::WriteClip(unsigned char *buffer, int size) { - int ret; + int ret, __attribute__ ((unused)) count = 1; // hal_debug("cAudio::%s\n", __FUNCTION__); if (clipfd < 0) { hal_info("%s: clipfd not yet opened\n", __FUNCTION__); return -1; } +#if BOXMODEL_HD51 +again: +#endif ret = write(clipfd, buffer, size); - if (ret < 0) + if (ret < 0) { hal_info("%s: write error (%m)\n", __FUNCTION__); + return ret; + } +#if BOXMODEL_HD51 + if (ret != size) { + hal_info("cAudio::%s: difference > to write (%d) != written (%d) try (%d) > reset dsp and restart write\n", __FUNCTION__, size, ret, count); + if (ioctl(clipfd, SNDCTL_DSP_RESET)) + perror("SNDCTL_DSP_RESET"); + count++; + if (count < 3) + goto again; + } +#endif return ret; };