Linux-DVB-DVBT

 view release on metacpan or  search on metacpan

clib/dvb_lib/dvb_tune.c  view on Meta::CPAN


	if (dvb_debug>1) _fn_end((char *)__FUNCTION__, rc) ;

    // Hmm, the driver seems not to like that :-/
    // dvb_frontend_release(h,1);
	RETURN_DVB_ERROR(rc);;
}

/* ----------------------------------------------------------------------- */
/* Returns true if any other process currently has this frontend in use */
int dvb_frontend_is_busy(struct dvb_state *h)
{
int rc;
int is_busy = 0 ;

    if ( (rc=dvb_frontend_open(h, /* write=1*/1)) < 0 )
    {
    	is_busy = 1 ;
    }
    else
    {
    	dvb_frontend_release(h, /* write */ 1) ;
    }

    return is_busy ;
}

/* ----------------------------------------------------------------------- */
/* print tuning settings */
void dvb_frontend_tune_info(struct dvb_state *h)
{
struct dvb_frontend_parameters info ;
	
    if (xioctl(h->fdro,FE_GET_FRONTEND,&info) != 0)
    {

clib/dvb_ts_lib/shared/dvb_error.c  view on Meta::CPAN


	[-ERR_FILE]				= "file error",
	[-ERR_FILE_SEEK]		= "file seek error",
	[-ERR_FILE_NO_PKTS]		= "file no ts packets",
	[-ERR_FILE_ZERO]		= "file zero length",

	[-ERR_TUNING_TIMEOUT]	= "frontend tuning timed out",
	[-ERR_TUNING_TIMEOUT0]	= "frontend is not tuned (no timeout specified)",

	[-ERR_DVB_DEV]			= "DVB device error",
	[-ERR_DEMUX_OPEN]		= "DVB demux device busy",
	[-ERR_DVR_OPEN]			= "DVB recording device busy",
	[-ERR_FE_OPEN]			= "DVB frontend device busy",
	[-ERR_SET_PES_FILTER]	= "DVB unable to set PES filter",
	[-ERR_REQ_SECTION]		= "DVB unable to set section filter",

	[-ERR_DURATION]			= "invalid recording duration parameter",
	[-ERR_INVALID_TSREADER]	= "invalid tsreader structure",


	[-ERR_NONE]				= "no error",
} ;

lib/Linux/DVB/DVBT.pm  view on Meta::CPAN

=head3 TUNING

=over 4

=cut

#============================================================================================

#----------------------------------------------------------------------------

=item B<is_busy()>

Returns 0 is the currently selected adapter frontend is not busy; 1 if it is.

=cut

sub is_busy
{
	my $self = shift ;

	my $is_busy = dvb_is_busy($self->{dvb}) ;
	
	return $is_busy ;
}

#----------------------------------------------------------------------------

=item B<set_frontend(%params)>

Tune the frontend to the specified frequency etc. HASH %params contains:

    'frequency'
    'inversion'

lib/Linux/DVB/DVBT.pm  view on Meta::CPAN

	}

	# Set up the frontend
	my $rc = dvb_tune($self->{dvb}, {%params}) ;
	
	print STDERR "dvb_tune() returned $rc\n" if $DEBUG ;
	
	# If tuning went ok, then save params
	#
	# Currently:
	#   -11 = Device busy
	#	-15 / -16 = Failed to tune
	#
	if ($rc == 0)
	{
		$self->frontend_params( {%params} ) ;
	}
	
	return $rc ;
}

lib/Linux/DVB/DVBT.pm  view on Meta::CPAN

	foreach my $tsid (@tsids)
	{
		## Tune frontend
		my $frontend_params_href = $tuning_href->{'ts'}{$tsid} ;
		my $error_code ;
		if ($error_code = $self->set_frontend(%$frontend_params_href, 'timeout' => $self->timeout))
		{
			print STDERR "set_frontend() returned $error_code\n" if $DEBUG ;
			
			$info{$tsid}{'error'} = "Unable to tune frontend. " . dvb_error_str() ;
			if ($info{$tsid}{'error'} =~ /busy/i)
			{
				## stop now since the device is in use
				last ;
			}
		}
		else
		{
			## get info
			$info{$tsid} = $self->signal_quality($tsid) ;
			$info{$tsid}{'error'} = undef ;

script/dvbt-strength  view on Meta::CPAN

	$dvb->dvb_close() ;
	
	if ($@)
	{
		## expected this to work
		failed($@, $dvb_name, $hwcheck, $mail) ;
	}
	
	Linux::DVB::DVBT::prt_data("Info=", \%info) if $DEBUG ;
	
	## Check for device busy
	foreach my $tsid (keys %info)
	{
		if ($info{$tsid}{'error'} && ($info{$tsid}{'error'} =~ /device busy/i)) 
		{
			if ($VERBOSE)
			{
				info("DVB IN USE") ;
			}
			else
			{
				if (!$munin)
				{
					print "DVB adapter is in use, please try again later.\n" ;

xs/DVBT-tuning.c  view on Meta::CPAN

# /* Round up frequency */
int
dvb_round_freq(int freqin)

 CODE:
   RETVAL = ROUND_FREQUENCY(freqin) ;
 OUTPUT:
   RETVAL

# /*---------------------------------------------------------------------------------------------------*/
# /* See if this adapter frontend is busy */
int
dvb_is_busy(DVB *dvb)

 CODE:
   RETVAL = dvb_frontend_is_busy(dvb) ;
 OUTPUT:
   RETVAL



( run in 0.309 second using v1.01-cache-2.11-cpan-87723dcf8b7 )