Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Timur Tabi <timur@freescale.com>
Cc: ALSA development <alsa-devel@alsa-project.org>
Subject: Re: Possible problem with snd_pcm_oss_sync()
Date: Wed, 21 May 2008 13:25:41 +0200	[thread overview]
Message-ID: <483406B5.4010408@ladisch.de> (raw)
In-Reply-To: <48331F26.4030104@freescale.com>

Timur Tabi wrote:
> The customer is using an old application called "bplay" to test OSS audio
> support on our hardware.  The application works fine on x86, but fails on our
> PowerPC board.  It could be an endian issue, but I doubt it.

Is that a recent enough version of bplay, from Debian?  Older ones
didn't work on big-endian machines.

> #1) Stopped audio stream output after doing followings:
> 1. Opening /dev/mixer
> 2. Getting a channel value (0x00000001) that is used for "ioctl(fd,
> SOUND_MIXER_READ_DEVMASK, &Sndsts);".
> 3. Write audio volume information by "ioctl(fd,
> SOUND_MIXER_WRITE_VOLUME, &Value);",

I didn't find this in the bplay code.

If writing to a mixer control stops the audio stream, this may be a bug
in the driver (whatever driver this is).

> #2) Stopped audio stream output after doing following:
> 2. Executing command "ioctl(fd, SNDCTL_DSP_SYNC, NULL);",

This ioctl stops the output (after playing the remaining data in the
buffer).  The application can restart playing by writing more data.

> XXXX found that by commenting out the "sync_audio" function on the source
> code of "bplay" made "bplay" work. So XXXX suspects the implementation of the
> ioctl on the OSS emulation may have a problem.

bplay calls the SYNC ioctl before setting the sample format, but this is
not allowed: <http://manuals.opensound.com/developer/callorder.html>.

Removing that call to sync_audio() fixes the bug.  :-)

> snd_pcm_oss_sync() displays this message:
>
> sync: buffer_used
>
> What does this mean?

It means that the buffer contains some data which will be played before
the device is stopped and the ioctl returns.


HTH
Clemens

  reply	other threads:[~2008-05-21 11:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-20 16:03 Possible problem with snd_pcm_oss_sync() Timur Tabi
2008-05-20 18:57 ` Timur Tabi
2008-05-21 11:25   ` Clemens Ladisch [this message]
2008-05-21 10:44 ` Takashi Iwai
2008-05-21 14:15   ` Timur Tabi

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=483406B5.4010408@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=timur@freescale.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox