public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* Probably strange bug with usb radio-mr800
@ 2009-05-27 17:51 Alexey Klimov
  2009-06-04 22:43 ` Alexey Klimov
  0 siblings, 1 reply; 7+ messages in thread
From: Alexey Klimov @ 2009-05-27 17:51 UTC (permalink / raw)
  To: Linux Media, linux-usb; +Cc: Douglas Schilling Landgraf, Alexey Klimov

Hello,

Doing some improvements in media/radio/radio-mr800.c i see very
strange situation.
I made simple patch that removed usb_amradio_open function. There is
no need in this function (no need to start/set frequency radio in open
procedure, and also removed lock/unlock_kernel() calls).
Here is this patch:

diff -r a344b328a34b linux/drivers/media/radio/radio-mr800.c
--- a/linux/drivers/media/radio/radio-mr800.c	Wed May 27 21:21:36 2009 +0400
+++ b/linux/drivers/media/radio/radio-mr800.c	Wed May 27 21:25:41 2009 +0400
@@ -119,7 +119,6 @@
 static int usb_amradio_probe(struct usb_interface *intf,
 			     const struct usb_device_id *id);
 static void usb_amradio_disconnect(struct usb_interface *intf);
-static int usb_amradio_open(struct file *file);
 static int usb_amradio_close(struct file *file);
 static int usb_amradio_suspend(struct usb_interface *intf,
 				pm_message_t message);
@@ -533,40 +532,6 @@
 	return 0;
 }

-/* open device - amradio_start() and amradio_setfreq() */
-static int usb_amradio_open(struct file *file)
-{
-	struct amradio_device *radio = video_get_drvdata(video_devdata(file));
-	int retval;
-
-	lock_kernel();
-
-	radio->users = 1;
-	radio->muted = 1;
-
-	retval = amradio_set_mute(radio, AMRADIO_START);
-	if (retval < 0) {
-		amradio_dev_warn(&radio->videodev->dev,
-			"radio did not start up properly\n");
-		radio->users = 0;
-		unlock_kernel();
-		return -EIO;
-	}
-
-	retval = amradio_set_stereo(radio, WANT_STEREO);
-	if (retval < 0)
-		amradio_dev_warn(&radio->videodev->dev,
-			"set stereo failed\n");
-
-	retval = amradio_setfreq(radio, radio->curfreq);
-	if (retval < 0)
-		amradio_dev_warn(&radio->videodev->dev,
-			"set frequency failed\n");
-
-	unlock_kernel();
-	return 0;
-}
-
 /*close device */
 static int usb_amradio_close(struct file *file)
 {
@@ -623,7 +588,6 @@
 /* File system interface */
 static const struct v4l2_file_operations usb_amradio_fops = {
 	.owner		= THIS_MODULE,
-	.open		= usb_amradio_open,
 	.release	= usb_amradio_close,
 	.ioctl		= video_ioctl2,
 };

Then i test it. I have two machines: pentium-m and athlon 64 X2 dual
core. Kernel is 2.6.30-rc7 on both machines.
After patch such tools like fmtools, gnomeradio, kradio works fine
with radio. But mplayer didn't.

On 64bit machine mplayer didn't start radio. I ask usbmon to help me
and here is messages from usbmon:

cat /sys/kernel/debug/usbmon/2u
ffff880022e380c0 1662784522 S Io:2:003:2 -115:64 8 = 0055aa00 ab010000
(this message stops radio)
ffff880022e380c0 1662799160 C Io:2:003:2 0:64 8 >
ffff880022e380c0 1662799273 S Io:2:003:2 -115:64 8 = 0055aa00 ae000000
(this ask radio to have stereo signal)
ffff880022e380c0 1662831161 C Io:2:003:2 0:64 8 >
ffff880022e380c0 1662831439 S Io:2:003:2 -115:64 8 = 0055aa03 a4000008
(this and next message set frequency)
ffff880022e380c0 1662863161 C Io:2:003:2 0:64 8 >
ffff880022e380c0 1662863233 S Io:2:003:2 -115:64 8 = 1dd00100 00000000
ffff880022e380c0 1662895155 C Io:2:003:2 0:64 8 >
ffff880022e380c0 1662895190 S Io:2:003:2 -115:64 8 = 0055aa00 ab000000
(this message starts radio)
ffff880022e380c0 1662927156 C Io:2:003:2 0:64 8 >

Well, there is no sound from usb device after that.

On 32bit machine mplayer starts radio fine and works ok. Usbmon shows
me the same messages:

tux ~ # cat /sys/kernel/debug/usbmon/0u
f6530900 2647820070 S Io:2:002:2 -115:64 8 = 0055aa00 ab010000
f6530900 2647859740 C Io:2:002:2 0:64 8 >
f6530900 2647859825 S Io:2:002:2 -115:64 8 = 0055aa00 ae000000
f6530900 2647923747 C Io:2:002:2 0:64 8 >
f6530900 2647923942 S Io:2:002:2 -115:64 8 = 0055aa03 a4000008
f6530900 2647987749 C Io:2:002:2 0:64 8 >
f6530900 2647987766 S Io:2:002:2 -115:64 8 = 1dcf0100 00000000
f6530900 2648051747 C Io:2:002:2 0:64 8 >
f6530900 2648051775 S Io:2:002:2 -115:64 8 = 0055aa00 ab000000
f6530900 2648115753 C Io:2:002:2 0:64 8 >

So, the same messages to device works fine with radio on 32bit machine
and nothing on 64bit machine.
Good thing is if i add one more start message radio works on 64bit machine also.

Is this usb subsystem bug?
Should i make some workaround to deal with this and add comments about mplayer?

-- 
Best regards, Klimov Alexey

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

* Re: Probably strange bug with usb radio-mr800
  2009-05-27 17:51 Probably strange bug with usb radio-mr800 Alexey Klimov
@ 2009-06-04 22:43 ` Alexey Klimov
  2009-06-04 22:53   ` Greg KH
  2009-06-06 21:07   ` Oliver Neukum
  0 siblings, 2 replies; 7+ messages in thread
