alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [alsa-devel] [PATCH v2 0/8] ALSA: aloop: Support sound timer as clock source instead of jiffies
@ 2019-11-05 14:32 Andrew Gabbasov
  2019-11-05 14:32 ` [alsa-devel] [PATCH v2 1/8] ALSA: aloop: Describe units of variables Andrew Gabbasov
  0 siblings, 1 reply; 20+ messages in thread
From: Andrew Gabbasov @ 2019-11-05 14:32 UTC (permalink / raw)
  To: alsa-devel, linux-kernel, Jaroslav Kysela, Takashi Iwai,
	Timo Wischer, Andrew Gabbasov

This patch set is an updated version of patches by Timo Wischer:
https://mailman.alsa-project.org/pipermail/alsa-devel/2019-March/146871.html

This patch set is required for forwarding audio data between a HW sound
card and an aloop device without the usage of an asynchronous sample rate
converter.

Most of sound and timers related code is kept the same as in previous set.
The code, related to snd_pcm_link() functionality and its using for
timer source setting, is removed (as rejected earlier). The changes in this
update are mainly related to the parameters handling and some cleanup.

The timer source can be initially selected by "timer_source" kernel module
parameter. It is supposed to have the following format:
    [<pref>:](<card name>|<card idx>)[{.,}<dev idx>[{.,}<subdev idx>]]
For example: "hw:I82801AAICH.1.0", or "1.1", or just "I82801AAICH".
(Prefix is ignored, just allowed here to be able to use the strings,
the user got used to).
Although the parsing function recognizes both '.' and ',' as a separator,
module parameters handling routines use ',' to separate parameters for
different module instances (array elements), so we have to use '.'
to separate device and subdevice numbers from the card name or number
in module parameters.
Empty string indicates using jiffies as a timer source.

Besides "static" selection of timer source at module load time,
it is possible to dynamically change it via sound "info" interface
(using "/proc/asound/<card>/timer_source" file in read-write mode.
The contents of this file is used as a timer source string for
a particular loopback card, e.g. "hw:0,0,0" (and here ',' can be used
as a separator).

The timer source string value can be changed at any time, but it is
latched by PCM substream open callback "loopback_open()" (the first
one for a particular cable). At this point it is actually used,
that is the string is parsed, and the timer is looked up and opened.
This seems to be a good trade-off between flexibility of updates and
synchronizations or racing complexity.

The timer source is set for a loopback card (the same as initial setting
by module parameter), but every cable uses the value, current at the moment
of opening. Theoretically, it's possible to set the timer source for each
cable independently (via separate files), but it would be inconsistent
with the initial setting via module parameters on a per-card basis.


Andrew Gabbasov (1):
  ALSA: aloop: Support runtime change of snd_timer via info interface

Timo Wischer (7):
  ALSA: aloop: Describe units of variables
  ALSA: aloop: loopback_timer_start: Support return of error code
  ALSA: aloop: loopback_timer_stop: Support return of error code
  ALSA: aloop: Use callback functions for timer specific implementations
  ALSA: aloop: Rename all jiffies timer specific functions
  ALSA: aloop: Move CABLE_VALID_BOTH to the top of file
  ALSA: aloop: Support selection of snd_timer instead of jiffies

 sound/drivers/aloop.c | 656 +++++++++++++++++++++++++++++++++++++++---
 1 file changed, 621 insertions(+), 35 deletions(-)

-- 
2.21.0

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2019-11-11 11:19 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-05 14:32 [alsa-devel] [PATCH v2 0/8] ALSA: aloop: Support sound timer as clock source instead of jiffies Andrew Gabbasov
2019-11-05 14:32 ` [alsa-devel] [PATCH v2 1/8] ALSA: aloop: Describe units of variables Andrew Gabbasov
2019-11-05 14:32   ` [alsa-devel] [PATCH v2 2/8] ALSA: aloop: loopback_timer_start: Support return of error code Andrew Gabbasov
2019-11-05 14:32     ` [alsa-devel] [PATCH v2 3/8] ALSA: aloop: loopback_timer_stop: " Andrew Gabbasov
2019-11-05 14:32       ` [alsa-devel] [PATCH v2 4/8] ALSA: aloop: Use callback functions for timer specific implementations Andrew Gabbasov
2019-11-05 14:32         ` [alsa-devel] [PATCH v2 5/8] ALSA: aloop: Rename all jiffies timer specific functions Andrew Gabbasov
2019-11-05 14:32           ` [alsa-devel] [PATCH v2 6/8] ALSA: aloop: Move CABLE_VALID_BOTH to the top of file Andrew Gabbasov
2019-11-05 14:32             ` [alsa-devel] [PATCH v2 7/8] ALSA: aloop: Support selection of snd_timer instead of jiffies Andrew Gabbasov
2019-11-05 14:32               ` [alsa-devel] [PATCH v2 8/8] ALSA: aloop: Support runtime change of snd_timer via info interface Andrew Gabbasov
2019-11-07  8:06                 ` Takashi Iwai
2019-11-07 10:40                   ` Gabbasov, Andrew
2019-11-07 10:50                     ` Takashi Iwai
2019-11-06  0:43               ` [alsa-devel] [PATCH v2 7/8] ALSA: aloop: Support selection of snd_timer instead of jiffies kbuild test robot
2019-11-06 21:25               ` kbuild test robot
2019-11-07  8:05               ` Takashi Iwai
2019-11-08 18:09                 ` Andrew Gabbasov
2019-11-11 11:17                 ` Andrew Gabbasov
2019-11-06 15:51       ` [alsa-devel] [PATCH v2 3/8] ALSA: aloop: loopback_timer_stop: Support return of error code Takashi Iwai
2019-11-06 17:45         ` Andrew Gabbasov
2019-11-06 15:50     ` [alsa-devel] [PATCH v2 2/8] ALSA: aloop: loopback_timer_start: " Takashi Iwai

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).