alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Louise Hoffman <louise.hoffman@gmail.com>
To: alsa-devel@alsa-project.org
Subject: Warning/error from ALSA’s pcm_min.c example. Possible problem?
Date: Sat, 30 Jan 2010 20:51:28 +0100	[thread overview]
Message-ID: <30c82f5f1001301151r6de4761fh9453829c1af85e15@mail.gmail.com> (raw)

Dear ALSA developers,

When I compile ALSA's pcm_min.c[0] example with

gcc -Wall -lasound pcm_min.c -o pcm_min

Everything is fine, but running it, I get the white noise as expected,
but I also get this warning/error:

Short write (expected 16384, wrote 7616)

Which comes from the last if-statement.

One bug is in this line

                frames = snd_pcm_writei(handle, buffer, sizeof(buffer));

where "sizeof(buffer)" should be "number of frames in the buffer".

But there are still some strange things going on. I still get those
errors, and if I remove the for-loop, nothing is played.

Here is my code. [1]

Can someone see what's wrong?

Hugs,
Louise


[0] http://www.google.com/codesearch/p?hl=en&sa=N&cd=1&ct=rc#4FSOSMZ6Pxc/distfiles/alsa-lib-1.0.14rc2.tar.bz2|ZScnKi-LryE/alsa-lib-1.0.14rc2/test/pcm_min.c&q=pcm_min.c

[1] http://pastebin.com/m2f28b578

             reply	other threads:[~2010-01-30 19:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-30 19:51 Louise Hoffman [this message]
2010-01-31  4:43 ` Warning/error from ALSA’s pcm_min.c example. Possible problem? Raymond Yau
2010-01-31 20:53   ` Louise Hoffman
2010-01-31  8:46 ` Jaroslav Kysela
2010-01-31 20:41   ` Louise Hoffman
  -- strict thread matches above, loose matches on Subject: below --
2010-10-29  3:49 Raymond Yau
2010-10-29  7:19 ` 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=30c82f5f1001301151r6de4761fh9453829c1af85e15@mail.gmail.com \
    --to=louise.hoffman@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).