From: Alexey Klimov @ 2009-06-04 22:43 UTC (permalink / raw)
  To: Linux Media, linux-usb; +Cc: Douglas Schilling Landgraf, Alexey Klimov, Greg KH

Is there any ideas about different behaviour of device on 32- and
64-bit platforms with the same usb bulk messages?
Any input is welcome.

On Wed, May 27, 2009 at 9:51 PM, Alexey Klimov<klimov.linux@gmail.com> wrote:

[...]

> So, the same messages to device works fine with radio on 32bit machine
> and nothing on 64bit machine.
> Good thing is if i add one more start message radio works on 64bit machine also.
>
> Is this usb subsystem bug?
> Should i make some workaround to deal with this and add comments about mplayer?


-- 
Best regards, Klimov Alexey

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

* Re: Probably strange bug with usb radio-mr800
  2009-06-04 22:43 ` Alexey Klimov
@ 2009-06-04 22:53   ` Greg KH
  2009-06-05  8:54     ` Alexey Klimov
  2009-06-06 21:07   ` Oliver Neukum
  1 sibling, 1 reply; 7+ messages in thread
From: Greg KH @ 2009-06-04 22:53 UTC (permalink / raw)
  To: Alexey Klimov; +Cc: Linux Media, linux-usb, Douglas Schilling Landgraf

On Fri, Jun 05, 2009 at 02:43:04AM +0400, Alexey Klimov wrote:
> Is there any ideas about different behaviour of device on 32- and
> 64-bit platforms with the same usb bulk messages?

No, there should be no difference.

Have you run usbmon to look at the data on the wire?

thanks,

greg k-h

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

* Re: Probably strange bug with usb radio-mr800
  2009-06-04 22:53   ` Greg KH
@ 2009-06-05  8:54     ` Alexey Klimov
  0 siblings, 0 replies; 7+ messages in thread
From: Alexey Klimov @ 2009-06-05  8:54 UTC (permalink / raw)
  To: Greg KH; +Cc: Linux Media, linux-usb, Douglas Schilling Landgraf

