LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-30-2014, 06:32 AM   #1
human_shu@yahoo.com
LQ Newbie
 
Registered: Apr 2010
Posts: 1

Rep: Reputation: 0
Question Linux dvb usb adapter frontend


Hi
Iam currently developing a DVB driver for a usb device. I have to provided get and set properties calls. For the testing purpose in 'get parameter' i am setting "dtv_frontend_properties"
----------------------------------
c->code_rate_HP = FEC_3_5;
c->code_rate_LP = FEC_5_6;
c->modulation = QAM_256;
c->transmission_mode = TRANSMISSION_MODE_4K;
c->guard_interval = GUARD_INTERVAL_19_128;
c->hierarchy = HIERARCHY_NONE;
c->frequency = state->frequency;
c->bandwidth_hz = state->bandwidth;
c->inversion = INVERSION_AUTO;
----------------------------------

and in 'set parameter' I'm printing same values

----------------------------------
printk("frequency %x\n",c->frequency );
printk("code_rate_HP %x\n",c->code_rate_HP );
printk("code_rate_LP %x\n",c->code_rate_LP );
printk("modulation %x\n",c->modulation );
printk("transmission_mode %x\n",c->transmission_mode );
printk("guard_interval %x\n",c->guard_interval );
printk("hierarchy %x\n",c->hierarchy );
printk("bandwidth_hz %x\n",c->bandwidth_hz );
printk("inversion %x\n",c->inversion );
----------------------------------
now when iam calling ioctl from application as following

----------------------------------
struct dtv_property prop[8];
struct dtv_properties props;
int dev,err;

memset(prop,0,sizeof(struct dtv_property)*8);
dev=open(DEVICE,O_RDWR);
if(dev < 0){
perror("Error in opening device");
return -1;
}
prop[0].cmd = DTV_MODULATION;
prop[1].cmd = DTV_BANDWIDTH_HZ;
prop[2].cmd = DTV_INVERSION;
prop[3].cmd = DTV_CODE_RATE_HP;
prop[4].cmd = DTV_CODE_RATE_LP;
prop[5].cmd = DTV_GUARD_INTERVAL;
prop[6].cmd = DTV_TRANSMISSION_MODE;
prop[7].cmd = DTV_FREQUENCY;

prop[0].u.data = QPSK;
prop[1].u.data = 8000000;
prop[2].u.data = INVERSION_AUTO;
prop[3].u.data = FEC_NONE ;
prop[4].u.data = FEC_NONE ;
prop[5].u.data = GUARD_INTERVAL_1_32;
prop[6].u.data = TRANSMISSION_MODE_2K;
prop[7].u.data = 57000000;

props.num = 8;
props.props = prop;
if((err=ioctl(dev, FE_SET_FRONTEND , &props)) < 0){
printf("ioctl error");
return -1;
}
----------------------------------------------
these values must update in cache according to my understanding.
but next ioctl call with FE_GET_FRONTEND ,as follows, returns all values as zeros
----------------------------------------------
memset(prop,0,sizeof(struct dtv_property)*8);

prop[0].cmd = DTV_MODULATION;
prop[1].cmd = DTV_BANDWIDTH_HZ;
prop[2].cmd = DTV_INVERSION;
prop[3].cmd = DTV_CODE_RATE_HP;
prop[4].cmd = DTV_CODE_RATE_LP;
prop[5].cmd = DTV_GUARD_INTERVAL;
prop[6].cmd = DTV_TRANSMISSION_MODE;
prop[7].cmd = DTV_FREQUENCY;
props.num = 8;
props.props = prop;
if((err=ioctl(dev, FE_GET_FRONTEND , &props)) < 0){
printf("ioctl error");
return -1;
}
printf("prop[0] %u\n",prop[0].u.data);
printf("prop[1] %u\n",prop[1].u.data);
printf("prop[2] %u\n",prop[2].u.data);
printf("prop[3] %u\n",prop[3].u.data);
printf("prop[4] %u\n",prop[4].u.data);
printf("prop[5] %u\n",prop[5].u.data);
printf("prop[6] %u\n",prop[6].u.data);
printf("prop[7] %u\n",prop[7].u.data);
close(dev);
-------------------------------------------------

what am I doing wrong or is there anything i have misunderstood in dvb for linux?

Last edited by human_shu@yahoo.com; 07-04-2014 at 02:25 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] DVB adapter driver DVB-C DVB-T switching - Linux DVB API V5 robvoo Linux - Kernel 3 02-16-2012 02:50 AM
How to forward IOCTL's from i2c-dev.c to adapter driver (i2c-rt3352.c) elonica.pl Linux - Kernel 2 08-23-2011 02:03 AM
DVB usb device no longer detected as a DVB , but as V4L., so no longer works vdemuth Slackware 4 12-21-2008 06:31 PM
Firmware question about AverTV DVB-T USB 2.0 dvb receiver phildacey Linux - Hardware 0 02-19-2006 03:57 PM
I can't detect I2c-philips-par adapter? thaodt Linux - Software 0 06-07-2004 02:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration