All of lore.kernel.org
 help / color / mirror / Atom feed
From: "MONTANARO Luciano (MM)" <luciano.montanaro@magnetimarelli.com>
To: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: [PATCH] Wrap hw_ptr to boundary in pcm_ioplug
Date: Tue, 4 Mar 2014 12:51:36 +0100	[thread overview]
Message-ID: <67BA5DEFFBE7BF46B4C53F7E5FC5AD44344700ED7C@MXCL13.fgremc.it> (raw)

The function snd_pcm_ioplug_hw_ptr_update() always increased the hw_ptr
by delta, without wrapping it to the boundary. This would lead to
problems when after many hours, the hw_ptr would overflow.
---
 src/pcm/pcm_ioplug.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/pcm/pcm_ioplug.c b/src/pcm/pcm_ioplug.c
index a90c844..c1c3a98 100644
--- a/src/pcm/pcm_ioplug.c
+++ b/src/pcm/pcm_ioplug.c
@@ -60,7 +60,7 @@ static void snd_pcm_ioplug_hw_ptr_update(snd_pcm_t *pcm)
                        delta = hw - io->last_hw;
                else
                        delta = pcm->buffer_size + hw - io->last_hw;
-               io->data->hw_ptr += delta;
+               snd_pcm_mmap_hw_forward(io->data->pcm, delta);
                io->last_hw = hw;
        } else
                io->data->state = SNDRV_PCM_STATE_XRUN;
--
1.7.0.4






--
Luciano Montanaro
EntryNAV - Audio Software Integrator
Magneti Marelli Electronic Systems
Viale Carlo Emanuele II 150, Venaria Reale (To)
Tel. (+39) 011 6879765





VISITA IL NOSTRO NUOVO SITO WEB! - VISIT OUR NEW WEB SITE!   www.magnetimarelli.com

Confidential Notice: This message - including its attachments - may contain proprietary, confidential and/or legally protected information and is intended solely for the use of the designated addressee(s) above. If you are not the intended recipient be aware that any downloading, copying, disclosure, distribution or use of the contents of the above information is strictly prohibited.
If you have received this communication by mistake, please forward the message back to the sender at the email address above, delete the message from all mailboxes and any other electronic storage medium and destroy all copies.
Disclaimer Notice: Internet communications cannot be guaranteed to be safe or error-free. Therefore we do not assure that this message is complete or accurate and we do not accept liability for any errors or omissions in the contents of this message.

             reply	other threads:[~2014-03-04 11:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-04 11:51 MONTANARO Luciano (MM) [this message]
2014-03-04 12:03 ` [PATCH] Wrap hw_ptr to boundary in pcm_ioplug Jaroslav Kysela

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=67BA5DEFFBE7BF46B4C53F7E5FC5AD44344700ED7C@MXCL13.fgremc.it \
    --to=luciano.montanaro@magnetimarelli.com \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.