Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Richter <thor@math.tu-berlin.de>
To: alsa-devel@alsa-project.org
Subject: Mono output on emu10k1 with alsa broken
Date: Wed, 1 May 2013 21:36:45 +0000 (UTC)	[thread overview]
Message-ID: <loom.20130501T232933-467@post.gmane.org> (raw)

Trying to configure mono (one channel) output on emu10k1 hardware using the
alsa version that comes with kernel 3.9 is broken. Instead of expecting mono
samples, the alsa callback expects twice as many stereo samples. Not getting
the required number of samples then causes a buffer underrun, and sound gets
interrupted or messed up. In fact, what the audio hardware does is that it
plays not only the buffer, but also the data "behind the buffer", causing
wierd noises.

The channel count is setup as

channels = 1;


snd_pcm_hw_params_malloc(&HWParms);

snd_pcm_open(&SoundStream,CardName,SND_PCM_STREAM_PLAYBACK,SND_PCM_NONBLOCK
| SND_PCM_ASYNC);

snd_pcm_hw_params_set_channels_min(SoundStream,HWParms,&channels);

snd_pcm_hw_params_set_channels_max(SoundStream,HWParms,&channels);

snd_pcm_hw_params_set_channels_first(SoundStream,HWParms,&channels);

plus error checking. Then, a bit later, the number of configured channels is
verified:

snd_pcm_hw_params_get_channels(HWParms,&channels);

channels is at this point still 1, i.e. the driver accepted the mono output,
but does then not play correctly.

Note that the same call sequence works for stereo, and it also works for
mono for other underlying hardware drivers, i.e. mono output works on
snd-hda-intel, for example. It does not on emu10k1.

                 reply	other threads:[~2013-05-01 21:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=loom.20130501T232933-467@post.gmane.org \
    --to=thor@math.tu-berlin.de \
    --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