Changeset ed59877cbb98259edb98433775aa4f4014e91a55
- Timestamp:
- 10/02/04 15:57:31
(5 years ago)
- Author:
- Jean-Paul Saman <jpsaman@videolan.org>
- git-committer:
- Jean-Paul Saman <jpsaman@videolan.org> 1076425051 +0000
- git-parent:
[916c69e30e8fea86787a4ef04eff48a80f816cd8]
- git-author:
- Jean-Paul Saman <jpsaman@videolan.org> 1076425051 +0000
- Message:
Fixes for DVB-C:
- Make sure that lnb-lof1 and lnb-lof2 can be overriden by the commandline syntax frequency=xx:lnb-lof1=xx:lnb-lof2=xx
- Added value {A,a} to polarization=xx to force INVERSION_AUTO
- Sanatized a few error messages
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r3439df8 |
red59877 |
|
| 91 | 91 | int i_transmission = 0; |
|---|
| 92 | 92 | int i_hierarchy = 0; |
|---|
| 93 | | vlc_bool_t b_polarisation = 0; |
|---|
| | 93 | int i_polarisation = 0; |
|---|
| 94 | 94 | int i_fec = 0; |
|---|
| 95 | 95 | int i_code_rate_HP = 0; |
|---|
| … | … | |
| 131 | 131 | i_hierarchy = config_GetInt(p_input, "hierarchy"); |
|---|
| 132 | 132 | |
|---|
| 133 | | |
|---|
| 134 | 133 | /* Determine frontend device information and capabilities */ |
|---|
| 135 | 134 | b_probe = config_GetInt( p_input, "probe" ); |
|---|
| … | … | |
| 162 | 161 | else if (strncmp( p_input->psz_access, "terrestrial",11) ==0) |
|---|
| 163 | 162 | frontend_info.type = FE_OFDM; |
|---|
| 164 | | |
|---|
| 165 | | // frontend_info.frequency_max = 12999000; /* in KHz, lnb_lof2 */ |
|---|
| 166 | | // frontend_info.frequency_min = 9750000; /* lnb_lof1 */ |
|---|
| 167 | 163 | |
|---|
| 168 | 164 | frontend_info.frequency_max = u_lnb_lof2; /* in KHz, lnb_lof2 */ |
|---|
| … | … | |
| 206 | 202 | psz_parser - psz_parser_init ) ) ) |
|---|
| 207 | 203 | { |
|---|
| 208 | | b_polarisation = VLC_FALSE; |
|---|
| | 204 | i_polarisation = 0; //VLC_FALSE; |
|---|
| 209 | 205 | } |
|---|
| 210 | 206 | else if ((!strncmp( psz_parser_init, "H" , |
|---|
| … | … | |
| 214 | 210 | |
|---|
| 215 | 211 | { |
|---|
| 216 | | b_polarisation = VLC_TRUE; |
|---|
| | 212 | i_polarisation = 1; //VLC_TRUE; |
|---|
| | 213 | } |
|---|
| | 214 | else if ((!strncmp( psz_parser_init, "A" , |
|---|
| | 215 | psz_parser - psz_parser_init ) ) || |
|---|
| | 216 | (!strncmp( psz_parser_init, "a" , |
|---|
| | 217 | psz_parser - psz_parser_init ) ) ) |
|---|
| | 218 | |
|---|
| | 219 | { |
|---|
| | 220 | i_polarisation = 2; |
|---|
| 217 | 221 | } |
|---|
| 218 | 222 | } |
|---|
| … | … | |
| 248 | 252 | { |
|---|
| 249 | 253 | u_lnb_lof1 = |
|---|
| 250 | | (unsigned int)strtol( psz_parser + strlen( "lnb_lof1=" ), |
|---|
| 251 | | &psz_parser, 0 ); |
|---|
| | 254 | (unsigned int)strtol( psz_parser + strlen( "lnb-lof1=" ), |
|---|
| | 255 | &psz_parser, 0 ); |
|---|
| | 256 | frontend_info.frequency_min = u_lnb_lof1; /* lnb_lof1 */ |
|---|
| 252 | 257 | } |
|---|
| 253 | 258 | else if( !strncmp( psz_parser, "lnb-lof2=", |
|---|
| … | … | |
| 255 | 260 | { |
|---|
| 256 | 261 | u_lnb_lof2 = |
|---|
| 257 | | (unsigned int)strtol( psz_parser + strlen( "lnb_lof2=" ), |
|---|
| 258 | | &psz_parser, 0 ); |
|---|
| | 262 | (unsigned int)strtol( psz_parser + strlen( "lnb-lof2=" ), |
|---|
| | 263 | &psz_parser, 0 ); |
|---|
| | 264 | frontend_info.frequency_max = u_lnb_lof2; /* in KHz, lnb_lof2 */ |
|---|
| 259 | 265 | } |
|---|
| 260 | 266 | else if( !strncmp( psz_parser, "lnb-slof=", |
|---|
| … | … | |
| 262 | 268 | { |
|---|
| 263 | 269 | u_lnb_slof = |
|---|
| 264 | | (unsigned int)strtol( psz_parser + strlen( "lnb_slof=" ), |
|---|
| | 270 | (unsigned int)strtol( psz_parser + strlen( "lnb-slof=" ), |
|---|
| 265 | 271 | &psz_parser, 0 ); |
|---|
| 266 | 272 | } |
|---|
| … | … | |
| 340 | 346 | { |
|---|
| 341 | 347 | psz_parser = psz_next + 1; |
|---|
| 342 | | b_polarisation = (vlc_bool_t)strtol( psz_parser, &psz_next, 10 ); |
|---|
| | 348 | i_polarisation = strtol( psz_parser, &psz_next, 10 ); |
|---|
| 343 | 349 | if( *psz_next ) |
|---|
| 344 | 350 | { |
|---|
| … | … | |
| 379 | 385 | { |
|---|
| 380 | 386 | msg_Warn( p_input, "invalid symbol rate, using default one" ); |
|---|
| 381 | | u_srate = config_GetInt( p_input, "symbol-rate" ); |
|---|
| | 387 | u_srate = config_GetInt( p_input, "symbol-rate"s ); |
|---|
| 382 | 388 | if ( ((u_srate) > frontend_info.symbol_rate_max) || |
|---|
| 383 | 389 | ((u_srate) < frontend_info.symbol_rate_min) ) |
|---|
| 384 | 390 | { |
|---|
| 385 | 391 | msg_Err( p_input, "invalid default symbol rate" ); |
|---|
| 386 | | return -1; |
|---|
| 387 | | } |
|---|
| 388 | | } |
|---|
| 389 | | |
|---|
| 390 | | if( b_polarisation && (b_polarisation != 1) ) |
|---|
| 391 | | { |
|---|
| 392 | | msg_Warn( p_input, "invalid polarization, using default one" ); |
|---|
| 393 | | b_polarisation = config_GetInt( p_input, "polarization" ); |
|---|
| 394 | | if( b_polarisation && b_polarisation != 1 ) |
|---|
| 395 | | { |
|---|
| 396 | | msg_Err( p_input, "invalid default polarization" ); |
|---|
| 397 | 392 | return -1; |
|---|
| 398 | 393 | } |
|---|
| … | … | |
| 417 | 412 | case FE_QPSK: |
|---|
| 418 | 413 | fep.frequency = u_freq; /* KHz */ |
|---|
| 419 | | fep.inversion = dvb_DecodeInversion(p_input, (int) b_polarisation); |
|---|
| | 414 | fep.inversion = dvb_DecodeInversion(p_input, i_polarisation); |
|---|
| 420 | 415 | fep.u.qpsk.symbol_rate = u_srate; |
|---|
| 421 | 416 | fep.u.qpsk.fec_inner = dvb_DecodeFEC(p_input, i_fec); |
|---|
| 422 | | msg_Dbg( p_input, "satellite (QPSK) frontend found on %s", frontend_info.name ); |
|---|
| 423 | | |
|---|
| 424 | | if (ioctl_SetQPSKFrontend (p_input, fep, b_polarisation, |
|---|
| | 417 | msg_Dbg( p_input, "DVB-S: satellite (QPSK) frontend %s found", frontend_info.name ); |
|---|
| | 418 | |
|---|
| | 419 | if (ioctl_SetQPSKFrontend (p_input, fep, i_polarisation, |
|---|
| 425 | 420 | u_lnb_lof1, u_lnb_lof2, u_lnb_slof, |
|---|
| 426 | 421 | u_adapter, u_device )<0) |
|---|
| 427 | 422 | { |
|---|
| 428 | | msg_Err( p_input, "DVB-S frontend returned a failure event" ); |
|---|
| | 423 | msg_Err( p_input, "DVB-S: tuning failed" ); |
|---|
| 429 | 424 | return -1; |
|---|
| 430 | 425 | } |
|---|
| … | … | |
| 434 | 429 | case FE_QAM: |
|---|
| 435 | 430 | fep.frequency = u_freq; /* KHz */ |
|---|
| 436 | | fep.inversion = dvb_DecodeInversion(p_input, (int) b_polarisation); |
|---|
| | 431 | fep.inversion = dvb_DecodeInversion(p_input, i_polarisation); |
|---|
| 437 | 432 | fep.u.qam.symbol_rate = u_srate; |
|---|
| 438 | 433 | fep.u.qam.fec_inner = dvb_DecodeFEC(p_input, i_fec); |
|---|
| 439 | 434 | fep.u.qam.modulation = dvb_DecodeModulation(p_input, i_modulation); |
|---|
| 440 | | msg_Dbg( p_input, "cable (QAM) frontend found on %s", frontend_info.name ); |
|---|
| | 435 | msg_Dbg( p_input, "DVB-C: cable (QAM) frontend %s found", frontend_info.name ); |
|---|
| 441 | 436 | if (ioctl_SetQAMFrontend (p_input, fep, u_adapter, u_device )<0) |
|---|
| 442 | 437 | { |
|---|
| 443 | | msg_Err( p_input, "DVB-C frontend returned a failure event" ); |
|---|
| | 438 | msg_Err( p_input, "DVB-C: tuning failed" ); |
|---|
| 444 | 439 | return -1; |
|---|
| 445 | 440 | } |
|---|
| … | … | |
| 449 | 444 | case FE_OFDM: |
|---|
| 450 | 445 | fep.frequency = u_freq; /* KHz */ |
|---|
| 451 | | fep.inversion = dvb_DecodeInversion(p_input, (int) b_polarisation); |
|---|
| | 446 | fep.inversion = dvb_DecodeInversion(p_input, i_polarisation); |
|---|
| 452 | 447 | fep.u.ofdm.bandwidth = dvb_DecodeBandwidth(p_input, i_bandwidth); |
|---|
| 453 | 448 | fep.u.ofdm.code_rate_HP = dvb_DecodeFEC(p_input, i_code_rate_HP); |
|---|
| … | … | |
| 457 | 452 | fep.u.ofdm.guard_interval = dvb_DecodeGuardInterval(p_input, i_guard); |
|---|
| 458 | 453 | fep.u.ofdm.hierarchy_information = dvb_DecodeHierarchy(p_input, i_hierarchy); |
|---|
| 459 | | msg_Dbg( p_input, "terrestrial (OFDM) frontend found on %s", frontend_info.name ); |
|---|
| | 454 | msg_Dbg( p_input, "DVB-T: terrestrial (OFDM) frontend %s found", frontend_info.name ); |
|---|
| 460 | 455 | if (ioctl_SetOFDMFrontend (p_input, fep,u_adapter, u_device )<0) |
|---|
| 461 | 456 | { |
|---|
| 462 | | msg_Err( p_input, "DVB-T frontend returned a failure event" ); |
|---|
| | 457 | msg_Err( p_input, "DVB-T: tuning failed" ); |
|---|
| 463 | 458 | return -1; |
|---|
| 464 | 459 | } |
|---|
| r057ed2c |
red59877 |
|
| 431 | 431 | } |
|---|
| 432 | 432 | |
|---|
| | 433 | /* Show more info on the tuning parameters used. */ |
|---|
| | 434 | msg_Dbg(p_input, "DVB-C: Tuning with the following paramters:"); |
|---|
| | 435 | msg_Dbg(p_input, "DVB-C: Frequency %d KHz", fep.frequency ); |
|---|
| | 436 | msg_Dbg(p_input, "DVB-C: Inversion/polarisation: %d",fep.inversion); |
|---|
| | 437 | msg_Dbg(p_input, "DVB-C: Symbolrate %d", fep.u.qam.symbol_rate); |
|---|
| | 438 | msg_Dbg(p_input, "DVB-C: FEC Inner %d", fep.u.qam.fec_inner); |
|---|
| | 439 | msg_Dbg(p_input, "DVB-C: Modulation %d", fep.u.qam.modulation); |
|---|
| | 440 | |
|---|
| 433 | 441 | /* Now send it all to the frontend device */ |
|---|
| 434 | 442 | if ((ret=ioctl(front, FE_SET_FRONTEND, &fep)) < 0) |
|---|
| … | … | |
| 436 | 444 | close(front); |
|---|
| 437 | 445 | # ifdef HAVE_ERRNO_H |
|---|
| 438 | | msg_Err(p_input, "DVB-C: setting frontend failed (%d) %s", ret, strerror(errno)); |
|---|
| 439 | | # else |
|---|
| 440 | | msg_Err(p_input, "DVB-C: setting frontend failed (%d)", ret); |
|---|
| | 446 | msg_Err(p_input, "DVB-C: tuning channel failed (frontend returned %d:%s)", ret, strerrror(errno)); |
|---|
| | 447 | # else |
|---|
| | 448 | msg_Err(p_input, "DVB-C: tuning channel failed (frontend returned %d)", ret); |
|---|
| 441 | 449 | # endif |
|---|
| 442 | 450 | return -1; |
|---|