All of lore.kernel.org
 help / color / mirror / Atom feed
* Excessive rc polling interval in dvb_usb_dib0700 causes interference with USB soundcard
@ 2010-03-03 23:35 Pedro Ribeiro
  2010-03-03 23:48 ` Devin Heitmueller
  0 siblings, 1 reply; 11+ messages in thread
From: Pedro Ribeiro @ 2010-03-03 23:35 UTC (permalink / raw)
  To: linux-media

Hello all,

yesterday I sent a message asking for help with a problem I was having
with a dib0700 USB adapter and my USB audio soundcard.

Basically I discovered that the remote control polling in dvb_usb
module was causing it. For reference, my original message is here
http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/16782
and I also file a kernel bug here
http://bugzilla.kernel.org/show_bug.cgi?id=15430

Looking at dmesg when I plug the DVB adapter it says
dvb-usb: schedule remote query interval to 50 msecs.

This seemed to me extremely excessive, so I solved the problem by
doing a quick dirty hack. In linux/drivers/media/dvb/dvb-usb-remote.c
I changed d->props.rc_interval to 10000, instead of the default 50
msec.

So now when I load the driver, I get
dvb-usb: schedule remote query interval to 10000 msecs.

And not only the USB audio card is working properly with the DVB
adapter but also the remote control is working perfectly, without any
delay at all!

So my question is: why is this set to an excessive 50 msec? This is
waaaaaaay too much for remote control polling, and its proven it
causes trouble in the USB bus!
Also, I know my hack was dirty, what the is the proper way to change this?


Regards,
Pedro

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

* Re: Excessive rc polling interval in dvb_usb_dib0700 causes interference with USB soundcard
  2010-03-03 23:35 Excessive rc polling interval in dvb_usb_dib0700 causes interference with USB soundcard Pedro Ribeiro
@ 2010-03-03 23:48 ` Devin Heitmueller
  2010-03-04  1:00   ` Pedro Ribeiro
  0 siblings, 1 reply; 11+ messages in thread
From: Devin Heitmueller @ 2010-03-03 23:48 UTC (permalink / raw)
  To: Pedro Ribeiro; +Cc: linux-media

On Wed, Mar 3, 2010 at 6:35 PM, Pedro Ribeiro <pedrib@gmail.com> wrote:
> Hello all,
>
> yesterday I sent a message asking for help with a problem I was having
> with a dib0700 USB adapter and my USB audio soundcard.
>
> Basically I discovered that the remote control polling in dvb_usb
> module was causing it. For reference, my original message is here
> http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/16782
> and I also file a kernel bug here
> http://bugzilla.kernel.org/show_bug.cgi?id=15430
>
> Looking at dmesg when I plug the DVB adapter it says
> dvb-usb: schedule remote query interval to 50 msecs.
>
> This seemed to me extremely excessive, so I solved the problem by
> doing a quick dirty hack. In linux/drivers/media/dvb/dvb-usb-remote.c
> I changed d->props.rc_interval to 10000, instead of the default 50
> msec.
>
> So now when I load the driver, I get
> dvb-usb: schedule remote query interval to 10000 msecs.
>
> And not only the USB audio card is working properly with the DVB
> adapter but also the remote control is working perfectly, without any
> delay at all!
>
> So my question is: why is this set to an excessive 50 msec? This is
> waaaaaaay too much for remote control polling, and its proven it
> causes trouble in the USB bus!
> Also, I know my hack was dirty, what the is the proper way to change this?

It's already been fixed.  Just update to the latest v4l-dvb code.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com

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

* Re: Excessive rc polling interval in dvb_usb_dib0700 causes interference with USB soundcard
  2010-03-03 23:48 ` Devin Heitmueller
@ 2010-03-04  1:00   ` Pedro Ribeiro
  2010-03-04  1:06     ` Devin Heitmueller
  0 siblings, 1 reply; 11+ messages in thread
From: Pedro Ribeiro @ 2010-03-04  1:00 UTC (permalink / raw)
  To: Devin Heitmueller; +Cc: linux-media

On 3 March 2010 23:48, Devin Heitmueller <dheitmueller@kernellabs.com> wrote:
> On Wed, Mar 3, 2010 at 6:35 PM, Pedro Ribeiro <pedrib@gmail.com> wrote:
>> Hello all,
>>
>> yesterday I sent a message asking for help with a problem I was having
>> with a dib0700 USB adapter and my USB audio soundcard.
>>
>> Basically I discovered that the remote control polling in dvb_usb
>> module was causing it. For reference, my original message is here
>> http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/16782
>> and I also file a kernel bug here
>> http://bugzilla.kernel.org/show_bug.cgi?id=15430
>>
>> Looking at dmesg when I plug the DVB adapter it says
>> dvb-usb: schedule remote query interval to 50 msecs.
>>
>> This seemed to me extremely excessive, so I solved the problem by
>> doing a quick dirty hack. In linux/drivers/media/dvb/dvb-usb-remote.c
>> I changed d->props.rc_interval to 10000, instead of the default 50
>> msec.
>>
>> So now when I load the driver, I get
>> dvb-usb: schedule remote query interval to 10000 msecs.
>>
>> And not only the USB audio card is working properly with the DVB
>> adapter but also the remote control is working perfectly, without any
>> delay at all!
>>
>> So my question is: why is this set to an excessive 50 msec? This is
>> waaaaaaay too much for remote control polling, and its proven it
>> causes trouble in the USB bus!
>> Also, I know my hack was dirty, what the is the proper way to change this?
>
> It's already been fixed.  Just update to the latest v4l-dvb code.
>
> Devin
>
> --
> Devin J. Heitmueller - Kernel Labs
> http://www.kernellabs.com
>

Its working very well, thanks.

Can you please tell me if its going to be pushed to .33 stable? And
should I close the kernel bug?

Thanks,
Pedro

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

* Re: Excessive rc polling interval in dvb_usb_dib0700 causes interference with USB soundcard
  2010-03-04  1:00   ` Pedro Ribeiro
@ 2010-03-04  1:06     ` Devin Heitmueller
  2010-03-04  4:18       ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 11+ messages in thread
From: Devin Heitmueller @ 2010-03-04  1:06 UTC (permalink / raw)
  To: Pedro Ribeiro; +Cc: linux-media

On Wed, Mar 3, 2010 at 8:00 PM, Pedro Ribeiro <pedrib@gmail.com> wrote:
> Its working very well, thanks.
>
> Can you please tell me if its going to be pushed to .33 stable? And
> should I close the kernel bug?

It's in Mauro's PULL request for 2.6.34-rc1.  It's marked "normal"
priority so it likely won't get pulled into stable.  It was a
non-trivial restructuring of the code, so doing a minimal fix that
would be accepted by stable is unlikely.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com

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

* Re: Excessive rc polling interval in dvb_usb_dib0700 causes  interference with USB soundcard
  2010-03-04  1:06     ` Devin Heitmueller
@ 2010-03-04  4:18       ` Mauro Carvalho Chehab
  2010-03-04 11:14         ` Pedro Ribeiro
  0 siblings, 1 reply; 11+ messages in thread
From: Mauro Carvalho Chehab @ 2010-03-04  4:18 UTC (permalink / raw)
  To: Devin Heitmueller; +Cc: Pedro Ribeiro, linux-media

Devin Heitmueller wrote:
> On Wed, Mar 3, 2010 at 8:00 PM, Pedro Ribeiro <pedrib@gmail.com> wrote:
>> Its working very well, thanks.
>>
>> Can you please tell me if its going to be pushed to .33 stable? And
>> should I close the kernel bug?
> 
> It's in Mauro's PULL request for 2.6.34-rc1.  It's marked "normal"
> priority so it likely won't get pulled into stable.  It was a
> non-trivial restructuring of the code, so doing a minimal fix that
> would be accepted by stable is unlikely.

The kernel bug should be closed, as this patch has already fixed and
sent upstream.
> 
> Devin
> 


-- 

Cheers,
Mauro

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

* Re: Excessive rc polling interval in dvb_usb_dib0700 causes interference with USB soundcard
  2010-03-04  4:18       ` Mauro Carvalho Chehab
@ 2010-03-04 11:14         ` Pedro Ribeiro
  2010-03-04 19:39           ` Devin Heitmueller
  0 siblings, 1 reply; 11+ messages in thread
From: Pedro Ribeiro @ 2010-03-04 11:14 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Devin Heitmueller, linux-media

On 4 March 2010 04:18, Mauro Carvalho Chehab <maurochehab@gmail.com> wrote:
> Devin Heitmueller wrote:
>> On Wed, Mar 3, 2010 at 8:00 PM, Pedro Ribeiro <pedrib@gmail.com> wrote:
>>> Its working very well, thanks.
>>>
>>> Can you please tell me if its going to be pushed to .33 stable? And
>>> should I close the kernel bug?
>>
>> It's in Mauro's PULL request for 2.6.34-rc1.  It's marked "normal"
>> priority so it likely won't get pulled into stable.  It was a
>> non-trivial restructuring of the code, so doing a minimal fix that
>> would be accepted by stable is unlikely.
>
> The kernel bug should be closed, as this patch has already fixed and
> sent upstream.
>>
>> Devin
>>
>
>
> --
>
> Cheers,
> Mauro
>

Devin, I noticed that your solution does not alter the remote query
interval from 50 msec. It works, but it is not as effective as my hard
hack because I still get interference every once in a while when the
DVB adapter is connected.

I can't tell you exactly when and how it happens, because it seems
rather random - but it is much better than previously though.

Regards,
Pedro

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

* Re: Excessive rc polling interval in dvb_usb_dib0700 causes interference with USB soundcard
  2010-03-04 11:14         ` Pedro Ribeiro
@ 2010-03-04 19:39           ` Devin Heitmueller
       [not found]             ` <74fd948d1003041244s513dce3s69567cb9dbe31ae1@mail.gmail.com>
  0 siblings, 1 reply; 11+ messages in thread
From: Devin Heitmueller @ 2010-03-04 19:39 UTC (permalink / raw)
  To: Pedro Ribeiro; +Cc: Mauro Carvalho Chehab, linux-media

On Thu, Mar 4, 2010 at 6:14 AM, Pedro Ribeiro <pedrib@gmail.com> wrote:
> Devin, I noticed that your solution does not alter the remote query
> interval from 50 msec. It works, but it is not as effective as my hard
> hack because I still get interference every once in a while when the
> DVB adapter is connected.
>
> I can't tell you exactly when and how it happens, because it seems
> rather random - but it is much better than previously though.

Well, the printk() line is a little misleading, since the code change
results in *zero* polling.  Basically the driver now registers a bulk
URB handler, so whenever a message is delivered on the bulk pipe it is
handled immediately.  Hence, no polling at all.

That said, I should probably find a way to get rid of that line from
the dmesg output when the device is in that mode (the issue is that
portion of the code is shared with drivers other than the dib0700).

If you are still seeing issues, then it is unlikely to have anything
to do with the dib0700 RC support.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com

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

* Re: Excessive rc polling interval in dvb_usb_dib0700 causes interference with USB soundcard
       [not found]             ` <74fd948d1003041244s513dce3s69567cb9dbe31ae1@mail.gmail.com>
@ 2010-03-04 20:52               ` Devin Heitmueller
  2010-03-14 15:06                 ` Pedro Ribeiro
  0 siblings, 1 reply; 11+ messages in thread
From: Devin Heitmueller @ 2010-03-04 20:52 UTC (permalink / raw)
  To: Pedro Ribeiro; +Cc: Linux Media Mailing List

On Thu, Mar 4, 2010 at 3:44 PM, Pedro Ribeiro <pedrib@gmail.com> wrote:
> I think you are right. I was to quick to blame it. It occurs whether
> or not the DVB adapter is connected.
>
> Once again, thanks.
>
> Pedro

Ok, that's great to hear.  I'm putting linux-media back into the CC in
case anyone else finds this thread in the mailing list archives.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com

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

