History log of /openbmc/linux/sound/core/pcm_native.c (Results 426 – 450 of 640)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 82e7d501 11-Jun-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: pcm: probe events when parameters are changed actually

At present, trace events are probed even if corresponding parameter is
not actually changed. This is inconvenient.

T

ALSA: pcm: probe events when parameters are changed actually

At present, trace events are probed even if corresponding parameter is
not actually changed. This is inconvenient.

This commit improves the behaviour.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# f74ae15f 11-Jun-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: pcm: return error immediately for parameters handling

When refining mask/interval parameters, helper functions can return error
code. This error is not handled immediately. This se

ALSA: pcm: return error immediately for parameters handling

When refining mask/interval parameters, helper functions can return error
code. This error is not handled immediately. This seems to return
parameters to userspace applications in its meddle of processing.

However, in general, when receiving error from system calls, the
application might not handle argument buffer. It's reasonable to
judge the above design as superfluity.

This commit handles the error immediately.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# 7b8a54af 09-Jun-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: pcm: add tracepoints for final selection process of hardware parameters

Results of ioctl(2) with SNDRV_PCM_IOCTL_HW_REFINE and
SNDRV_PCM_IOCTL_HW_PARAMS are different, because the

ALSA: pcm: add tracepoints for final selection process of hardware parameters

Results of ioctl(2) with SNDRV_PCM_IOCTL_HW_REFINE and
SNDRV_PCM_IOCTL_HW_PARAMS are different, because the latter has single
value for several parameters; e.g. channels of PCM substream. Selection
of the single value is done independently of application of constraints.
It's helpful for developers to trace the selection process.

This commit adds tracepoints to snd_pcm_hw_params_choose() for the
purpose.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# 60f96aae 09-Jun-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: pcm: localize snd_pcm_hw_params_choose()

As of v4.12, snd_pcm_hw_params_choose() is just called in a process
context of ioctl(2) with SNDRV_PCM_IOCTL_HW_PARAMS. The function locate

ALSA: pcm: localize snd_pcm_hw_params_choose()

As of v4.12, snd_pcm_hw_params_choose() is just called in a process
context of ioctl(2) with SNDRV_PCM_IOCTL_HW_PARAMS. The function locates
in a different file, which has no tracepoints.

This commit moves the function to a file with the tracepoints for later
commit.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# 7802fb52 08-Jun-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: pcm: move fixup of info flag after selecting single parameters

When drivers register no flags about information of PCM hardware, ALSA
PCM core fixups it roughly. Currently, this op

ALSA: pcm: move fixup of info flag after selecting single parameters

When drivers register no flags about information of PCM hardware, ALSA
PCM core fixups it roughly. Currently, this operation places in a
function snd_pcm_hw_refine(). It can be moved to a function
fixup_unreferenced_params() because it doesn't affects operations
between these two functions.

This idea is better to bundle codes with similar purposes and this commit
achieves it.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# f9a076bf 08-Jun-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: pcm: calculate non-mask/non-interval parameters always when possible

A structure for parameters of PCM runtime has parameters which are
not classified as mask/interval type. They a

ALSA: pcm: calculate non-mask/non-interval parameters always when possible

A structure for parameters of PCM runtime has parameters which are
not classified as mask/interval type. They are decided only when
corresponding normal parameters have unique values.
* struct snd_pcm_hw_params.msbits
* struct snd_pcm_hw_params.rate_num
* struct snd_pcm_hw_params.rate_den
* struct snd_pcm_hw_params.fifo_size

Current implementation of hw_params ioctl sometimes doesn't decide these
parameters even if corresponding parameters are fixed, because these
parameters are evaluated before a call of snd_pcm_hw_params_choose().

This commit adds a helper function to process the parameters and call it
in proper positions.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# e02de47e 08-Jun-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: pcm: use helper functions to refer parameters as constants

To fixup some parameters, ALSA PCM core refers the other parameters as
constants. There're some macros for this purpose.

ALSA: pcm: use helper functions to refer parameters as constants

To fixup some parameters, ALSA PCM core refers the other parameters as
constants. There're some macros for this purpose.

This commit replaces codes with them.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# d81052f9 08-Jun-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: pcm: add comment about application of rule to PCM parameters

Drivers add rules of parameters to runtime of PCM substream, when
applications open ALSA PCM character device. When app

ALSA: pcm: add comment about application of rule to PCM parameters

Drivers add rules of parameters to runtime of PCM substream, when
applications open ALSA PCM character device. When applications call
ioctl(2) with SNDRV_PCM_IOCTL_HW_REFINE or SNDRV_PCM_IOCTL_HW_PARAMS, the
rules are applied to the parameters and return the result to user space.

The rule can have dependency between parameters. Additionally, it can have
condition flags about application of rules. Userspace applications can
indicate the flags to suppress change of parameters.

This commit attempts to describe the mechanism.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# b81e5ddb 08-Jun-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: pcm: use helper functions to check whether parameters are determined

A commit 8bea869c5e56 ("ALSA: PCM midlevel: improve fifo_size handling")
allows drivers to implement calculatio

ALSA: pcm: use helper functions to check whether parameters are determined

A commit 8bea869c5e56 ("ALSA: PCM midlevel: improve fifo_size handling")
allows drivers to implement calculation of fifo size in parameter
structure. This calculation runs only when two of the other parameters
have single value.

In ALSA PCM core, there're some helper functions for the case. This commit
applies the functions instead of value comparison.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# a1c06e39 08-Jun-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: pcm: adaption of code formatting

This commit modifies current for readability in below aspects:
- use bool type variable instead of int type variable assigned to 0/1
- move v

ALSA: pcm: adaption of code formatting

This commit modifies current for readability in below aspects:
- use bool type variable instead of int type variable assigned to 0/1
- move variable definition from loop to top of the function definition

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# d656b4a6 08-Jun-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: pcm: remove function local variable with alternative evaluation

A local variable is used to judge whether a parameter should be handled
due to reverse dependency of the other rules

ALSA: pcm: remove function local variable with alternative evaluation

A local variable is used to judge whether a parameter should be handled
due to reverse dependency of the other rules. However, this can be
obsoleted by check of a sentinel in dependency array.

This commit removes the local variable and check the sentinel to reduce
stack usage.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# 0d4e3999 08-Jun-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: pcm: use goto statement instead of while statement to reduce indentation

In a process to calculate parameters of PCM substream, application of all
rules is iterated several times t

ALSA: pcm: use goto statement instead of while statement to reduce indentation

In a process to calculate parameters of PCM substream, application of all
rules is iterated several times till parameter dependencies are satisfied.
In current implementation, two loops are used for the design, however this
brings two-level indentation and decline readability.

This commit attempts to reduce the indentation by using goto statement,
instead of outer while loop.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# 9cc07f55 08-Jun-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: pcm: add a helper function to apply parameter rules

Application of rules to parameters of PCM substream is done in a call of
snd_pcm_hw_refine(), while the function includes much c

ALSA: pcm: add a helper function to apply parameter rules

Application of rules to parameters of PCM substream is done in a call of
snd_pcm_hw_refine(), while the function includes much codes and is not
enough friendly to readers.

This commit splits the codes to a separated function so that readers can
get it easily. I leave desicion into compilers to merge the function into
its callee.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# 3432fa04 08-Jun-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: pcm: add a helper function to constrain interval-type parameters

Application of constraints to interval-type parameters for PCM substream
is done in a call of snd_pcm_hw_refine(),

ALSA: pcm: add a helper function to constrain interval-type parameters

Application of constraints to interval-type parameters for PCM substream
is done in a call of snd_pcm_hw_refine(), while the function includes
much codes and is not enough friendly to readers.

This commit splits the codes to a separated function so that readers can
get it easily. I leave desicion into compilers to merge the function into
its callee.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# 561e1cad 08-Jun-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: pcm: add a helper function to constrain mask-type parameters

Application of constraints to mask-type parameters for PCM substream is
done in a call of snd_pcm_hw_refine(), while th

ALSA: pcm: add a helper function to constrain mask-type parameters

Application of constraints to mask-type parameters for PCM substream is
done in a call of snd_pcm_hw_refine(), while the function includes much
codes and is not enough friendly to readers.

This commit splits the codes to a separated function so that readers can
get it easily. I leave desicion into compilers to merge the function into
its callee.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# c6706de0 06-Jun-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: pcm: obsolete RULES_DEBUG local macro

Added tracepoints obsoleted RULES_DEBUG local macro and relevant codes.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Sig

ALSA: pcm: obsolete RULES_DEBUG local macro

Added tracepoints obsoleted RULES_DEBUG local macro and relevant codes.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# 37567c55 06-Jun-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: pcm: enable parameter tracepoints only when CONFIG_SND_DEBUG is enabled

In a previous commit, tracepoints are added for PCM parameter processing.
As long as I know, this implementa

ALSA: pcm: enable parameter tracepoints only when CONFIG_SND_DEBUG is enabled

In a previous commit, tracepoints are added for PCM parameter processing.
As long as I know, this implementation increases size of relocatable
object by 35%. For vendors who are conscious of memory footprint, it
brings apparent disadvantage.

This commit utilizes CONFIG_SND_DEBUG configuration to enable/disable the
tracepoints.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# be4e31da 06-Jun-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: pcm: tracepoints for refining PCM parameters

When working for devices which support configurable modes for its data
transmission or which consists of several components, developers

ALSA: pcm: tracepoints for refining PCM parameters

When working for devices which support configurable modes for its data
transmission or which consists of several components, developers are
likely to use rules of parameters of PCM substream. However, there's no
infrastructure to assist their work.

In old days, ALSA PCM core got a local 'RULES_DEBUG' macro to debug
refinement of parameters for PCM substream. Although this is merely a
makeshift. With some modifications, we get the infrastructure.

This commit is for the purpose. Refinement of mask/interval type of
PCM parameters is probed as tracepoint events as 'hw_mask_param' and
'hw_interval_param' on existent 'snd_pcm' subsystem.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# 2c4842d3 25-May-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: pcm: add local header file for snd-pcm module

Several files are used to construct PCM core module, a.k.a snd-pcm.
Although available APIs are described in 'include/sound/pcm.h', so

ALSA: pcm: add local header file for snd-pcm module

Several files are used to construct PCM core module, a.k.a snd-pcm.
Although available APIs are described in 'include/sound/pcm.h', some of
them are not exported as symbols in kernel space. Such APIs are just for
module local usage.

This commit adds module local header file and move some function prototypes
into it so that scopes of them are controlled properly and developers
get no confusion from unavailable symbols.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# 9027c463 19-May-2017 Takashi Iwai <tiwai@suse.de>

ALSA: pcm: Call ack() whenever appl_ptr is updated

Although the ack callback is supposed to be called at each appl_ptr or
hw_ptr update, we missed a few opportunities: namely, forward, r

ALSA: pcm: Call ack() whenever appl_ptr is updated

Although the ack callback is supposed to be called at each appl_ptr or
hw_ptr update, we missed a few opportunities: namely, forward, rewind
and sync_ptr.

Formerly calling ack at rewind may have leaded to unexpected results
due to the forgotten negative appl_ptr update in indirect-PCM helper,
which is the major user of the PCM ack callback. But now we fixed
this oversights, thus we can call ack callback safely even at rewind
callback -- of course with the proper handling of the error from the
callback.

This patch adds the calls of ack callback in the places mentioned in
the above.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# c2c86a97 10-May-2017 Takashi Iwai <tiwai@suse.de>

ALSA: pcm: Remove set_fs() in PCM core code

PCM core code has a few usages of set_fs(), mostly for two codepaths:
- The DELAY ioctl call from pcm_compat.c
- The ioctl wrapper in kern

ALSA: pcm: Remove set_fs() in PCM core code

PCM core code has a few usages of set_fs(), mostly for two codepaths:
- The DELAY ioctl call from pcm_compat.c
- The ioctl wrapper in kernel context for PCM OSS and other

This patch removes the set_fs() usage in these places by a slight code
refactoring. For the former point, snd_pcm_delay() is changed to
return the value directly instead of putting the value to the given
address. Each caller stores the result in an appropriate manner.

For fixing the latter, snd_pcm_lib_kernel_ioctl() is changed to call
the functions directly as well. For achieving it, now the function
accepts only the limited set of ioctls that have been used, so far.
The primary user of this function is the PCM OSS layer, and the only
other user is USB UAC1 gadget driver. Both drivers don't need the
full set of ioctls.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# e0327a0f 19-May-2017 Takashi Iwai <tiwai@suse.de>

ALSA: pcm: Simplify forward/rewind codes

Factor out the common codes in snd_pcm_*_forward() and *_rewind()
functions to simplify the codes. No functional changes.

Reviewd-by: T

ALSA: pcm: Simplify forward/rewind codes

Factor out the common codes in snd_pcm_*_forward() and *_rewind()
functions to simplify the codes. No functional changes.

Reviewd-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# f839cc1c 19-May-2017 Takashi Iwai <tiwai@suse.de>

ALSA: pcm: Use a common helper for PCM state check and hwsync

The mostly same codes for checking the current PCM state and calling
hwsync are found in a few places. This patch simplifie

ALSA: pcm: Use a common helper for PCM state check and hwsync

The mostly same codes for checking the current PCM state and calling
hwsync are found in a few places. This patch simplifies them by
creating a common helper function.

It also fixes a couple of cases where we missed the proper state check
(e.g. PAUSED state wasn't handled in rewind and snd_pcm_hwsync()),
too.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# b55f9fdc 16-May-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: pcm: use helper function to refer parameter as read-only

ALSA pcm core has hw_param_interval_c() to pick up parameter with const
qualifier for safe programming.

This commi

ALSA: pcm: use helper function to refer parameter as read-only

ALSA pcm core has hw_param_interval_c() to pick up parameter with const
qualifier for safe programming.

This commit applies it to the cases.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


# 8b674308 16-May-2017 Takashi Sakamoto <o-takashi@sakamocchi.jp>

ALSA: pcm: add const qualifier for read-only table for sampling rate

There's a read-only table for each sampling rate, while it doesn't have
const qualifier and can be modified.

ALSA: pcm: add const qualifier for read-only table for sampling rate

There's a read-only table for each sampling rate, while it doesn't have
const qualifier and can be modified.

This commit add the qualifier. As a result, a symbol for the table
moves from .data section to .rodata.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

show more ...


1...<<11121314151617181920>>...26