summaryrefslogtreecommitdiffstats
path: root/sound/firewire
Commit message (Collapse)AuthorAgeFilesLines
...
* | ALSA: bebob: code refactoring for error path to start duplex streamTakashi Sakamoto2019-06-171-2/+0
| | | | | | | | | | | | | | This commit removes useless procedures to stop packet streaming. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: bebob: change the range of critical section for stream data in ↵Takashi Sakamoto2019-06-171-4/+5
| | | | | | | | | | | | | | | | | | PCM.hw_free callback The operation of duplex streams should be in critical section. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: bebob: code refactoring for callback function to rawmidi interfaceTakashi Sakamoto2019-06-171-41/+6
| | | | | | | | | | | | | | | | | | | | The pairs of rawmidi.hw_params callback functions and .hw_free callback functions for both direction have no differences. This commit unifies the pairs. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: bebob: code rafactoring for callback functions to PCM interfaceTakashi Sakamoto2019-06-171-48/+7
| | | | | | | | | | | | | | | | | | | | The pairs of pcm.hw_params callback functions and .hw_free callback functions for both direction have no differences. This commit unifies the pairs. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: dice: fix compiler warning due to returning uninitialized valueTakashi Sakamoto2019-06-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes the warning due to returning uninitialized value from start_streams() helper function. sound/firewire/dice/dice-stream.c: In function 'start_streams.isra.0': >> sound/firewire/dice/dice-stream.c:350:6: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized] int err; ^~~ Reported-by: kbuild test robot <lkp@intel.com> Fixes: 3cd2c2d780a2 ("ALSA: dice: reserve/release isochronous resources in pcm.hw_params/hw_free callbacks") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: oxfw: configure stream parameter in pcm.hw_params callbackTakashi Sakamoto2019-06-121-40/+57
| | | | | | | | | | | | | | | | | | | | | | | | This commit is a part of preparation to perform allocation/release of isochronous resources in pcm.hw_params/hw_free callbacks. This commit splits out an operation to configure stream parameters into pcm.hw_params callback. In pcm.prepare callback, establishing connections and start isochronous contexts. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: oxfw: configure packet format in pcm.hw_params callbackTakashi Sakamoto2019-06-124-29/+62
| | | | | | | | | | | | | | | | | | | | | | | | This commit is a part of preparation to perform allocation/release of isochronous resources in pcm.hw_params/hw_free callbacks. At present, several operations are done in pcm.prepare callback. To reduce load of the callback, This commit splits out an operation to set packet format in pcm.hw_params callback. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: oxfw: unify substreams counterTakashi Sakamoto2019-06-124-12/+11
| | | | | | | | | | | | | | | | In former commits, two isochronous contexts are handles at the same time. This commit unifies stream counters to obsolete them. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: oxfw: rename helper functions for duplex streamsTakashi Sakamoto2019-06-125-53/+58
| | | | | | | | | | | | | | | | | | | | | | | | In former commits, ALSA oxfw driver handles two isochronous contexts at the same time, except for some devices which supports one endpoint of isochronous packet stream. This commit renames some helper functions so that they handles duplex streams. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: oxfw: expand stop procedure for packet streamingTakashi Sakamoto2019-06-121-33/+35
| | | | | | | | | | | | | | | | The helper function stop packet streaming is not enough useful. This commit obsoletes it and expands its code. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: oxfw: break packet streaming at bus-reset handlerTakashi Sakamoto2019-06-121-10/+3
| | | | | | | | | | | | | | | | In most cases, recovery from bus reset is not successful. This commit aborts packet streaming in bus reset handler. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: oxfw: start duplex streams if supportedTakashi Sakamoto2019-06-121-53/+49
| | | | | | | | | | | | | | | | | | It's inconvenient to handle two isochronous context separately each other. This commit unifies the counters to handle the two at the same time. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: oxfw: set packet parameter according to current configurationTakashi Sakamoto2019-06-121-24/+24
| | | | | | | | | | | | | | | | | | After a call of pcm.hw_params, the state of target device is expected for applications. This commit retrieves the state and start packet streaming. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: oxfw: code refactoring for stop condition of packet streamingTakashi Sakamoto2019-06-121-5/+2
| | | | | | | | | | | | | | | | This commit unifies stop condition due to queueing error and unmatched state of the target device. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireworks: don't set XRUN in stop streamingTakashi Sakamoto2019-06-121-1/+0
| | | | | | | | | | | | | | | | When stopping packet streaming, no need to stop PCM substream with XRUN state. This commit suppresses it. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireworks: configure stream parameters in pcm.hw_params callbackTakashi Sakamoto2019-06-121-33/+49
| | | | | | | | | | | | | | | | | | | | | | | | This commit is a part of preparation to perform allocation/release of isochronous resources in pcm.hw_params/hw_free callbacks. This commit splits out an operation to configure stream parameters into pcm.hw_params callback. In pcm.prepare callback, establishing connections and start isochronous contexts. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireworks: configure sampling transfer frequency in pcm.hw_params callbackTakashi Sakamoto2019-06-124-32/+57
| | | | | | | | | | | | | | | | | | | | | | | | This commit is a part of preparation to perform allocation/release of isochronous resources in pcm.hw_params/hw_free callbacks. At present, several operations are done in pcm.prepare callback. To reduce load of the callback, This commit splits out an operation to set sampling transfer frequency in pcm.hw_params callback. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireworks: code refactoring for pcm.hw_params/hw_freeTakashi Sakamoto2019-06-121-39/+6
| | | | | | | | | | | | | | | | Two sets of callbacks for pcm.hw_params/hw_free but they have the same codes. This commit unifies each of the callbacks. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireworks: code refactoring for rawmidi.open/closeTakashi Sakamoto2019-06-121-39/+6
| | | | | | | | | | | | | | | | Two sets of callbacks for rawmidi.open/close but they have the same codes. This commit unifies each of the callbacks. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireworks: unify substream counterTakashi Sakamoto2019-06-124-27/+19
| | | | | | | | | | | | | | | | | | | | | | | | This commit is a part of preparation to perform allocation/release of isochronous resources in pcm.hw_params/hw_free callbacks. It's inconvenient to handle two isochronous context separately each other. This commit unifies the counters to handle the two at the same time. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: bebob: code refactoring to initialize/destroy stream dataTakashi Sakamoto2019-06-121-60/+61
| | | | | | | | | | | | | | | | This commit changes helper functions to initialize/destroy stream data so that it has an argument for direction. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: bebob: obsolete useless member of private structureTakashi Sakamoto2019-06-122-9/+0
| | | | | | | | | | | | | | | | The private structure of this driver has 'connected' member but nowadays it's useless. This commit removes it. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: bebob: don't set XRUN in stop streamingTakashi Sakamoto2019-06-121-3/+0
| | | | | | | | | | | | | | | | When stopping packet streaming, no need to stop PCM substream with XRUN state. This commit suppresses it. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: bebob: configure sampling transfer frequency in pcm.hw_params callbackTakashi Sakamoto2019-06-124-123/+136
| | | | | | | | | | | | | | | | | | | | | | | | This commit is a part of preparation to perform allocation/release of isochronous resources in pcm.hw_params/hw_free callbacks. At present, several operations are done in pcm.prepare callback. To reduce load of the callback, This commit splits out an operation to set sampling transfer frequency in pcm.hw_params callback. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: dice: code refactoring for pcm.hw_params/hw_free callbacksTakashi Sakamoto2019-06-111-47/+7
| | | | | | | | | | | | | | | | | | | | The pairs of pcm.hw_params callbacks and .hw_free callbacks for both direction have no differences. This commit unifies the pairs. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: dice: update isochronous resources when starting packet streaming ↵Takashi Sakamoto2019-06-111-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after bus-reset After bus reset, isochronous resource manager releases all of allocated isochronous resources. The nodes to transfer isochronous packet should request reallocation of the resources. However, between the bus-reset and invocation of 'struct fw_driver.update' handler, ALSA PCM application can detect this situation by XRUN because the target device cancelled to transmit packets once bus-reset occurs. Due to the above mechanism, ALSA fireface driver just stops packet streaming in the update handler, thus pcm.prepare handler should request the reallocation. This commit requests the reallocation in pcm.prepare callback when bus generation is changed. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: dice: reserve/release isochronous resources in pcm.hw_params/hw_free ↵Takashi Sakamoto2019-06-114-115/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | callbacks Once allocated, isochronous resources are available for packet streaming, even if the streaming is cancelled. For this reason, current implementation handles allocation of the resources and starting packet streaming at the same time. However, this brings complicated procedure to start packet streaming. This commit separates the allocation and starting. The allocation is done in pcm.hw_params callback and available till pcm.hw_free callback. Even if any XRUN occurs, pcm.prepare callback is done to restart packet streaming without releasing/allocating the resources. There are two points to stop packet streaming; in pcm.hw_params and pcm.prepare callbacks. The former point is a case that packet streaming is already started for any MIDI substream then packet streaming is requested with different sampling transfer frequency for any PCM substream. The latter point is cases of any XRUN or packet queueing error. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: dice: code refactoring to keep isochronous resourcesTakashi Sakamoto2019-06-111-59/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit is a part of preparation to perform allocation/release of isochronous resources in pcm.hw_params/hw_free callbacks. This commit adds a helper function to allocate isochronous resources, separated from operations to start packet streaming, I note that some dice-based devices have two pair of endpoints for isochronous packet straeming. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: dice: code refactoring to stop packet streamingTakashi Sakamoto2019-06-111-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | This commit is a part of preparation to perform allocation/release of isochronous resources in pcm.hw_params/hw_free callbacks. There're three points to finish packet streaming but no helper functions for common operations for it. This commit adds a helper function for operations to finish packet streaming. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: firewire-digi00x: code refactoring for pcm.hw_params/hw_free callbacksTakashi Sakamoto2019-06-111-48/+7
| | | | | | | | | | | | | | | | | | | | The pairs of pcm.hw_params callbacks and .hw_free callbacks for both direction have no differences. This commit unifies the pairs. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: firewire-digi00x: update isochronous resources when starting packet ↵Takashi Sakamoto2019-06-111-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | streaming after bus-reset After bus reset, isochronous resource manager releases all of allocated isochronous resources. The nodes to transfer isochronous packet should request reallocation of the resources. However, between the bus-reset and invocation of 'struct fw_driver.update' handler, ALSA PCM application can detect this situation by XRUN because the target device cancelled to transmit packets once bus-reset occurs. Due to the above mechanism, ALSA fireface driver just stops packet streaming in the update handler, thus pcm.prepare handler should request the reallocation. This commit requests the reallocation in pcm.prepare callback when bus generation is changed. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: firewire-digi00x: reserve/release isochronous resources in ↵Takashi Sakamoto2019-06-114-51/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pcm.hw_params/hw_free callbacks Once allocated, isochronous resources are available for packet streaming, even if the streaming is cancelled. For this reason, current implementation handles allocation of the resources and starting packet streaming at the same time. However, this brings complicated procedure to start packet streaming. This commit separates the allocation and starting. The allocation is done in pcm.hw_params callback and available till pcm.hw_free callback. Even if any XRUN occurs, pcm.prepare callback is done to restart packet streaming without releasing/allocating the resources. There are two points to stop packet streaming; in pcm.hw_params and pcm.prepare callbacks. The former point is a case that packet streaming is already started for any MIDI substream then packet streaming is requested with different sampling transfer frequency for any PCM substream. The latter point is cases of any XRUN or packet queueing error. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: firewire-digi00x: code refactoring to keep isochronous resourcesTakashi Sakamoto2019-06-111-24/+18
| | | | | | | | | | | | | | | | | | | | | | | | This commit is a part of preparation to perform allocation/release of isochronous resources in pcm.hw_params/hw_free callbacks. All of models in Digidesign Digi00x family have the same formation of data channels in isochronous packet for both directions. This commit simplifies allocation of isochronous resources in this point. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: firewire-digi00x: simplify error path to begin streaming sessionTakashi Sakamoto2019-06-111-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit is a part of preparation to perform allocation/release of isochronous resources in pcm.hw_params/hw_free callbacks. The caller of begin_session() calls finish_session() in its error path, thus no need to call finish_session() in error path of begin_session(). This commit simplifies error path of begin_session(). Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: firewire-digi00x: code refactoring to finish streaming sessionTakashi Sakamoto2019-06-111-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | This commit is a part of preparation to perform allocation/release of isochronous resources in pcm.hw_params/hw_free callbacks. The operation to finish packet streaming corresponds to stopping isochronous contexts. This commit applies code refactoring to move codes to stop into a helper function to finish the session. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: firewire-digi00x: refactoring to move timing of registration for ↵Takashi Sakamoto2019-06-111-22/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | isochronous channel This commit is a part of preparation to perform allocation/release of isochronous resources in pcm.hw_params/hw_free callbacks. The registration of isochronous channels is done just after allocation of isochronous resources. This commit separates the registration just before starting packet streaming. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireface: code refactoring for pcm.hw_params/hw_free callbacksTakashi Sakamoto2019-06-111-48/+7
| | | | | | | | | | | | | | | | | | | | The pairs of pcm.hw_params callbacks and .hw_free callbacks for both direction have no differences. This commit unifies the pairs. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireface: minor code refactoring to finish streaming sessionTakashi Sakamoto2019-06-111-17/+6
| | | | | | | | | | | | | | | | | | | | | | The operation to finish packet streaming corresponds to stopping isochronous contexts. This commit applies code refactoring to move codes to stop into a helper function to finish the session. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireface: update isochronous resources when starting packet streaming ↵Takashi Sakamoto2019-06-113-14/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after bus-reset After bus reset, isochronous resource manager releases all of allocated isochronous resources. The nodes to restart packet streaming should request reallocation of the resources. However, between the bus-reset and invocation of 'struct fw_driver.update' handler, ALSA PCM application can detect this situation by XRUN because the target device cancelled to transmit packets once bus-reset occurs. Due to the above mechanism, ALSA fireface driver just stops packet streaming in the update handler, thus pcm.prepare handler should request the reallocation. This commit requests the reallocation in pcm.prepare callback when bus generation is changed. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireface: reserve/release isochronous resources in ↵Takashi Sakamoto2019-06-113-30/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pcm.hw_params/hw_free callbacks Once allocated, isochronous resources are available for packet streaming, even if the streaming is cancelled. For this reason, current implementation handles allocation of the resources and starting packet streaming at the same time. However, this brings complicated procedure to start packet streaming. This commit separates the allocation and starting. The allocation is done in pcm.hw_params callback and available till pcm.hw_free callback. Even if any XRUN occurs, pcm.prepare callback is done to restart packet streaming for allocated the resources. There are two points to stop packet streaming; in pcm.hw_params and pcm.prepare callbacks. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireface: support allocate_resources operation in latter protocolTakashi Sakamoto2019-06-111-57/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is a part of preparation to perform allocation/release of isochronous channels in pcm.hw_params/hw_free callbacks. This commit implements allocate_resources callback for the protocol specific to latter models. The encoded values of constant table is split into several condition statements to separate the operation to configure sampling transfer frequency from the operation to configure the number of data channels in rx packet. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireface: support allocate_resources operation in ff400 protocolTakashi Sakamoto2019-06-111-20/+16
| | | | | | | | | | | | | | | | | | | | | | | | This commit is a part of preparation to perform allocation/release of isochronous channels in pcm.hw_params/hw_free callbacks. This commit implements allocate_resources callback for ff400 protocol. In this callback, sampling transfer frequency is configured to the device as well. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireface: support allocate_resources operation in ff800 protocolTakashi Sakamoto2019-06-111-24/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is a part of preparation to perform allocation/release of isochronous channels in pcm.hw_params/hw_free callbacks. This commit implements allocate_resources callback for ff800 protocol. As I noted in commit fc716397a5c7 ("ALSA: fireface: add support for packet streaming on Fireface 800"), this unit allocates isochronous resources for tx stream voluntarily. Therefore, this commit is to maintain isochronous rsources for rx stream. In the callback, sampling transfer frequency is configured to the device as well. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: fireface: add protocol-specific operation to allocate isochronous ↵Takashi Sakamoto2019-06-112-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | resources This commit is a part of preparation to perform allocation/release of isochronous channels in pcm.hw_params/hw_free callbacks. In ALSA fireface driver, the allocation of isochronous resources is programmed in each implementation of protocol. This commit adds protocol-specific operation for the allocation separated from the operation to begin session. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: firewire-tascam: code refactoring for pcm.hw_params/hw_free callbacksTakashi Sakamoto2019-06-111-48/+7
| | | | | | | | | | | | | | | | | | | | The pairs of pcm.hw_params callbacks and .hw_free callbacks for both direction have no differences. This commit unifies the pairs. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: firewire-tascam: minor code refactoring to finish streaming sessionTakashi Sakamoto2019-06-111-16/+5
| | | | | | | | | | | | | | | | | | | | | | The operation to finish packet streaming corresponds to stopping isochronous contexts. This commit applies code refactoring to move codes to stop into a helper function to finish the session. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: firewire-tascam: update isochronous resources when starting packet ↵Takashi Sakamoto2019-06-111-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | streaming after bus reset After bus reset, isochronous resource manager releases all of allocated isochronous resources. The nodes to restart packet streaming should request reallocation of the resources. However, between the bus-reset and invocation of 'struct fw_driver.update' handler, ALSA PCM application can detect this situation by XRUN because the target device cancelled to transmit packets once bus-reset occurs. Due to the above mechanism, ALSA firewire-tascam driver just stops packet streaming in the update handler, thus pcm.prepare handler should request the reallocation. This commit requests the reallocation in pcm.prepare callback when bus generation is changed. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: firewire-tascam: reserve/release isochronous resources in ↵Takashi Sakamoto2019-06-113-37/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pcm.hw_params/hw_free callbacks Once allocated, isochronous resources are available for packet streaming, even if the streaming is cancelled. For this reason, current implementation handles allocation of the resources and starting packet streaming at the same time. However, this brings complicated procedure to start packet streaming. This commit separates the allocation and starting. The allocation is done in pcm.hw_params callback and available till pcm.hw_free callback. Even if any XRUN occurs, pcm.prepare callback is done to restart packet streaming for allocated the resources. There are two points to stop packet streaming; in pcm.hw_params and pcm.prepare callbacks. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: firewire-tascam: code refactoring for release of isochronous resourcesTakashi Sakamoto2019-06-111-10/+8
| | | | | | | | | | | | | | | | | | | | | | This commit is a part of preparation to perform allocation/release of isochronous channels in pcm.hw_params/hw_free callbacks. This commit obsoletes a helper function to release isochronous resources for both direction. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: firewire-tascam: code refactoring for reservation of isochronous resourcesTakashi Sakamoto2019-06-111-22/+16
| | | | | | | | | | | | | | | | | | | | | | This commit is a part of preparation to perform allocation/release of isochronous channels in pcm.hw_params/hw_free callbacks. This commit applies minor code refactoring for a helper function to allocate isochronous resources. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>