On Fri, Jun 5, 2009 at 2:53 AM, Greg KH<gregkh@suse.de> wrote:
> On Fri, Jun 05, 2009 at 02:43:04AM +0400, Alexey Klimov wrote:
>> Is there any ideas about different behaviour of device on 32- and
>> 64-bit platforms with the same usb bulk messages?
>
> No, there should be no difference.
>
> Have you run usbmon to look at the data on the wire?

Of course, there is my first letter (from May 27) on usb and v4l mail
lists with usbmon output.
Here is the link http://www.spinics.net/lists/linux-media/msg06051.html

-- 
Best regards, Klimov Alexey

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

* Re: Probably strange bug with usb radio-mr800
  2009-06-04 22:43 ` Alexey Klimov
  2009-06-04 22:53   ` Greg KH
@ 2009-06-06 21:07   ` Oliver Neukum
  2009-06-07 13:41     ` Alexey Klimov
  1 sibling, 1 reply; 7+ messages in thread
From: Oliver Neukum @ 2009-06-06 21:07 UTC (permalink / raw)
  To: Alexey Klimov; +Cc: Linux Media, linux-usb, Douglas Schilling Landgraf, Greg KH

Am Freitag, 5. Juni 2009 00:43:04 schrieb Alexey Klimov:
> Is there any ideas about different behaviour of device on 32- and
> 64-bit platforms with the same usb bulk messages?
> Any input is welcome.

Are you running a 32 bit userland? If so, ioctls could be critical.
If not, the driver may not be 64bit clean. Which driver is affected?

	Regards
		Oliver


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

* Re: Probably strange bug with usb radio-mr800
  2009-06-06 21:07   ` Oliver Neukum
@ 2009-06-07 13:41     ` Alexey Klimov
  2009-06-08 11:03       ` Oliver Neukum
  0 siblings, 1 reply; 7+ messages in thread
From: Alexey Klimov @ 2009-06-07 13:41 UTC (permalink / raw)
  To: Oliver Neukum; +Cc: Linux Media, linux-usb, Douglas Schilling Landgraf, Greg KH

Hello,

On Sun, Jun 7, 2009 at 1:07 AM, Oliver Neukum<oliver@neukum.org> wrote:
> Am Freitag, 5. Juni 2009 00:43:04 schrieb Alexey Klimov:
>> Is there any ideas about different behaviour of device on 32- and
>> 64-bit platforms with the same usb bulk messages?
>> Any input is welcome.
>
> Are you running a 32 bit userland? If so, ioctls could be critical.

Two different machines. The answer is no.

> If not, the driver may not be 64bit clean. Which driver is affected?

media/radio/radio-mr800.c
Please, also take a look in my first letter to usb and v4l mail lists
from May 27.

-- 
Best regards, Klimov Alexey

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

* Re: Probably strange bug with usb radio-mr800
  2009-06-07 13:41     ` Alexey Klimov
@ 2009-06-08 11:03       ` Oliver Neukum
  0 siblings, 0 replies; 7+ messages in thread
From: Oliver Neukum @ 2009-06-08 11:03 UTC (permalink / raw)
  To: Alexey Klimov; +Cc: Linux Media, linux-usb, Douglas Schilling Landgraf, Greg KH

Am Sonntag, 7. Juni 2009 15:41:13 schrieb Alexey Klimov:

> > If not, the driver may not be 64bit clean. Which driver is affected?
>
> media/radio/radio-mr800.c

I can see no obvious 64bit problem.

> Please, also take a look in my first letter to usb and v4l mail lists
> from May 27.

Please resend that and put linux-usb@vger.kernel.org into cc.

	Regards
		Oliver


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

end of thread, other threads:[~2009-06-08 11:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-27 17:51 Probably strange bug with usb radio-mr800 Alexey Klimov
2009-06-04 22:43 ` Alexey Klimov
2009-06-04 22:53   ` Greg KH
2009-06-05  8:54     ` Alexey Klimov
2009-06-06 21:07   ` Oliver Neukum
2009-06-07 13:41     ` Alexey Klimov
2009-06-08 11:03       ` Oliver Neukum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox