summaryrefslogtreecommitdiff
path: root/audio.c
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2015-03-10 10:14:37 +0100
committerJohns <johns98@gmx.net>2015-03-10 10:14:37 +0100
commitca0181b1b12af971a892418f8c6ac3ec90bb97a0 (patch)
tree116e6444bf7c634eb039cada820aeeb6fbaedd52 /audio.c
parenta36221dea7ea84943c9df195e360196179e94afb (diff)
downloadvdr-plugin-softhddevice-ca0181b1b12af971a892418f8c6ac3ec90bb97a0.tar.gz
vdr-plugin-softhddevice-ca0181b1b12af971a892418f8c6ac3ec90bb97a0.tar.bz2
Try smaller audio puffer, if default size fails.
Diffstat (limited to 'audio.c')
-rw-r--r--audio.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/audio.c b/audio.c
index a9da207..77fa650 100644
--- a/audio.c
+++ b/audio.c
@@ -1237,21 +1237,29 @@ static int AlsaSetup(int *freq, int *channels, int passthrough)
AlsaUseMmap ? SND_PCM_ACCESS_MMAP_INTERLEAVED :
SND_PCM_ACCESS_RW_INTERLEAVED, *channels, *freq, 1,
96 * 1000))) {
-
- /*
- if ( err == -EBADFD ) {
- snd_pcm_close(AlsaPCMHandle);
- AlsaPCMHandle = NULL;
- continue;
- }
- */
-
- if (!AudioDoingInit) {
- Error(_("audio/alsa: set params error: %s\n"),
- snd_strerror(err));
+ // try reduced buffer size (needed for sunxi)
+ // FIXME: alternativ make this configurable
+ if ((err =
+ snd_pcm_set_params(AlsaPCMHandle, SND_PCM_FORMAT_S16,
+ AlsaUseMmap ? SND_PCM_ACCESS_MMAP_INTERLEAVED :
+ SND_PCM_ACCESS_RW_INTERLEAVED, *channels, *freq, 1,
+ 72 * 1000))) {
+
+ /*
+ if ( err == -EBADFD ) {
+ snd_pcm_close(AlsaPCMHandle);
+ AlsaPCMHandle = NULL;
+ continue;
+ }
+ */
+
+ if (!AudioDoingInit) {
+ Error(_("audio/alsa: set params error: %s\n"),
+ snd_strerror(err));
+ }
+ // FIXME: must stop sound, AudioChannels ... invalid
+ return -1;
}
- // FIXME: must stop sound, AudioChannels ... invalid
- return -1;
}
break;
}