On Thu, Jun 16, 2011 at 7:14 AM, Mauro Carvalho Chehab <mchehab@xxxxxxxxxx> wrote: > One possible logic that would solve the scripting would be to use a watchdog > to monitor ioctl activities. If not used for a while, it could send a s_power > to put the device to sleep, but this may not solve all our problems. > > So, I agree with Devin: we need to add an option to explicitly control the > power management logic of the device, having 3 modes of operation: > POWER_AUTO - use the watchdogs to poweroff > POWER_ON - explicitly powers on whatever subdevices are needed in > order to make the V4L ready to stream; > POWER_OFF - Put all subdevices to power-off if they support it. > > After implementing such logic, and keeping the default as POWER_ON, we may > announce that the default will change to POWER_AUTO, and give some time for > userspace apps/scripts that need to use a different mode to change their > behaviour. That means that, for example, "radio -qf" will need to change to > POWER_ON mode, and "radio -m" should call POWER_OFF. I've considered this idea before, and it's not bad in theory. The one thing you will definitely have to watch out for is causing a race between DVB and V4L for hybrid tuners. In other words, you can have a user switching from analog to digital and you don't want the tuner to get powered down a few seconds after they started streaming video from DVB. Any such solution would have to take the above into account. We've got a history of race conditions like this and I definitely don't want to see a new one introduced. Devin -- Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html