]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: firewire-lib: add helper functions as interfaces between packet streaming layer...
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sat, 19 Sep 2015 02:21:52 +0000 (11:21 +0900)
committerTakashi Iwai <tiwai@suse.de>
Tue, 29 Sep 2015 10:35:47 +0000 (12:35 +0200)
commite220f4c715dc0dfcf9f2e143a21f3617339acf27
tree1d1f76e75bc8fbd49761a41ddaf4f99706541ae2
parent86362ba0eab9e4782aa4e2b9fb529cff4996a9a2
ALSA: firewire-lib: add helper functions as interfaces between packet streaming layer and data block processing layer

ALSA PCM framework uses PCM buffer with a concept of 'period' to
synchronize userspace operations to hardware for nearly-realtime
processing. Each driver implements snd_pcm_period_elapsed() to tell across
of the period boundary to ALSA PCM middleware. To call the function, some
drivers utilize hardware interrupt handlers, the others count handled PCM
frames.

Drivers for sound units on IEEE 1394 bus are the latter. They use two
buffers; PCM buffer and DMA buffer for IEEE 1394 isochronous packet. PCM
frames are copied between these two buffers and 'amdtp_stream' structure
counts the handled PCM frames. Then, snd_pcm_period_elapsed() is called if
required.

Essentially, packet streaming layer should not be responsible for PCM
frame processing. The PCM frame processing should be handled in each data
block processing layer as a result of handling data blocks. Although, PCM
frame counting is a common work for all of protocols which ALSA firewire
stack is going to support.

This commit adds two new helper functions as interfaces between packet
streaming layer to data block processing layer. In future, each data block
processing layer implements these functions. The packet streaming layer
calls data block processing layer per packet by calling the functions. The
data block processing layer processes data blocks and PCM frames, and
returns the number of processed PCM frames. Then the packet streaming layer
calculates handled PCM frames and calls snd_pcm_period_elapsed().

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/amdtp.c