public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [linux-dvb] How to use a DVB FRONTEND in read only?
@ 2008-06-13 21:07 Andrea
  2008-06-14 12:13 ` Claudio Luck
  0 siblings, 1 reply; 4+ messages in thread
From: Andrea @ 2008-06-13 21:07 UTC (permalink / raw)
  To: linux-dvb

Hi,

I have a question about multiple access to the dvb framework.

I would like to open the dvb in readonly and take whatever frequency is currently tuned:

1) I open the frontend in read only
2) query the current frequency to check is there is a lock
3) I open the demux, set some filters and read from the demux.

There is a *big* issue here:

The card streams packets *only* and *as long* as the frontend is opened in read/write (by some other 
application) and tuned.
If my application opens the frontend in readonly and there is no other application running, the 
ioctl FE_GET_INFO still returns FE_HAS_LOCK but no data goes through the demux.
As soon as the frontend is tuned, the data arrives.

Am I correct? How can I detect if the dvb is running or not?

Andrea


_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

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

* Re: [linux-dvb] How to use a DVB FRONTEND in read only?
  2008-06-13 21:07 [linux-dvb] How to use a DVB FRONTEND in read only? Andrea
@ 2008-06-14 12:13 ` Claudio Luck
  2008-06-14 12:31   ` Andrea
  0 siblings, 1 reply; 4+ messages in thread
From: Claudio Luck @ 2008-06-14 12:13 UTC (permalink / raw)
  To: Andrea; +Cc: linux-dvb

Andrea wrote:
> I would like to open the dvb in readonly and take whatever frequency is currently tuned:
> 
> 1) I open the frontend in read only
> 2) query the current frequency to check is there is a lock
> 3) I open the demux, set some filters and read from the demux.
> 
> There is a *big* issue here:
> 
> The card streams packets *only* and *as long* as the frontend is opened in read/write (by some other 
> application) and tuned.
> If my application opens the frontend in readonly and there is no other application running, the 
> ioctl FE_GET_INFO still returns FE_HAS_LOCK but no data goes through the demux.
> As soon as the frontend is tuned, the data arrives.
> 
> Am I correct? How can I detect if the dvb is running or not?


Check for open filehandles on demux device:

root@iptv:~# ls -l /proc/*/fd/* | grep demux
lrwx------ 1 vlc  vlc  64 2008-06-14 14:02 /proc/19876/fd/6 ->
/dev/dvb/adapter0/demux0
lrwx------ 1 vlc  vlc  64 2008-06-14 14:02 /proc/19892/fd/6 ->
/dev/dvb/adapter1/demux0

_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

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

* Re: [linux-dvb] How to use a DVB FRONTEND in read only?
  2008-06-14 12:13 ` Claudio Luck
@ 2008-06-14 12:31   ` Andrea
  2008-06-14 15:59     ` Claudio Luck
  0 siblings, 1 reply; 4+ messages in thread
From: Andrea @ 2008-06-14 12:31 UTC (permalink / raw)
  To: linux-dvb; +Cc: linux-dvb

Claudio Luck wrote:
> Andrea wrote:
> 
> 
> Check for open filehandles on demux device:
> 
> root@iptv:~# ls -l /proc/*/fd/* | grep demux
> lrwx------ 1 vlc  vlc  64 2008-06-14 14:02 /proc/19876/fd/6 ->
> /dev/dvb/adapter0/demux0
> lrwx------ 1 vlc  vlc  64 2008-06-14 14:02 /proc/19892/fd/6 ->
> /dev/dvb/adapter1/demux0

I will try that, but it sounds to me a very non natural solution.
Should the dvb framework tell the clients if it is streaming or not? via an ioctl like FE_GET_INFO?

Andrea


_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

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

* Re: [linux-dvb] How to use a DVB FRONTEND in read only?
  2008-06-14 12:31   ` Andrea
@ 2008-06-14 15:59     ` Claudio Luck
  0 siblings, 0 replies; 4+ messages in thread
From: Claudio Luck @ 2008-06-14 15:59 UTC (permalink / raw)
  To: Andrea; +Cc: linux-dvb

Andrea wrote:
>> Check for open filehandles on demux device:
>  ...
> I will try that, but it sounds to me a very non natural solution.

Everything is a file :)

> Should the dvb framework tell the clients if it is streaming or not? via
> an ioctl like FE_GET_INFO?

IMHO if we realize that any streaming happens through open file handles,
we also realize that there is no need for a custom query in Linux DVB
API for the same information (circumventing or reinventing user access
control). Query the Kernel about process information.

FE_GET_INFO is specific to the frontend, not the demux.


A design question might be raised through: should readonly demux file
handles stop streaming after the readwrite demux filehandle is closed?
This behavior is different compared to frontends remaining tuned even
after closing the controlling frontend file handles.

-- 
Best Regards
Claudio

_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

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

end of thread, other threads:[~2008-06-14 15:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-13 21:07 [linux-dvb] How to use a DVB FRONTEND in read only? Andrea
2008-06-14 12:13 ` Claudio Luck
2008-06-14 12:31   ` Andrea
2008-06-14 15:59     ` Claudio Luck

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