Changeset ed59877cbb98259edb98433775aa4f4014e91a55

Show
Ignore:
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
  • modules/access/dvb/access.c

    r3439df8 red59877  
    9191    int                 i_transmission = 0; 
    9292    int                 i_hierarchy = 0; 
    93     vlc_bool_t          b_polarisation = 0; 
     93    int                 i_polarisation = 0; 
    9494    int                 i_fec = 0; 
    9595    int                 i_code_rate_HP = 0; 
     
    131131    i_hierarchy = config_GetInt(p_input, "hierarchy"); 
    132132 
    133  
    134133    /* Determine frontend device information and capabilities */ 
    135134    b_probe = config_GetInt( p_input, "probe" ); 
     
    162161        else if (strncmp( p_input->psz_access, "terrestrial",11) ==0) 
    163162            frontend_info.type = FE_OFDM; 
    164  
    165 //        frontend_info.frequency_max =   12999000; /* in KHz, lnb_lof2 */ 
    166 //        frontend_info.frequency_min =    9750000; /* lnb_lof1 */ 
    167163 
    168164        frontend_info.frequency_max = u_lnb_lof2; /* in KHz, lnb_lof2 */ 
     
    206202                     psz_parser - psz_parser_init ) ) ) 
    207203                { 
    208                     b_polarisation = VLC_FALSE; 
     204                    i_polarisation = 0; //VLC_FALSE; 
    209205                } 
    210206                else if ((!strncmp( psz_parser_init, "H" , 
     
    214210 
    215211                { 
    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; 
    217221                } 
    218222            } 
     
    248252            { 
    249253                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 */ 
    252257            } 
    253258            else if( !strncmp( psz_parser, "lnb-lof2=", 
     
    255260            { 
    256261                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 */ 
    259265            } 
    260266            else if( !strncmp( psz_parser, "lnb-slof=", 
     
    262268            { 
    263269                u_lnb_slof = 
    264                 (unsigned int)strtol( psz_parser + strlen( "lnb_slof=" ), 
     270                (unsigned int)strtol( psz_parser + strlen( "lnb-slof=" ), 
    265271                            &psz_parser, 0 ); 
    266272            } 
     
    340346        { 
    341347            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 ); 
    343349            if( *psz_next ) 
    344350            { 
     
    379385    { 
    380386        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 ); 
    382388        if ( ((u_srate) > frontend_info.symbol_rate_max) || 
    383389             ((u_srate) < frontend_info.symbol_rate_min) ) 
    384390        { 
    385391            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" ); 
    397392            return -1; 
    398393        } 
     
    417412        case FE_QPSK: 
    418413            fep.frequency = u_freq; /* KHz */ 
    419             fep.inversion = dvb_DecodeInversion(p_input, (int) b_polarisation); 
     414            fep.inversion = dvb_DecodeInversion(p_input, i_polarisation); 
    420415            fep.u.qpsk.symbol_rate = u_srate; 
    421416            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, 
    425420                               u_lnb_lof1, u_lnb_lof2, u_lnb_slof, 
    426421                               u_adapter, u_device )<0) 
    427422            { 
    428                 msg_Err( p_input, "DVB-S frontend returned a failure event" ); 
     423                msg_Err( p_input, "DVB-S: tuning failed" ); 
    429424                return -1; 
    430425            } 
     
    434429        case FE_QAM: 
    435430            fep.frequency = u_freq; /* KHz */ 
    436             fep.inversion = dvb_DecodeInversion(p_input, (int) b_polarisation); 
     431            fep.inversion = dvb_DecodeInversion(p_input, i_polarisation); 
    437432            fep.u.qam.symbol_rate = u_srate; 
    438433            fep.u.qam.fec_inner = dvb_DecodeFEC(p_input, i_fec);  
    439434            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 ); 
    441436            if (ioctl_SetQAMFrontend (p_input, fep, u_adapter, u_device )<0) 
    442437            { 
    443                 msg_Err( p_input, "DVB-C frontend returned a failure event" ); 
     438                msg_Err( p_input, "DVB-C: tuning failed" ); 
    444439                return -1; 
    445440            } 
     
    449444        case FE_OFDM: 
    450445            fep.frequency = u_freq; /* KHz */ 
    451             fep.inversion = dvb_DecodeInversion(p_input, (int) b_polarisation); 
     446            fep.inversion = dvb_DecodeInversion(p_input, i_polarisation); 
    452447            fep.u.ofdm.bandwidth = dvb_DecodeBandwidth(p_input, i_bandwidth); 
    453448            fep.u.ofdm.code_rate_HP = dvb_DecodeFEC(p_input, i_code_rate_HP);  
     
    457452            fep.u.ofdm.guard_interval = dvb_DecodeGuardInterval(p_input, i_guard); 
    458453            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 ); 
    460455            if (ioctl_SetOFDMFrontend (p_input, fep,u_adapter, u_device )<0) 
    461456            { 
    462                 msg_Err( p_input, "DVB-T frontend returned a failure event" ); 
     457                msg_Err( p_input, "DVB-T: tuning failed" ); 
    463458                return -1; 
    464459            } 
  • modules/access/dvb/dvb.c

    r057ed2c red59877  
    431431    } 
    432432 
     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 
    433441    /* Now send it all to the frontend device */ 
    434442    if ((ret=ioctl(front, FE_SET_FRONTEND, &fep)) < 0) 
     
    436444        close(front); 
    437445#   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); 
    441449#   endif 
    442450        return -1;