summaryrefslogtreecommitdiff
path: root/sound/firewire/amdtp-stream.h
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2023-01-10 16:49:31 +0300
committerTakashi Iwai <tiwai@suse.de>2023-01-12 14:14:49 +0300
commita36183f69c2c24e6e4b1f8f79adc7137ee7444d9 (patch)
treefe21c2c809c03499310077047d83ecdaccb7caf3 /sound/firewire/amdtp-stream.h
parentfef4e61b0b765b6d22badcd5b6575b159e7d510a (diff)
downloadlinux-a36183f69c2c24e6e4b1f8f79adc7137ee7444d9.tar.xz
ALSA: firewire-lib: move parameter for pcm frame multiplier from context payload processing layer
The current implementation delegates the task to calculate the number of processed PCM frames into the context payload processing layer. It looks good as long as frame calculation is done for a single purpose. Nevertheless, another purpose, the computation of extra delay for the runtime of PCM substream, requires frame calculation, too. This commit refactors the current implementation so that the packet stream processing layer is responsible for the calculation of PCM frame, too. The member is moved to stream structure for multiplier between data block count and PCM frame count. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20230110134933.322794-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/amdtp-stream.h')
-rw-r--r--sound/firewire/amdtp-stream.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/firewire/amdtp-stream.h b/sound/firewire/amdtp-stream.h
index a8dd1c3ec8d9..35b48f9ddbf7 100644
--- a/sound/firewire/amdtp-stream.h
+++ b/sound/firewire/amdtp-stream.h
@@ -190,6 +190,7 @@ struct amdtp_stream {
struct snd_pcm_substream *pcm;
snd_pcm_uframes_t pcm_buffer_pointer;
unsigned int pcm_period_pointer;
+ unsigned int pcm_frame_multiplier;
// To start processing content of packets at the same cycle in several contexts for
// each direction.
@@ -216,7 +217,7 @@ int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit,
void amdtp_stream_destroy(struct amdtp_stream *s);
int amdtp_stream_set_parameters(struct amdtp_stream *s, unsigned int rate,
- unsigned int data_block_quadlets);
+ unsigned int data_block_quadlets, unsigned int pcm_frame_multiplier);
unsigned int amdtp_stream_get_max_payload(struct amdtp_stream *s);
void amdtp_stream_update(struct amdtp_stream *s);