mbox series

[00/15] ALSA: firewire-tascam/fireface: reserve/release isochronous resources in pcm.hw_params/hw_free callbacks

Message ID 20190602071259.21622-1-o-takashi@sakamocchi.jp (mailing list archive)
Headers show
Series ALSA: firewire-tascam/fireface: reserve/release isochronous resources in pcm.hw_params/hw_free callbacks | expand

Message

Takashi Sakamoto June 2, 2019, 7:12 a.m. UTC
Hi,

This patchset is a part of series of patches for all of drivers in
ALSA firewire stack to reserve/release isochronous resources in
pcm.hw_params/hw_free callbacks.

In current implementation, the resources are reserved at the same time
to start packet streaming, and released at the same time to stop packet
streaming. However, once allocated, the resources are available
independent of lifetime of packet streaming.

The isochronous resources are the resources of IEEE 1394 bus. On the
other side of view, it's a kind of resources of hardware to maintain
the bus (isochronous resource manager). For this kind of reservation and
release, hw_params and hw_free operations are suitable in ALSA PCM
interface.

Ideally, the operation to reserve/release isochronous resource should
be separated from the operation to start/stop packet streaming. However,
IEEE 1394 bus has reset event. Once reset occurs, isochronous resource
manager releases allocated resources. The resources should be
reallocated by requesters themselves. For this reason, in this patchset,
bus generation is checked before starting packet streaming. If
generation is updated, reallocation is requested to isochronous
resource manager, then packet streaming starts.

Takashi Sakamoto (15):
  ALSA: firewire-tascam: code refactoring for registration of
    isochronous channels
  ALSA: firewire-tascam: code refactoring for reservation of isochronous
    resources
  ALSA: firewire-tascam: code refactoring for release of isochronous
    resources
  ALSA: firewire-tascam: reserve/release isochronous resources in
    pcm.hw_params/hw_free callbacks
  ALSA: firewire-tascam: update isochronous resources when starting
    packet streaming after bus reset
  ALSA: firewire-tascam: minor code refactoring to finish streaming
    session
  ALSA: firewire-tascam: code refactoring for pcm.hw_params/hw_free
    callbacks
  ALSA: fireface: add protocol-specific operation to allocate
    isochronous resources
  ALSA: fireface: support allocate_resources operation in ff800 protocol
  ALSA: fireface: support allocate_resources operation in ff400 protocol
  ALSA: fireface: support allocate_resources operation in latter
    protocol
  ALSA: fireface: reserve/release isochronous resources in
    pcm.hw_params/hw_free callbacks
  ALSA: fireface: update isochronous resources when starting packet
    streaming after bus-reset
  ALSA: fireface: minor code refactoring to finish streaming session
  ALSA: fireface: code refactoring for pcm.hw_params/hw_free callbacks

 sound/firewire/fireface/ff-pcm.c             |  57 ++---
 sound/firewire/fireface/ff-protocol-former.c | 112 +++++-----
 sound/firewire/fireface/ff-protocol-latter.c | 114 +++++-----
 sound/firewire/fireface/ff-stream.c          |  85 ++++----
 sound/firewire/fireface/ff.h                 |   3 +
 sound/firewire/tascam/tascam-pcm.c           |  59 ++----
 sound/firewire/tascam/tascam-stream.c        | 209 ++++++++++---------
 sound/firewire/tascam/tascam.h               |   2 +
 8 files changed, 306 insertions(+), 335 deletions(-)

Comments

Takashi Iwai June 11, 2019, 9:37 a.m. UTC | #1
On Sun, 02 Jun 2019 09:12:44 +0200,
Takashi Sakamoto wrote:
> 
> Hi,
> 
> This patchset is a part of series of patches for all of drivers in
> ALSA firewire stack to reserve/release isochronous resources in
> pcm.hw_params/hw_free callbacks.
> 
> In current implementation, the resources are reserved at the same time
> to start packet streaming, and released at the same time to stop packet
> streaming. However, once allocated, the resources are available
> independent of lifetime of packet streaming.
> 
> The isochronous resources are the resources of IEEE 1394 bus. On the
> other side of view, it's a kind of resources of hardware to maintain
> the bus (isochronous resource manager). For this kind of reservation and
> release, hw_params and hw_free operations are suitable in ALSA PCM
> interface.
> 
> Ideally, the operation to reserve/release isochronous resource should
> be separated from the operation to start/stop packet streaming. However,
> IEEE 1394 bus has reset event. Once reset occurs, isochronous resource
> manager releases allocated resources. The resources should be
> reallocated by requesters themselves. For this reason, in this patchset,
> bus generation is checked before starting packet streaming. If
> generation is updated, reallocation is requested to isochronous
> resource manager, then packet streaming starts.
> 
> Takashi Sakamoto (15):
>   ALSA: firewire-tascam: code refactoring for registration of
>     isochronous channels
>   ALSA: firewire-tascam: code refactoring for reservation of isochronous
>     resources
>   ALSA: firewire-tascam: code refactoring for release of isochronous
>     resources
>   ALSA: firewire-tascam: reserve/release isochronous resources in
>     pcm.hw_params/hw_free callbacks
>   ALSA: firewire-tascam: update isochronous resources when starting
>     packet streaming after bus reset
>   ALSA: firewire-tascam: minor code refactoring to finish streaming
>     session
>   ALSA: firewire-tascam: code refactoring for pcm.hw_params/hw_free
>     callbacks
>   ALSA: fireface: add protocol-specific operation to allocate
>     isochronous resources
>   ALSA: fireface: support allocate_resources operation in ff800 protocol
>   ALSA: fireface: support allocate_resources operation in ff400 protocol
>   ALSA: fireface: support allocate_resources operation in latter
>     protocol
>   ALSA: fireface: reserve/release isochronous resources in
>     pcm.hw_params/hw_free callbacks
>   ALSA: fireface: update isochronous resources when starting packet
>     streaming after bus-reset
>   ALSA: fireface: minor code refactoring to finish streaming session
>   ALSA: fireface: code refactoring for pcm.hw_params/hw_free callbacks

Applied all 15 patches now.  Thanks.


Takashi
Takashi Sakamoto June 11, 2019, 9:59 a.m. UTC | #2
On Tue, Jun 11, 2019 at 11:37:25AM +0200, Takashi Iwai wrote:
> On Sun, 02 Jun 2019 09:12:44 +0200,
> Takashi Sakamoto wrote:
> > 
> > Hi,
> > 
> > This patchset is a part of series of patches for all of drivers in
> > ALSA firewire stack to reserve/release isochronous resources in
> > pcm.hw_params/hw_free callbacks.
> > 
> > In current implementation, the resources are reserved at the same time
> > to start packet streaming, and released at the same time to stop packet
> > streaming. However, once allocated, the resources are available
> > independent of lifetime of packet streaming.
> > 
> > The isochronous resources are the resources of IEEE 1394 bus. On the
> > other side of view, it's a kind of resources of hardware to maintain
> > the bus (isochronous resource manager). For this kind of reservation and
> > release, hw_params and hw_free operations are suitable in ALSA PCM
> > interface.
> > 
> > Ideally, the operation to reserve/release isochronous resource should
> > be separated from the operation to start/stop packet streaming. However,
> > IEEE 1394 bus has reset event. Once reset occurs, isochronous resource
> > manager releases allocated resources. The resources should be
> > reallocated by requesters themselves. For this reason, in this patchset,
> > bus generation is checked before starting packet streaming. If
> > generation is updated, reallocation is requested to isochronous
> > resource manager, then packet streaming starts.
> > 
> > Takashi Sakamoto (15):
> >   ALSA: firewire-tascam: code refactoring for registration of
> >     isochronous channels
> >   ALSA: firewire-tascam: code refactoring for reservation of isochronous
> >     resources
> >   ALSA: firewire-tascam: code refactoring for release of isochronous
> >     resources
> >   ALSA: firewire-tascam: reserve/release isochronous resources in
> >     pcm.hw_params/hw_free callbacks
> >   ALSA: firewire-tascam: update isochronous resources when starting
> >     packet streaming after bus reset
> >   ALSA: firewire-tascam: minor code refactoring to finish streaming
> >     session
> >   ALSA: firewire-tascam: code refactoring for pcm.hw_params/hw_free
> >     callbacks
> >   ALSA: fireface: add protocol-specific operation to allocate
> >     isochronous resources
> >   ALSA: fireface: support allocate_resources operation in ff800 protocol
> >   ALSA: fireface: support allocate_resources operation in ff400 protocol
> >   ALSA: fireface: support allocate_resources operation in latter
> >     protocol
> >   ALSA: fireface: reserve/release isochronous resources in
> >     pcm.hw_params/hw_free callbacks
> >   ALSA: fireface: update isochronous resources when starting packet
> >     streaming after bus-reset
> >   ALSA: fireface: minor code refactoring to finish streaming session
> >   ALSA: fireface: code refactoring for pcm.hw_params/hw_free callbacks
> 
> Applied all 15 patches now.  Thanks.

Welcome back ;)

I've already prepared similar patchsets for the other drivers in ALSA
firewire stack. You'll receive the patchset several times in this week.
I'm happy if you review and apply them.


Thanks

Takashi Sakamoto