Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jaroslav Kysela <perex@perex.cz>
To: Takashi Iwai <tiwai@suse.de>
Cc: Vinod Koul <vinod.koul@linux.intel.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	alsa <alsa-devel@alsa-project.org>,
	Pierre-louis Bossart <pierre-louis.bossart@linux.intel.com>
Subject: Re: data write in alsa
Date: Fri, 02 Dec 2011 08:16:21 +0100	[thread overview]
Message-ID: <4ED87B45.5080603@perex.cz> (raw)
In-Reply-To: <s5hr50no3a9.wl%tiwai@suse.de>

Date 2.12.2011 08:12, Takashi Iwai wrote:
> At Fri, 02 Dec 2011 12:24:41 +0530,
> Vinod Koul wrote:
>>
>> Hi Takashi,
>>
>> For alsa pcm we have two ways to write data, either we use write()
>> system call or use ioctl SNDRV_PCM_IOCTL_WRITEI_FRAMES.
>>
>> Is there any specific reason why we have two methods and which one is
>> preferred and why?
>
> Well, I only remember vaguely.  IIRC, ioctl is used since it can pass
> the error code more directly without using errno.  Maybe Jaroslav
> knows more exact reason.

The true reason was to avoid the audio frame <-> byte conversions.

> But, honestly speaking, I don't like this implementation.  For a new
> interface, I'd suggest to stick with the normal read/write.  Otherwise
> you'll get a mess of 32bit compat layer again.

I think that for compressed data, the standard r/w ops are fine, because 
there are no "frames".

					Jaroslav

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Kernel Sound Maintainer
ALSA Project; Red Hat, Inc.

  reply	other threads:[~2011-12-02  7:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-02  6:54 data write in alsa Vinod Koul
2011-12-02  7:12 ` Takashi Iwai
2011-12-02  7:16   ` Jaroslav Kysela [this message]
2011-12-02 11:47     ` Vinod Koul

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=4ED87B45.5080603@perex.cz \
    --to=perex@perex.cz \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.de \
    --cc=vinod.koul@linux.intel.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