Mailing List Archive

How to re-initialize TV-card after suspend-to-ram?
I use a couple of Hauppauge 150, 350 cards and everything works like a charm.

However in order for the recording server not to be running 24x7 when its not
needed I turn it off. Furthermore, I thought I could speed up the shutdown/
wakeup sequence by not fully turning the server off but rather just suspend it,
and here lies the problem.

It seems like the IVTV driver doesn't like to wake up from suspend-to-ram (S3
state). The rest of the server runs just fine after a wake up event but TV-cards
fail to work after the server is woken up. I get timeouts reading from the
device (e.g. /dev /video0) after a wakeup.

The only reliable way to get it to working again that I found is to do a full
power cycle. Is there any command (which I overlooked) in the v4l2 API
interface) that could be used to do a hard reset of the driver to make it re-
initialize itself to simulate a cold-start?

Should I perhaps try to unload the driver before thes erver goes to sleep (i.e.
rmmod -f ivtv pr perhaps modprobe -r ivtv )?

Or, is this perhaps a known limitation of power-management together with the
ivtv driver?

Some technical information:

After wakeup the open() commands work fine (no error code) as does the parameter
settings using ioctl() with standard v4l2 arguments (bitrates, channel etc.).
It's just the read() from the device that fails with a timeout after suspend-to-
ram.

ivtv-driver 1.4.1
kernel: 2.6.34.7

/Johan

P.S I get the same behaviour on two differet motherboards (from different
manufacturers so it doesn't seem like HW specific issue)


_______________________________________________
ivtv-users mailing list
ivtv-users@ivtvdriver.org
http://ivtvdriver.org/mailman/listinfo/ivtv-users
Re: How to re-initialize TV-card after suspend-to-ram? [ In reply to ]
The ivtv driver is not power management aware. Even though the kernel restores kernel data structres, the hardware state is likely way out of sync with the kernel when it wakes back up.

What I have done in the past is kill all the apps using my tv cards, and have the Fedora PM scripts automatically unload and reload the ivtv and cx18 modules.

It is not elegant, but it works.

Regards,
Andy

Johan Persson <johanp@aditus.nu> wrote:

>I use a couple of Hauppauge 150, 350 cards and everything works like a charm.
>
>However in order for the recording server not to be running 24x7 when its not
>needed I turn it off. Furthermore, I thought I could speed up the shutdown/
>wakeup sequence by not fully turning the server off but rather just suspend it,
>and here lies the problem.
>
>It seems like the IVTV driver doesn't like to wake up from suspend-to-ram (S3
>state). The rest of the server runs just fine after a wake up event but TV-cards
>fail to work after the server is woken up. I get timeouts reading from the
>device (e.g. /dev /video0) after a wakeup.
>
>The only reliable way to get it to working again that I found is to do a full
>power cycle. Is there any command (which I overlooked) in the v4l2 API
>interface) that could be used to do a hard reset of the driver to make it re-
>initialize itself to simulate a cold-start?
>
>Should I perhaps try to unload the driver before thes erver goes to sleep (i.e.
>rmmod -f ivtv pr perhaps modprobe -r ivtv )?
>
>Or, is this perhaps a known limitation of power-management together with the
>ivtv driver?
>
>Some technical information:
>
>After wakeup the open() commands work fine (no error code) as does the parameter
>settings using ioctl() with standard v4l2 arguments (bitrates, channel etc.).
>It's just the read() from the device that fails with a timeout after suspend-to-
>ram.
>
>ivtv-driver 1.4.1
>kernel: 2.6.34.7
>
>/Johan
>
>P.S I get the same behaviour on two differet motherboards (from different
>manufacturers so it doesn't seem like HW specific issue)
>
>
>_______________________________________________
>ivtv-users mailing list
>ivtv-users@ivtvdriver.org
>http://ivtvdriver.org/mailman/listinfo/ivtv-users
_______________________________________________
ivtv-users mailing list
ivtv-users@ivtvdriver.org
http://ivtvdriver.org/mailman/listinfo/ivtv-users
Re: How to re-initialize TV-card after suspend-to-ram? [ In reply to ]
Thanks. Yes, that's what I ended up doing , modprobe -r ivtv, before suspend and
then reload the driver again after wakeup.

Since this seems to be a limitation in the driver I was wondering if this would
be possible to handle in the driver? Suspend/hibernation seems in general to
work much better these days and it would be nice if the driver was aware of
power management.

Unfortunately I don't know enough about LInux driver code (I usually write
application level stuff on Linux) to judge if this would require a big or small
effort?

/johan

On the 2010-11-15 you wrote:
> The ivtv driver is not power management aware. Even though the kernel
restores kernel data structres, the hardware state is likely way out of sync
with the kernel when it wakes back up.
>
> What I have done in the past is kill all the apps using my tv cards, and have
the Fedora PM scripts automatically unload and reload the ivtv and cx18 modules.
>
> It is not elegant, but it works.
>
> Regards,
> Andy
>
> Johan Persson <johanp@aditus.nu> wrote:
>
> >I use a couple of Hauppauge 150, 350 cards and everything works like a charm.
> >
> >However in order for the recording server not to be running 24x7 when its not
> >needed I turn it off. Furthermore, I thought I could speed up the shutdown/
> >wakeup sequence by not fully turning the server off but rather just suspend
it,
> >and here lies the problem.
> >
> >It seems like the IVTV driver doesn't like to wake up from suspend-to-ram (S3
> >state). The rest of the server runs just fine after a wake up event but TV-
cards
> >fail to work after the server is woken up. I get timeouts reading from the
> >device (e.g. /dev /video0) after a wakeup.
> >
> >The only reliable way to get it to working again that I found is to do a full
> >power cycle. Is there any command (which I overlooked) in the v4l2 API
> >interface) that could be used to do a hard reset of the driver to make it re-
> >initialize itself to simulate a cold-start?
> >
> >Should I perhaps try to unload the driver before thes erver goes to sleep
(i.e.
> >rmmod -f ivtv pr perhaps modprobe -r ivtv )?
> >
> >Or, is this perhaps a known limitation of power-management together with the
> >ivtv driver?
> >
> >Some technical information:
> >
> >After wakeup the open() commands work fine (no error code) as does the
parameter
> >settings using ioctl() with standard v4l2 arguments (bitrates, channel etc.).
> >It's just the read() from the device that fails with a timeout after suspend-
to-
> >ram.
> >
> >ivtv-driver 1.4.1
> >kernel: 2.6.34.7
> >
> >/Johan
> >
> >P.S I get the same behaviour on two differet motherboards (from different
> >manufacturers so it doesn't seem like HW specific issue)
> >
> >
> >_______________________________________________
> >ivtv-users mailing list
> >ivtv-users@ivtvdriver.org
> >http://ivtvdriver.org/mailman/listinfo/ivtv-users
> _______________________________________________
> ivtv-users mailing list
> ivtv-users@ivtvdriver.org
> http://ivtvdriver.org/mailman/listinfo/ivtv-users
>

_______________________________________________
ivtv-users mailing list
ivtv-users@ivtvdriver.org
http://ivtvdriver.org/mailman/listinfo/ivtv-users