mirror of
https://github.com/DigitalDevices/dddvb.git
synced 2023-10-10 13:37:43 +02:00
fix j83b tuning
This commit is contained in:
parent
527f6a47a3
commit
b60efcdaad
@ -332,7 +332,7 @@ static int tune_c(struct dddvb_fe *fe)
|
|||||||
{
|
{
|
||||||
struct dtv_property p[] = {
|
struct dtv_property p[] = {
|
||||||
{ .cmd = DTV_CLEAR },
|
{ .cmd = DTV_CLEAR },
|
||||||
{ .cmd = DTV_FREQUENCY, .u.data = fe->param.param[PARAM_FREQ] },
|
{ .cmd = DTV_FREQUENCY, .u.data = fe->param.param[PARAM_FREQ] * 1000},
|
||||||
{ .cmd = DTV_BANDWIDTH_HZ, .u.data = (fe->param.param[PARAM_BW_HZ] != DDDVB_UNDEF) ?
|
{ .cmd = DTV_BANDWIDTH_HZ, .u.data = (fe->param.param[PARAM_BW_HZ] != DDDVB_UNDEF) ?
|
||||||
fe->param.param[PARAM_BW_HZ] : 8000000 },
|
fe->param.param[PARAM_BW_HZ] : 8000000 },
|
||||||
{ .cmd = DTV_SYMBOL_RATE, .u.data = fe->param.param[PARAM_SR] },
|
{ .cmd = DTV_SYMBOL_RATE, .u.data = fe->param.param[PARAM_SR] },
|
||||||
@ -359,19 +359,28 @@ static int tune_c(struct dddvb_fe *fe)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tune_cable(struct dddvb_fe *fe)
|
static int tune_j83b(struct dddvb_fe *fe)
|
||||||
{
|
{
|
||||||
uint32_t freq;
|
struct dtv_property p[] = {
|
||||||
struct dvb_frontend_parameters p = {
|
{ .cmd = DTV_CLEAR },
|
||||||
.frequency = fe->param.param[PARAM_FREQ] * 1000,
|
{ .cmd = DTV_FREQUENCY, .u.data = fe->param.param[PARAM_FREQ] * 1000},
|
||||||
.u.qam.symbol_rate = fe->param.param[PARAM_SR],
|
{ .cmd = DTV_BANDWIDTH_HZ, .u.data = (fe->param.param[PARAM_BW_HZ] != DDDVB_UNDEF) ?
|
||||||
.u.qam.fec_inner = (fe->param.param[PARAM_FEC] != DDDVB_UNDEF) ?
|
fe->param.param[PARAM_BW_HZ] : 6000000 },
|
||||||
(fe->param.param[PARAM_FEC]) : FEC_AUTO,
|
{ .cmd = DTV_SYMBOL_RATE, .u.data = (fe->param.param[PARAM_SR] != DDDVB_UNDEF) ?
|
||||||
.u.qam.modulation = fe->param.param[PARAM_MTYPE],
|
fe->param.param[PARAM_SR] : 5056941},
|
||||||
};
|
{ .cmd = DTV_TUNE },
|
||||||
set_property(fe->fd, DTV_DELIVERY_SYSTEM, SYS_DVBC_ANNEX_A);
|
};
|
||||||
if (ioctl(fe->fd, FE_SET_FRONTEND, &p) == -1) {
|
struct dtv_properties c;
|
||||||
perror("FE_SET_FRONTEND error");
|
int ret;
|
||||||
|
|
||||||
|
printf("tune_j83b()\n");
|
||||||
|
set_property(fe->fd, DTV_DELIVERY_SYSTEM, SYS_DVBC_ANNEX_B);
|
||||||
|
|
||||||
|
c.num = ARRAY_SIZE(p);
|
||||||
|
c.props = p;
|
||||||
|
ret = ioctl(fe->fd, FE_SET_PROPERTY, &c);
|
||||||
|
if (ret < 0) {
|
||||||
|
fprintf(stderr, "FE_SET_PROPERTY returned %d\n", ret);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -513,6 +522,9 @@ static int tune(struct dddvb_fe *fe)
|
|||||||
case SYS_DVBC_ANNEX_A:
|
case SYS_DVBC_ANNEX_A:
|
||||||
ret = tune_c(fe);
|
ret = tune_c(fe);
|
||||||
break;
|
break;
|
||||||
|
case SYS_DVBC_ANNEX_B:
|
||||||
|
ret = tune_j83b(fe);
|
||||||
|
break;
|
||||||
case SYS_DVBT:
|
case SYS_DVBT:
|
||||||
ret = tune_terr(fe);
|
ret = tune_terr(fe);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user