mailman.alsa-project.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Patch

Thread Start a new thread
Download
Threads by month
  • ----- 2025 -----
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
patch@alsa-project.org

February 2020

  • 2 participants
  • 2 discussions
Re: [ALSA patch] [alsa-devel] [PATCH] do not set close-on-exec flag on descriptor if it was already set
by Jaroslav Kysela 11 Feb '20

11 Feb '20
Dne 11. 02. 20 v 11:22 Rolf Eike Beer napsal(a): > There is no need to set this again if O_CLOEXEC is supported. Thanks. Applied. Jroslav > > Signed-off-by: Rolf Eike Beer <eb(a)emlix.com> > --- > include/local.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/local.h b/include/local.h > index ea0ec32d..ed6ba936 100644 > --- a/include/local.h > +++ b/include/local.h > @@ -320,8 +320,10 @@ static inline int snd_open_device(const char *filename, int fmode) > fd = rsm_open_device(filename, fmode); > } > #endif > +#ifndef O_CLOEXEC > if (fd >= 0) > fcntl(fd, F_SETFD, FD_CLOEXEC); > +#endif > return fd; > } > > -- Jaroslav Kysela <perex(a)perex.cz> Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
1 0
0 0
Re: [ALSA patch] [alsa-devel] [PATCH - 1/1] pcm: direct: Round down of slave_hw_ptr when buffer size is two period size
by Takashi Iwai 06 Feb '20

06 Feb '20
On Thu, 06 Feb 2020 09:14:42 +0100, Channaiah Vanitha (RBEI/ECF3) wrote: > > Hello Takashi-san, > > This patch is regarding the fix for rounding down/up of slave pointers. > For buffer_size >= 2*period_size, round down of slave pointers and > for buffer_size < 2*period_size, round up of slave pointers will avoid xruns. > which otherwise causes snd_pcm_wait() to block for more than expected snd_pcm_period_elapsed() which leads to xruns. > > We had similar discussion for same issue in below link: > https://mailman.alsa-project.org/pipermail/alsa-devel/2019-June/151169.html Yes, and I still don't get why this must be required. Doesn't this imply that you drop the samples instead? Takashi > > Regards, > Vanitha > > > -----Original Message----- > From: Channaiah Vanitha (RBEI/ECF3) <Vanitha.Channaiah(a)in.bosch.com> > Sent: Thursday, February 6, 2020 1:43 PM > To: Channaiah Vanitha (RBEI/ECF3) <Vanitha.Channaiah(a)in.bosch.com>; patch(a)alsa-project.org > Cc: alsa-devel(a)alsa-project.org; Wischer Timo (ADITG/ESS) <twischer(a)de.adit-jv.com> > Subject: [PATCH - 1/1] pcm: direct: Round down of slave_hw_ptr when buffer size is two period size > > From: Vanitha Channaiah <vanitha.channaiah(a)in.bosch.com> > > For buffer size equal to two period size, the start position of slave_hw_ptr is rounded down in order to avoid xruns > > For e.g.: > Considering below parameters and its values: > Period size = 96 (0x60) > Buffer size = 192 (0xC0) > Timer ticks = 1 > avail_min = 0x60 > slave_hw_ptr = unaligned value during dmix_start() > > Issue: > - Initial, app_ptr = hw_ptr = 0 > - Application fills buffer size of data. so app_ptr = 0xC0, hw_ptr = 0 > - During dmix_start(), current slave_hw_ptr is not rounded down. current slave_hw_ptr would be 0x66 > - slave_hw_ptr is keep on updating at the hardware 0x67, 0x68, 0x69 > - The diff calculation between old_slave_hw_ptr(0x66) and new_slave_hw_ptr(0x69) > results in avail = 0x6 > - After 1 snd_pcm_period_elapsed(), slave_hw_ptr = 0xC0 > - The result of avail = 0x5A which is less than avail_min(0x60) > - Here, xruns will be observed > > Fix: > - Initial, app_ptr = hw_ptr = 0 > - Application fills buffer size of data. so app_ptr = 0xC0, hw_ptr = 0 > - Round down of slave_hw_ptr during dmix_start() leads to below calculation: > - During dmix_start(), slave_hw_ptr rounded to 0x60 (old slave_hw_ptr) > - The diff calculation between old_slave_hw_ptr(0x60) and new_slave_hw_ptr(0x69) > results in avail = 0x9 > - After 1 snd_pcm_period_elapsed(), slave_hw_ptr = 0xC0 > - The result of avail = 0x60 which is avail_min(0x60) > - Here, xruns can be avoided > > Signed-off-by: Vanitha Channaiah <vanitha.channaiah(a)in.bosch.com> > > diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c index 54d9900..a201fa3 100644 > --- a/src/pcm/pcm_direct.c > +++ b/src/pcm/pcm_direct.c > @@ -2043,10 +2043,14 @@ int snd_pcm_direct_parse_open_conf(snd_config_t *root, snd_config_t *conf, > > void snd_pcm_direct_reset_slave_ptr(snd_pcm_t *pcm, snd_pcm_direct_t *dmix) { > + /* > + * For buffer size equal to two period size, slave_hw_ptr is rounded down > + * to avoid xruns > + */ > > if (dmix->hw_ptr_alignment == SND_PCM_HW_PTR_ALIGNMENT_ROUNDUP || > (dmix->hw_ptr_alignment == SND_PCM_HW_PTR_ALIGNMENT_AUTO && > - pcm->buffer_size <= pcm->period_size * 2)) > + pcm->buffer_size < pcm->period_size * 2)) > dmix->slave_appl_ptr = > ((dmix->slave_appl_ptr + dmix->slave_period_size - 1) / > dmix->slave_period_size) * dmix->slave_period_size; > -- > 2.7.4 > > _______________________________________________ > Alsa-devel mailing list > Alsa-devel(a)alsa-project.org > https://mailman.alsa-project.org/mailman/listinfo/alsa-devel >
1 1
0 0

HyperKitty Powered by HyperKitty version 1.3.8.