All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Martin schmidt <schmidtmartin00@googlemail.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: Alsa asynchonus playnback
Date: Tue, 29 Nov 2011 16:14:23 +0100	[thread overview]
Message-ID: <4ED4F6CF.8040004@ladisch.de> (raw)
In-Reply-To: <CAOONfQsONoj1bokU9xnQz6MvDps=o9M_3Bfk=zOEXv=PLiQJGA@mail.gmail.com>

Martin schmidt wrote:
> my problem is, the sound has an Echo (in german Hall-Effekt).
>
> int write_to_audiostream(short*buf)
> {
>     memcpy(audiobuffer[audiobuffercounter],buf,audio_buffersize*sizeof(short));
>    int w=  snd_pcm_writei (pcm_handle, audiobuffer[audiobuffercounter], 2* audio_buffersize);

This looks correct (as long as the buffer is correctly filled).
Do you ever check w?

>    audiobuffercounter = ++audiobuffercounter % 10;

It is a bad idea to disable compiler warnings, or to not heed them.

> in a Timer-Event

Why a timer?  How is the timer synchronized to the sample clock?


Regards,
Clemens

      parent reply	other threads:[~2011-11-29 15:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-29 11:28 Alsa asynchonus playnback Martin schmidt
2011-11-29 13:29 ` Clemens Ladisch
     [not found]   ` <CAOONfQsONoj1bokU9xnQz6MvDps=o9M_3Bfk=zOEXv=PLiQJGA@mail.gmail.com>
2011-11-29 15:14     ` Clemens Ladisch [this message]

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=4ED4F6CF.8040004@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=schmidtmartin00@googlemail.com \
    /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.