alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Tsoy <alexander@tsoy.me>
To: Takashi Iwai <tiwai@suse.de>,
	Robert Giaraffa <Robert.Giaraffa@silabs.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	Daniel Mack <daniel@zonque.org>
Subject: Re: [alsa-devel] [EXT] Re: Simultaneous play/record on implicit feedback device causes 'endpoint in use' error
Date: Wed, 15 Jan 2020 18:33:40 +0300	[thread overview]
Message-ID: <9a0016059514fec8b8ae0e179c032cb2485df04d.camel@tsoy.me> (raw)
In-Reply-To: <s5hzhurfp5w.wl-tiwai@suse.de>

В Пт, 02/11/2018 в 16:57 +0100, Takashi Iwai пишет:
> On Wed, 31 Oct 2018 20:45:07 +0100,
> Robert Giaraffa wrote:
> > Thank you very much for your prompt response.
> > 
> > I tested the CP2615 and Fast Track Ultra by running aplay and
> > arecord
> > sequentially on my RPi2 v4.14.72 (with patched snd-usb-audio.ko
> > that includes
> > implicit feedback quirk for CP2615).  Although there were minor
> > differences in
> > the system logs for the two devices (e.g. ‘cannot submit urb’), but
> > otherwise
> > both devices behaved the same: whichever operation is started last
> > resulted in
> > the 'Endpoint already in use' error, regardless of
> > sequence.  Detailed info
> > below:
> 
> OK, so we obviously don't support the full duplex in this mode.
> 
> As a first step, could you try the simple patch below, and test in a
> sequence record -> playback?  At least it should skip the check, and
> proceed further.
> 
> 
> thanks,
> 
> Takashi
> 
> --- a/sound/usb/pcm.c
> +++ b/sound/usb/pcm.c
> @@ -639,6 +639,10 @@ static int configure_sync_endpoint(struct
> snd_usb_substream *subs)
>  						   subs->cur_audiofmt,
>  						   NULL);
>  
> +	if (subs->sync_endpoint->type == SND_USB_ENDPOINT_TYPE_DATA &&
> +	    subs->sync_endpoint->use_count)
> +		return 0;
> +
>  	/* Try to find the best matching audioformat. */
>  	list_for_each_entry(fp, &sync_subs->fmt_list, list) {
>  		int score = match_endpoint_audioformats(subs,

Well, this works... sort of:

[  107.368218] usb 5-1: setting usb interface 2:1
[  107.368225] usb 5-1: Creating new capture data endpoint #81
[  107.834139] usb 5-1: Setting params for ep #81 (type 0, 12 urbs),
ret=0
[  107.834272] usb 5-1: Starting data EP @00000000a802b8ef
[  110.296773] usb 5-1: setting usb interface 1:1
[  110.296779] usb 5-1: Creating new playback data endpoint #1
[  110.296811] usb 5-1: Re-using EP 81 in iface 2,1 @00000000a802b8ef
[  110.298381] usb 5-1: Setting params for ep #1 (type 0, 12 urbs),
ret=0
[  110.298385] usb 5-1: Starting data EP @00000000b2e4f53f
[  110.300585] usb 5-1: Starting sync EP @00000000a802b8ef


but aplay aborts after several seconds:

$ LANG=C aplay -c 4 -r 48000 -f S32_LE -D hw:M4,0 test48000.wav 
Playing WAVE 'test48000.wav' : Signed 32 bit Little Endian, Rate 48000
Hz, Channels 4
aplay: pcm_write:2053: write error: Input/output error



And an interesting note: jack is the only app that can use the card
with implicit feedback in full duplex mode even without that patch.


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

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

      reply	other threads:[~2020-01-15 15:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-30 23:15 Simultaneous play/record on implicit feedback device causes 'endpoint in use' error Robert Giaraffa
2018-10-31 11:57 ` Takashi Iwai
2018-10-31 19:45   ` [EXT] " Robert Giaraffa
2018-11-02 15:57     ` Takashi Iwai
2020-01-15 15:33       ` Alexander Tsoy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9a0016059514fec8b8ae0e179c032cb2485df04d.camel@tsoy.me \
    --to=alexander@tsoy.me \
    --cc=Robert.Giaraffa@silabs.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=daniel@zonque.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).