* Re: Excessive rc polling interval in dvb_usb_dib0700 causes interference with USB soundcard
  2010-03-04 20:52               ` Devin Heitmueller
@ 2010-03-14 15:06                 ` Pedro Ribeiro
  2010-03-15  3:55                   ` Devin Heitmueller
  0 siblings, 1 reply; 11+ messages in thread
From: Pedro Ribeiro @ 2010-03-14 15:06 UTC (permalink / raw)
  To: Devin Heitmueller; +Cc: linux-media

On 4 March 2010 20:52, Devin Heitmueller <dheitmueller@kernellabs.com> wrote:
> On Thu, Mar 4, 2010 at 3:44 PM, Pedro Ribeiro <pedrib@gmail.com> wrote:
>> I think you are right. I was to quick to blame it. It occurs whether
>> or not the DVB adapter is connected.
>>
>> Once again, thanks.
>>
>> Pedro
>
> Ok, that's great to hear.  I'm putting linux-media back into the CC in
> case anyone else finds this thread in the mailing list archives.
>
> Devin
>
> --
> Devin J. Heitmueller - Kernel Labs
> http://www.kernellabs.com
>

Hi Devin,

after some through investigation I found that your patch solves the
continuous interference.

However, I have a second problem. It is also interference but appears
to be quite random, by which I mean it is not at a fixed interval,
sometimes it happens past 10 seconds, other times past 30 seconds,
other times 2 to 5 seconds.

One thing is sure - it only happens when I'm actually streaming from
the DVB adapter. If I just plug it in, there is no interference. But
when I start vdr (for example) the interference starts.

The DVB adapter and the sound card are not sharing irq's or anything
like that, and there is no system freeze when the interference
happens. I also thought it was either my docking bay or power supply,
but definitely it isn't.

Any idea what can this be?

Thank you for your help,
Pedro

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

* Re: Excessive rc polling interval in dvb_usb_dib0700 causes interference with USB soundcard
  2010-03-14 15:06                 ` Pedro Ribeiro
@ 2010-03-15  3:55                   ` Devin Heitmueller
  2010-03-15 19:36                     ` Pedro Ribeiro
  0 siblings, 1 reply; 11+ messages in thread
From: Devin Heitmueller @ 2010-03-15  3:55 UTC (permalink / raw)
  To: Pedro Ribeiro; +Cc: linux-media

On Sun, Mar 14, 2010 at 11:06 AM, Pedro Ribeiro <pedrib@gmail.com> wrote:
> Hi Devin,
>
> after some through investigation I found that your patch solves the
> continuous interference.
>
> However, I have a second problem. It is also interference but appears
> to be quite random, by which I mean it is not at a fixed interval,
> sometimes it happens past 10 seconds, other times past 30 seconds,
> other times 2 to 5 seconds.
>
> One thing is sure - it only happens when I'm actually streaming from
> the DVB adapter. If I just plug it in, there is no interference. But
> when I start vdr (for example) the interference starts.
>
> The DVB adapter and the sound card are not sharing irq's or anything
> like that, and there is no system freeze when the interference
> happens. I also thought it was either my docking bay or power supply,
> but definitely it isn't.
>
> Any idea what can this be?
>
> Thank you for your help,
> Pedro

Hello Pedro,

Could you describe in more detail what you mean by "interference"?  Do
you mean that you get corrupted audio for short bursts?  Or do you
mean the audio is dropping out for periods of time?  Can you elaborate
on how long the problem occurs for, and how often it occurs?  For
example, do you get corrupted audio for 1 second at a time every ten
or fifteen seconds?

This is a USB audio device, correct?  Are both devices on the same USB
bus?  Is there a USB hub involved?

It's also possible that this is just a general latency problem - where
the CPU becomes too busy, it does not service the sound card often
enough and PCM data is being dropped.  Have you tried running "top"?
What does your CPU utilization look like when you are experiencing the
problem?

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com

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

* Re: Excessive rc polling interval in dvb_usb_dib0700 causes interference with USB soundcard
  2010-03-15  3:55                   ` Devin Heitmueller
@ 2010-03-15 19:36                     ` Pedro Ribeiro
  0 siblings, 0 replies; 11+ messages in thread
From: Pedro Ribeiro @ 2010-03-15 19:36 UTC (permalink / raw)
  To: Devin Heitmueller; +Cc: linux-media

On 15 March 2010 03:55, Devin Heitmueller <dheitmueller@kernellabs.com> wrote:
> On Sun, Mar 14, 2010 at 11:06 AM, Pedro Ribeiro <pedrib@gmail.com> wrote:
>> Hi Devin,
>>
>> after some through investigation I found that your patch solves the
>> continuous interference.
>>
>> However, I have a second problem. It is also interference but appears
>> to be quite random, by which I mean it is not at a fixed interval,
>> sometimes it happens past 10 seconds, other times past 30 seconds,
>> other times 2 to 5 seconds.
>>
>> One thing is sure - it only happens when I'm actually streaming from
>> the DVB adapter. If I just plug it in, there is no interference. But
>> when I start vdr (for example) the interference starts.
>>
>> The DVB adapter and the sound card are not sharing irq's or anything
>> like that, and there is no system freeze when the interference
>> happens. I also thought it was either my docking bay or power supply,
>> but definitely it isn't.
>>
>> Any idea what can this be?
>>
>> Thank you for your help,
>> Pedro
>
> Hello Pedro,
>
> Could you describe in more detail what you mean by "interference"?  Do
> you mean that you get corrupted audio for short bursts?  Or do you
> mean the audio is dropping out for periods of time?  Can you elaborate
> on how long the problem occurs for, and how often it occurs?  For
> example, do you get corrupted audio for 1 second at a time every ten
> or fifteen seconds?


Hi Devin,

by interference I mean cracks and pops in the sound. These occur
rather randomly, and they are regular but not periodic, by which I
mean there is no defined timeframe between them. Sometimes there are 2
or 3 in a row, other times 10 seconds between them, other times 30
seconds or 1 minute.

These cracks and pops only last for a fraction of a second and they do
not interfere with the audio playing. Its like some kind of static
interference, really high pitched and loud.

> This is a USB audio device, correct?  Are both devices on the same USB
> bus?  Is there a USB hub involved?

Yes they are both USB devices. There is no USB hub involved, and they
are in different ports with different interrupts assigned to them.

> It's also possible that this is just a general latency problem - where
> the CPU becomes too busy, it does not service the sound card often
> enough and PCM data is being dropped.  Have you tried running "top"?
> What does your CPU utilization look like when you are experiencing the
> problem?

There is no jump in cpu utilization when the spikes occur. I am
running a realtime kernel and I also don't see any latency spikes when
the interferences occur.

The problem occurs with both realtime and normal kernels, on 2.6.31,
.32 and .33. Without your patch (commit
6a2071006b72bf887e38c025c60f98d2998ceacb) the problem is aggravated as
the interference is constant.

Something fishy is going on. I've spent countless hours trying to
figure out the problem it is really hard to find a pattern. This is
what I know till now:

- the first time both devices are connected to the laptop after a
fresh boot, usually there is no problem and they work nicely - the
keyword here is usually, it has happened a few times

- if i unplug and replug the dib0700 adapter, then the cracks and pops
immediately start

- stopping vdr seems to stop the cracks and pops MOST of the time -
though sometimes it also cracks without it

One thing I'm sure - without the dib0700 adapter connected to the USB
bus there is cracking at all.

This is a tough nut to crack.

Thanks for the help,
Pedro

PS: This is probably unrelated, but here is a bug report: if I boot
with the dib0700 adapter connected to the computer, the remote control
does not work. Note what dmesg says:

[   13.033653] dib0700: loaded with support for 14 different device-types
[   13.035185] dvb-usb: found a 'Hauppauge Nova-T Stick' in warm state.
[   13.036516] dvb-usb: will pass the complete MPEG2 transport stream
to the software demuxer.
[   13.038045] DVB: registering new adapter (Hauppauge Nova-T Stick)
[   13.235713] DVB: registering adapter 0 frontend 0 (DiBcom 7000PC)...
[   13.438312] DiB0070: successfully identified
[   13.439741] input: IR-receiver inside an USB DVB receiver as
/devices/pci0000:00/0000:00:1d.7/usb2/2-1/input/input13
[   13.441301] dvb-usb: schedule remote query interval to 50 msecs.
[   13.442742] dvb-usb: Hauppauge Nova-T Stick successfully
initialized and connected.
[   13.444577] dib0700: rc submit urb failed
[   13.444579]
[   13.447573] usbcore: registered new interface driver dvb_usb_dib0700

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

end of thread, other threads:[~2010-03-15 19:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-03 23:35 Excessive rc polling interval in dvb_usb_dib0700 causes interference with USB soundcard Pedro Ribeiro
2010-03-03 23:48 ` Devin Heitmueller
2010-03-04  1:00   ` Pedro Ribeiro
2010-03-04  1:06     ` Devin Heitmueller
2010-03-04  4:18       ` Mauro Carvalho Chehab
2010-03-04 11:14         ` Pedro Ribeiro
2010-03-04 19:39           ` Devin Heitmueller
     [not found]             ` <74fd948d1003041244s513dce3s69567cb9dbe31ae1@mail.gmail.com>
2010-03-04 20:52               ` Devin Heitmueller
2010-03-14 15:06                 ` Pedro Ribeiro
2010-03-15  3:55                   ` Devin Heitmueller
2010-03-15 19:36                     ` Pedro Ribeiro

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.