alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: "Alexander E. Patrakov" <patrakov@gmail.com>
To: alsa-devel@alsa-project.org
Subject: Dubious assertion in alsa-lib
Date: Sun, 21 Nov 2010 14:39:56 +0500	[thread overview]
Message-ID: <icapdc$38e$1@dough.gmane.org> (raw)

Hello.

In alsa-lib-1.0.23/src/pcm/pcm_plug.c, there are two assertions of the form:

assert(snd_pcm_format_linear(slv->format));

in snd_pcm_plug_change_rate() and snd_pcm_plug_change_channels() 
functions, respectively. While in snd_pcm_plug_change_rate() this looks 
reasonable, it is IMHO invalid in snd_pcm_plug_change_channels(). I say 
this because this can be triggered with the following .asoundrc:

pcm.jackplug {
	type plug
	slave.pcm {
		type jack
		playback_ports {
			0 system:playback_1
			1 system:playback_2
		}
		capture_ports {
			0 system:capture_1
			1 system:capture_2
		}
		client_name "alsa"
	}
}

and the following command:

aplay -r 44100 -c 1 -f FLOAT_LE -D jackplug /dev/zero

JACK is configured to accept stereo audio, with 44100 Hz sampling rate, 
so only the number of channels has to be changed by the plug here.

I.e., rerouting channels by copying samples makes perfect sense not only 
for linear formats, but also for floating-point ones.

-- 
Alexander E. Patrakov

                 reply	other threads:[~2010-11-21  9:40 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='icapdc$38e$1@dough.gmane.org' \
    --to=patrakov@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).