All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dr Nicholas J Bailey <nicholas.bailey@glasgow.ac.uk>
To: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Cc: "tiwai@suse.de" <tiwai@suse.de>, Daniel Mack <zonque@gmail.com>,
	jennifer.macritchie@conservatorio.ch, graham@n-ism.org,
	"guido.aulisi@gmail.com" <guido.aulisi@gmail.com>
Subject: Re: [PATCH v2] ALSA: snd-usb-usx2y: remove bogus frame checks -- SUCCESS
Date: Thu, 3 Oct 2013 11:25:03 +0100	[thread overview]
Message-ID: <1647369.qtCsvN3L35@arial> (raw)
In-Reply-To: <1380728990-8443-1-git-send-email-zonque@gmail.com>

I applied the patch by hand to my current source tree (3.10.11) and compiled 
the kernel from scratch.

I plugged a MIDI cable between midi in and out on the TASCAM US-122. Using 
QJackCtl, I connected the US-122's MIDI out to fluidsynth, and used amidiplay 
to send play a MIDI file to the US-122.

While the MIDI was playing, I used Audacity to record the audio via the 
US-122's mic inputs holding the mic close to the speakers. After about 10 
seconds, I rewound audacity and hit record again so that it was both playing 
and recording through the US-122 while the US-122 was also routing MIDI.

This appears to work fine (at 44100Hz sampling; I've not tried any others), and 
I reckon this is a pretty severe test.

Thank you for pushing this patch which seems to resolve the original issue. 
This will be particularly appreciated by many because the US-122, no longer 
supported for Windows I believe, is currently available on eBay for about £30 
in the UK, and represents an inexpensive way for Linux users to make 
reasonable quality recordings from microphones needing a phantom power source.


On Wednesday 02 October 2013 16:49:50 Daniel Mack wrote:
> The frame check in i_usX2Y_urb_complete() and
> i_usX2Y_usbpcm_urb_complete() is bogus and produces false positives as
> described in this LAU thread:
> 
>   http://linuxaudio.org/mailarchive/lau/2013/5/20/200177
> 
> This patch removes the check code entirely.
> 
> Cc: fzu@wemgehoertderstaat.de
> Reported-by: Dr Nicholas J Bailey <nicholas.bailey@glasgow.ac.uk>
> Suggested-by: Takashi Iwai <tiwai@suse.de>
> Signed-off-by: Daniel Mack <zonque@gmail.com>
> ---
>  sound/usb/usx2y/usbusx2yaudio.c | 22 +++-------------------
>  sound/usb/usx2y/usx2yhwdeppcm.c |  7 +------
>  2 files changed, 4 insertions(+), 25 deletions(-)
> 
> diff --git a/sound/usb/usx2y/usbusx2yaudio.c
> b/sound/usb/usx2y/usbusx2yaudio.c index 63fb521..6234a51 100644
> --- a/sound/usb/usx2y/usbusx2yaudio.c
> +++ b/sound/usb/usx2y/usbusx2yaudio.c
> @@ -299,19 +299,6 @@ static void usX2Y_error_urb_status(struct usX2Ydev
> *usX2Y, usX2Y_clients_stop(usX2Y);
>  }
> 
> -static void usX2Y_error_sequence(struct usX2Ydev *usX2Y,
> -				 struct snd_usX2Y_substream *subs, struct urb *urb)
> -{
> -	snd_printk(KERN_ERR
> -"Sequence Error!(hcd_frame=%i ep=%i%s;wait=%i,frame=%i).\n"
> -"Most probably some urb of usb-frame %i is still missing.\n"
> -"Cause could be too long delays in usb-hcd interrupt handling.\n",
> -		   usb_get_current_frame_number(usX2Y->dev),
> -		   subs->endpoint, usb_pipein(urb->pipe) ? "in" : "out",
> -		   usX2Y->wait_iso_frame, urb->start_frame, usX2Y->wait_iso_frame);
> -	usX2Y_clients_stop(usX2Y);
> -}
> -
>  static void i_usX2Y_urb_complete(struct urb *urb)
>  {
>  	struct snd_usX2Y_substream *subs = urb->context;
> @@ -328,12 +315,9 @@ static void i_usX2Y_urb_complete(struct urb *urb)
>  		usX2Y_error_urb_status(usX2Y, subs, urb);
>  		return;
>  	}
> -	if (likely((urb->start_frame & 0xFFFF) == (usX2Y->wait_iso_frame &
> 0xFFFF))) -		subs->completed_urb = urb;
> -	else {
> -		usX2Y_error_sequence(usX2Y, subs, urb);
> -		return;
> -	}
> +
> +	subs->completed_urb = urb;
> +
>  	{
>  		struct snd_usX2Y_substream *capsubs =
> usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE], *playbacksubs =
> usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK];
> diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c
> b/sound/usb/usx2y/usx2yhwdeppcm.c index f2a1acd..814d0e8 100644
> --- a/sound/usb/usx2y/usx2yhwdeppcm.c
> +++ b/sound/usb/usx2y/usx2yhwdeppcm.c
> @@ -244,13 +244,8 @@ static void i_usX2Y_usbpcm_urb_complete(struct urb
> *urb) usX2Y_error_urb_status(usX2Y, subs, urb);
>  		return;
>  	}
> -	if (likely((urb->start_frame & 0xFFFF) == (usX2Y->wait_iso_frame &
> 0xFFFF))) -		subs->completed_urb = urb;
> -	else {
> -		usX2Y_error_sequence(usX2Y, subs, urb);
> -		return;
> -	}
> 
> +	subs->completed_urb = urb;
>  	capsubs = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE];
>  	capsubs2 = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2];
>  	playbacksubs = usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK];

  reply	other threads:[~2013-10-03 10:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-02 15:49 [PATCH v2] ALSA: snd-usb-usx2y: remove bogus frame checks Daniel Mack
2013-10-03 10:25 ` Dr Nicholas J Bailey [this message]
2013-10-07  7:35   ` [PATCH v2] ALSA: snd-usb-usx2y: remove bogus frame checks -- SUCCESS Takashi Iwai
2013-10-06  8:29 ` [PATCH v2] ALSA: snd-usb-usx2y: remove bogus frame checks Guido Aulisi
2013-10-07  7:41   ` Takashi Iwai
2013-10-07 14:58   ` Dr Nicholas J Bailey
2013-10-07 15:11     ` Daniel Mack
2013-10-07 15:35       ` Takashi Iwai
2013-10-07 15:34         ` Daniel Mack
2013-10-07 16:20           ` Dr Nicholas J Bailey
2013-10-07 16:31           ` Dr Nicholas J Bailey

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=1647369.qtCsvN3L35@arial \
    --to=nicholas.bailey@glasgow.ac.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=graham@n-ism.org \
    --cc=guido.aulisi@gmail.com \
    --cc=jennifer.macritchie@conservatorio.ch \
    --cc=tiwai@suse.de \
    --cc=zonque@gmail.com \
    /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 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.