* [linux-dvb] How to find which command generates error in FE_SET_PROPERTY
@ 2008-11-08 17:02 Michel Verbraak
2008-11-08 18:01 ` Darron Broad
0 siblings, 1 reply; 3+ messages in thread
From: Michel Verbraak @ 2008-11-08 17:02 UTC (permalink / raw)
To: linux-dvb
I'm trying to modify one of my applications to use the new S2API. With
this application I control my dvb-t and dvb-s/s2 receivers.
I'm using szap-s2 as an example but I run into a problem that the ioctl
FE_SET_PROPERTY always returns -1 and variable errno is set to 14.
My question is. How do I determine which of the commands in the command
queue given to FE_SET_PROPERTY is producing this error. I did not try
yet to devide my command queue up into one command queue per command.
Regards,
Michel.
Part of source code for dvb-s/s2:
#ifdef S2API
int TDVBDevice::SetProperty(struct dtv_property *cmdseq)
{
int err;
err = ioctl(vfrontendfd, FE_SET_PROPERTY, cmdseq);
if (err < 0)
{
syslog(LOG_ERR, "ioctl FE_SET_PROPERTY failed (errno=%d,
%d).",errno, err);
return -1;
}
syslog(LOG_INFO, "ioctl FE_SET_PROPERTY ok.");
return 0;
}
#else
int TDVBDevice::SetFrontend(struct dvb_frontend_parameters *frontend)
{
if (ioctl(vfrontendfd, FE_SET_FRONTEND, frontend) < 0)
{
syslog(LOG_ERR, "ioctl FE_SET_FRONTEND failed (errno=%d).",errno);
return -1;
}
return 0;
}
#endif
//calling part
#ifdef S2API
struct dtv_property p[DTV_IOCTL_MAX_MSGS];
p[0].cmd = DTV_CLEAR;
p[1].cmd = DTV_DELIVERY_SYSTEM; p[1].u.data = atoi(channel->Item(2));
p[2].cmd = DTV_FREQUENCY; p[2].u.data = (__u32)(ifreq * 1000);
p[3].cmd = DTV_MODULATION; p[3].u.data = QPSK;
p[4].cmd = DTV_SYMBOL_RATE; p[4].u.data = (__u32)(sr * 1000);
p[5].cmd = DTV_INNER_FEC; p[5].u.data = FEC_AUTO;
p[6].cmd = DTV_INVERSION; p[6].u.data = INVERSION_AUTO;
// { .cmd = DTV_ROLLOFF, .u.data = rolloff },
p[7].cmd = DTV_PILOT; p[7].u.data = PILOT_AUTO;
p[8].cmd = DTV_TUNE;
struct dtv_properties cmdseq;
cmdseq.num = 9;
cmdseq.props = p;
#else
frontend.frequency = (unsigned int)(ifreq * 1000);
frontend.inversion = INVERSION_AUTO;
frontend.u.qpsk.symbol_rate = (unsigned int)(sr * 1000);
frontend.u.qpsk.fec_inner = FEC_AUTO;
#endif
#ifdef S2API
if (SetProperty(&p[0]) == 0)
#else
if (SetFrontend(&frontend) == 0)
#endif
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [linux-dvb] How to find which command generates error in FE_SET_PROPERTY
2008-11-08 17:02 [linux-dvb] How to find which command generates error in FE_SET_PROPERTY Michel Verbraak
@ 2008-11-08 18:01 ` Darron Broad
2008-11-08 18:23 ` Michel Verbraak
0 siblings, 1 reply; 3+ messages in thread
From: Darron Broad @ 2008-11-08 18:01 UTC (permalink / raw)
To: Michel Verbraak; +Cc: linux-dvb
In message <4915C608.9000709@verbraak.org>, Michel Verbraak wrote:
LO
>I'm trying to modify one of my applications to use the new S2API. With
>this application I control my dvb-t and dvb-s/s2 receivers.
>
>I'm using szap-s2 as an example but I run into a problem that the ioctl
>FE_SET_PROPERTY always returns -1 and variable errno is set to 14.
>
>My question is. How do I determine which of the commands in the command
>queue given to FE_SET_PROPERTY is producing this error. I did not try
>yet to devide my command queue up into one command queue per command.
The only commands as such as CLEAR and TUNE, the rest are tuning
parameters. The way this works is that the TUNE command informs
the kernel to retune using the parameters specified. This occurs
outside of the IOCTL call itself and you don't directly know
if a paramater was wrong, it just doesn't work.
The error you have:
> grep 14 /usr/include/asm-generic/errno-base.h
#define EFAULT 14 /* Bad address */
Suggests a problem in your code...
>Regards,
>
>Michel.
>
>Part of source code for dvb-s/s2:
>
>#ifdef S2API
>int TDVBDevice::SetProperty(struct dtv_property *cmdseq)
This should something like SetProperties(struct dtv_properties cmdseq[])
and then call ioctl(fefd, FE_SET_PROPERTY, cmdseq)
This sends of your args at the same time.
> if (SetProperty(&p[0]) == 0)
That needs to be more like:
SetProperties(&cmdseq)
I hope that helps.
cya!
--
// /
{:)==={ Darron Broad <darron@kewl.org>
\\ \
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [linux-dvb] How to find which command generates error in FE_SET_PROPERTY
2008-11-08 18:01 ` Darron Broad
@ 2008-11-08 18:23 ` Michel Verbraak
0 siblings, 0 replies; 3+ messages in thread
From: Michel Verbraak @ 2008-11-08 18:23 UTC (permalink / raw)
To: linux-dvb
[-- Attachment #1.1: Type: text/plain, Size: 1847 bytes --]
Darron Broad schreef:
> In message <4915C608.9000709@verbraak.org>, Michel Verbraak wrote:
>
> LO
>
>
>> I'm trying to modify one of my applications to use the new S2API. With
>> this application I control my dvb-t and dvb-s/s2 receivers.
>>
>> I'm using szap-s2 as an example but I run into a problem that the ioctl
>> FE_SET_PROPERTY always returns -1 and variable errno is set to 14.
>>
>> My question is. How do I determine which of the commands in the command
>> queue given to FE_SET_PROPERTY is producing this error. I did not try
>> yet to devide my command queue up into one command queue per command.
>>
>
> The only commands as such as CLEAR and TUNE, the rest are tuning
> parameters. The way this works is that the TUNE command informs
> the kernel to retune using the parameters specified. This occurs
> outside of the IOCTL call itself and you don't directly know
> if a paramater was wrong, it just doesn't work.
>
> The error you have:
>
>> grep 14 /usr/include/asm-generic/errno-base.h
>>
> #define EFAULT 14 /* Bad address */
>
> Suggests a problem in your code...
>
>
>> Regards,
>>
>> Michel.
>>
>> Part of source code for dvb-s/s2:
>>
>> #ifdef S2API
>> int TDVBDevice::SetProperty(struct dtv_property *cmdseq)
>>
>
> This should something like SetProperties(struct dtv_properties cmdseq[])
> and then call ioctl(fefd, FE_SET_PROPERTY, cmdseq)
> This sends of your args at the same time.
>
>
>> if (SetProperty(&p[0]) == 0)
>>
>
> That needs to be more like:
> SetProperties(&cmdseq)
>
> I hope that helps.
>
> cya!
>
> --
>
> // /
> {:)==={ Darron Broad <darron@kewl.org>
> \\ \
>
>
Darron,
You were right. The error I had to solve was to change
SetProperty(&p[0]) into SetProperty(&cmdseq).
I have been coding all day and missed this one.
Thanks,
Michel.
[-- Attachment #1.2: Type: text/html, Size: 2621 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-11-08 18:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-08 17:02 [linux-dvb] How to find which command generates error in FE_SET_PROPERTY Michel Verbraak
2008-11-08 18:01 ` Darron Broad
2008-11-08 18:23 ` Michel Verbraak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox