Re: [PATCH] ALSA: sb: remove needless evaluation in implementation for copy callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On May 23 2017 22:49, Takashi Iwai wrote:
On Tue, 23 May 2017 15:40:42 +0200,
Takashi Sakamoto wrote:

In design of ALSA pcm core, 'struct snd_pcm_ops.copy' is expected to
copy PCM frames, according to frame alignment on intermediate buffer for
userspace and dedicated buffer for data transmission. In this callback,
value of 'channel' argument depends on the frame alignment, which drivers
registers to runtime of PCM substream. When target devices can handle
non-interleaved buffer, this value has positive value, otherwise negative.

ALSA driver for PCM component of EMU8000 chip is programmed with local
macro to switch the frame alignment. The 'copy' operation in
non-interleaved side has evaluation of the 'channel' argument (actually
it's 'voice' argument). This is useless.

This commit remove the evaluation.

Signed-off-by: Takashi Sakamoto <o-takashi@xxxxxxxxxxxxx>

Passing -1 to the channel was valid even for non-interleaved access.
It was meant to apply to all channels.

The call with channel = -1 itself might have been dropped meanwhile,
so removing it may be OK now.  But the description is confusing as if
it were incorrectly implemented.

https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/tree/Documentation/sound/kernel-api/writing-an-alsa-driver.rst#n3598

> You need to check the channel argument, and if it's -1, copy the
> whole channels. Otherwise, you have to copy only the specified
> channel.

Hm. We need to correct this API documentation, because there's no codes to pass negative value to the argument for vector buffer operation. I'll post my proposal later.


Thanks

Takashi Sakamoto
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux