All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 0/9] ALSA: usb-audio: fix playback/capture concurrent usage
@ 2013-08-18 20:22 Eldad Zack
  2013-08-18 20:22 ` [PATCH RFC 1/9] ALSA: usb-audio: remove unused parameter from sync_ep_set_params Eldad Zack
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Eldad Zack @ 2013-08-18 20:22 UTC (permalink / raw)
  To: Clemens Ladisch, Daniel Mack, Takashi Iwai; +Cc: alsa-devel, Eldad Zack

Hi,

This patch series attempts to fix a long starting problem with the concurrent
usage of playback and capture on implicit feedback devices.

As Clemens found out, when implicit feedback is used, playback and capture
cannot be used in the same time - unless started at the same time (e.g., with
jack).
While a substream is active, attempting to start a substream in the opposite
direction will fail and also (on some devices?) cause the currently active stream
to stop.

There are multiple issues that contribute to this:

 1. URBs are unconditionally deactivated in hw_free. On implicit feedback devices,
    the sync_endpoint (= data_endpoint of the capture) will be deactivated here.
    Fixed in patch #4.

 2. Changing the alternate settings of an interface might break currently running
    streams. This happens on my device, but I suspect other devices too.
    Fixed in patch #7.

 3. The endpoint use_count has a subtle issue (see patch #9). This causes jack
    to work fine, while using two separate programs (most probably) fails.
    In short: set_format is called from hw_params, but use_count is incremented
    only later (prepare or trigger).

 4. Concurrent usage should be allowed but only if the hw_params match up (patch #8)

One problem with this series is that I query the device for the altsettting.
This might not be reliable for all devices, so do I plan to remove this.
Of course, I've only tested this on my device, but it seems to work good and
I couldn't break it so far, so hopefully I got this right.

Can someone give it a try on other devices (also on non-implicit-feedback)?

Cheers,
Eldad


Eldad Zack (9):
  ALSA: usb-audio: remove unused parameter from sync_ep_set_params
  ALSA: usb-audio: remove deactivate_endpoints()
  ALSA: usb-audio: prevent NULL dereference on stop trigger
  ALSA: usb-audio: don't deactivate URBs on in-use EP
  ALSA: usb-audio: void return type of snd_usb_endpoint_deactivate()
  ALSA: usb-audio: clear SUBSTREAM_FLAG_SYNC_EP_STARTED on error
  ALSA: usb-audio: conditional interface altsetting
  ALSA: usb-audio: conditional concurrent usage of endpoint
  ALSA: usb-audio: correct ep use_count semantics (add set_param flag)

 sound/usb/card.h     |   1 +
 sound/usb/endpoint.c |  65 +++++++++++++++------
 sound/usb/endpoint.h |  11 +++-
 sound/usb/pcm.c      | 155 +++++++++++++++++++++++++++++++++++++++------------
 4 files changed, 176 insertions(+), 56 deletions(-)

-- 
1.8.1.5

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

end of thread, other threads:[~2013-08-19 20:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-18 20:22 [PATCH RFC 0/9] ALSA: usb-audio: fix playback/capture concurrent usage Eldad Zack
2013-08-18 20:22 ` [PATCH RFC 1/9] ALSA: usb-audio: remove unused parameter from sync_ep_set_params Eldad Zack
2013-08-18 20:22 ` [PATCH RFC 2/9] ALSA: usb-audio: remove deactivate_endpoints() Eldad Zack
2013-08-18 20:22 ` [PATCH RFC 3/9] ALSA: usb-audio: prevent NULL dereference on stop trigger Eldad Zack
2013-08-18 20:22 ` [PATCH RFC 4/9] ALSA: usb-audio: don't deactivate URBs on in-use EP Eldad Zack
2013-08-18 20:22 ` [PATCH RFC 5/9] ALSA: usb-audio: void return type of snd_usb_endpoint_deactivate() Eldad Zack
2013-08-18 20:22 ` [PATCH RFC 6/9] ALSA: usb-audio: clear SUBSTREAM_FLAG_SYNC_EP_STARTED on error Eldad Zack
2013-08-18 20:22 ` [PATCH RFC 7/9] ALSA: usb-audio: conditional interface altsetting Eldad Zack
2013-08-19 10:08   ` Clemens Ladisch
2013-08-19 20:13     ` Eldad Zack
2013-08-18 20:25 ` [PATCH RFC 8/9] ALSA: usb-audio: conditional concurrent usage of endpoint Eldad Zack
2013-08-18 20:25   ` [PATCH RFC 9/9] ALSA: usb-audio: correct ep use_count semantics (add set_param flag) Eldad Zack

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.