1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Switched to the driver's new tuning API

This commit is contained in:
Klaus Schmidinger 2001-09-15 14:00:14 +02:00
parent 7913b00daa
commit c9796296cd
4 changed files with 40 additions and 43 deletions

View File

@ -745,3 +745,5 @@ Video Disk Recorder Revision History
- The pipe to the Dolby Digital replay command (option '-a') now closes all - The pipe to the Dolby Digital replay command (option '-a') now closes all
unused file descriptors in the child process to avoid crashing when the unused file descriptors in the child process to avoid crashing when the
OSD is used (thanks to Andreas Vitting). OSD is used (thanks to Andreas Vitting).
- Switched to the driver's new tuning API (VDR now requires a driver version
dated 2001-09-14 or higher).

View File

@ -27,11 +27,8 @@ You can find 'libdvdread' at
http://www.dtek.chalmers.se/groups/dvd/downloads.html http://www.dtek.chalmers.se/groups/dvd/downloads.html
VDR requires the card driver version 0.9.0 or higher VDR requires the card driver version dated 2001-09-14 or higher
to work properly. You need to load the dvb.o module *without* option to work properly.
'outstream=0' (previous versions of VDR required this option to have
the driver supply the data in AV_PES format; as of version 0.70 VDR
works with PES format).
After extracting the package, change into the VDR directory After extracting the package, change into the VDR directory
and type 'make'. This should produce an executable file and type 'make'. This should produce an executable file

View File

@ -7,7 +7,7 @@
* DVD support initially written by Andreas Schultz <aschultz@warp10.net> * DVD support initially written by Andreas Schultz <aschultz@warp10.net>
* based on dvdplayer-0.5 by Matjaz Thaler <matjaz.thaler@guest.arnes.si> * based on dvdplayer-0.5 by Matjaz Thaler <matjaz.thaler@guest.arnes.si>
* *
* $Id: dvbapi.c 1.119 2001/09/15 12:45:19 kls Exp $ * $Id: dvbapi.c 1.120 2001/09/15 13:51:27 kls Exp $
*/ */
//#define DVDDEBUG 1 //#define DVDDEBUG 1
@ -40,15 +40,14 @@ extern "C" {
#include "tools.h" #include "tools.h"
#include "videodir.h" #include "videodir.h"
#define DEV_VIDEO "/dev/video" #define DEV_VIDEO "/dev/video"
#define DEV_OST_OSD "/dev/ost/osd" #define DEV_OST_OSD "/dev/ost/osd"
#define DEV_OST_QAMFE "/dev/ost/qamfe" #define DEV_OST_FRONTEND "/dev/ost/frontend"
#define DEV_OST_QPSKFE "/dev/ost/qpskfe" #define DEV_OST_SEC "/dev/ost/sec"
#define DEV_OST_SEC "/dev/ost/sec" #define DEV_OST_DVR "/dev/ost/dvr"
#define DEV_OST_DVR "/dev/ost/dvr" #define DEV_OST_DEMUX "/dev/ost/demux"
#define DEV_OST_DEMUX "/dev/ost/demux" #define DEV_OST_VIDEO "/dev/ost/video"
#define DEV_OST_VIDEO "/dev/ost/video" #define DEV_OST_AUDIO "/dev/ost/audio"
#define DEV_OST_AUDIO "/dev/ost/audio"
// The size of the array used to buffer video data: // The size of the array used to buffer video data:
// (must be larger than MINVIDEODATA - see remux.h) // (must be larger than MINVIDEODATA - see remux.h)
@ -2474,9 +2473,8 @@ cDvbApi::cDvbApi(int n)
// Devices that are only present on DVB-C or DVB-S cards: // Devices that are only present on DVB-C or DVB-S cards:
fd_qamfe = OstOpen(DEV_OST_QAMFE, n, O_RDWR); fd_frontend = OstOpen(DEV_OST_FRONTEND, n, O_RDWR);
fd_qpskfe = OstOpen(DEV_OST_QPSKFE, n, O_RDWR); fd_sec = OstOpen(DEV_OST_SEC, n, O_RDWR);
fd_sec = OstOpen(DEV_OST_SEC, n, O_RDWR);
// Devices that all DVB cards must have: // Devices that all DVB cards must have:
@ -2507,7 +2505,7 @@ cDvbApi::cDvbApi(int n)
// We only check the devices that must be present - the others will be checked before accessing them: // We only check the devices that must be present - the others will be checked before accessing them:
if (((fd_qpskfe >= 0 && fd_sec >= 0) || fd_qamfe >= 0) && fd_demuxv >= 0 && fd_demuxa1 >= 0 && fd_demuxa2 >= 0 && fd_demuxd1 >= 0 && fd_demuxd2 >= 0 && fd_demuxt >= 0) { if (fd_frontend >= 0 && fd_demuxv >= 0 && fd_demuxa1 >= 0 && fd_demuxa2 >= 0 && fd_demuxd1 >= 0 && fd_demuxd2 >= 0 && fd_demuxt >= 0) {
siProcessor = new cSIProcessor(OstName(DEV_OST_DEMUX, n)); siProcessor = new cSIProcessor(OstName(DEV_OST_DEMUX, n));
if (!dvbApi[0]) // only the first one shall set the system time if (!dvbApi[0]) // only the first one shall set the system time
siProcessor->SetUseTSTime(Setup.SetSystemTime); siProcessor->SetUseTSTime(Setup.SetSystemTime);
@ -2627,7 +2625,7 @@ bool cDvbApi::Init(void)
NumDvbApis = 0; NumDvbApis = 0;
for (int i = 0; i < MAXDVBAPI; i++) { for (int i = 0; i < MAXDVBAPI; i++) {
if (useDvbApi == 0 || (useDvbApi & (1 << i)) != 0) { if (useDvbApi == 0 || (useDvbApi & (1 << i)) != 0) {
if (Probe(OstName(DEV_OST_QPSKFE, i)) || Probe(OstName(DEV_OST_QAMFE, i))) if (Probe(OstName(DEV_OST_FRONTEND, i)))
dvbApi[NumDvbApis++] = new cDvbApi(i); dvbApi[NumDvbApis++] = new cDvbApi(i);
else else
break; break;
@ -3227,7 +3225,7 @@ eSetChannelResult cDvbApi::SetChannel(int ChannelNumber, int FrequencyMHz, char
bool ChannelSynced = false; bool ChannelSynced = false;
if (fd_qpskfe >= 0 && fd_sec >= 0) { // DVB-S if (fd_sec >= 0) { // DVB-S
// Frequency offsets: // Frequency offsets:
@ -3243,10 +3241,10 @@ eSetChannelResult cDvbApi::SetChannel(int ChannelNumber, int FrequencyMHz, char
tone = SEC_TONE_ON; tone = SEC_TONE_ON;
} }
qpskParameters qpsk; FrontendParameters Frontend;
qpsk.iFrequency = freq * 1000UL; Frontend.Frequency = freq * 1000UL;
qpsk.SymbolRate = Srate * 1000UL; Frontend.u.qpsk.SymbolRate = Srate * 1000UL;
qpsk.FEC_inner = FEC_AUTO; Frontend.u.qpsk.FEC_inner = FEC_AUTO;
int volt = (Polarization == 'v' || Polarization == 'V') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18; int volt = (Polarization == 'v' || Polarization == 'V') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
@ -3270,44 +3268,44 @@ eSetChannelResult cDvbApi::SetChannel(int ChannelNumber, int FrequencyMHz, char
// Tuning: // Tuning:
CHECK(ioctl(fd_qpskfe, QPSK_TUNE, &qpsk)); CHECK(ioctl(fd_frontend, FE_SET_FRONTEND, &Frontend));
// Wait for channel sync: // Wait for channel sync:
if (cFile::FileReady(fd_qpskfe, 5000)) { if (cFile::FileReady(fd_frontend, 5000)) {
qpskEvent event; FrontendEvent event;
int res = ioctl(fd_qpskfe, QPSK_GET_EVENT, &event); int res = ioctl(fd_frontend, FE_GET_EVENT, &event);
if (res >= 0) if (res >= 0)
ChannelSynced = event.type == FE_COMPLETION_EV; ChannelSynced = event.type == FE_COMPLETION_EV;
else else
esyslog(LOG_ERR, "ERROR %d in qpsk get event", res); esyslog(LOG_ERR, "ERROR %d in frontend get event", res);
} }
else else
esyslog(LOG_ERR, "ERROR: timeout while tuning"); esyslog(LOG_ERR, "ERROR: timeout while tuning");
} }
else if (fd_qamfe >= 0) { // DVB-C else if (fd_frontend >= 0) { // DVB-C
// Frequency and symbol rate: // Frequency and symbol rate:
qamParameters qam; FrontendParameters Frontend;
qam.Frequency = FrequencyMHz * 1000000UL; Frontend.Frequency = FrequencyMHz * 1000000UL;
qam.SymbolRate = Srate * 1000UL; Frontend.u.qam.SymbolRate = Srate * 1000UL;
qam.FEC_inner = FEC_AUTO; Frontend.u.qam.FEC_inner = FEC_AUTO;
qam.QAM = QAM_64; Frontend.u.qam.QAM = QAM_64;
// Tuning: // Tuning:
CHECK(ioctl(fd_qamfe, QAM_TUNE, &qam)); CHECK(ioctl(fd_frontend, FE_SET_FRONTEND, &Frontend));
// Wait for channel sync: // Wait for channel sync:
if (cFile::FileReady(fd_qamfe, 5000)) { if (cFile::FileReady(fd_frontend, 5000)) {
qamEvent event; FrontendEvent event;
int res = ioctl(fd_qamfe, QAM_GET_EVENT, &event); int res = ioctl(fd_frontend, FE_GET_EVENT, &event);
if (res >= 0) if (res >= 0)
ChannelSynced = event.type == FE_COMPLETION_EV; ChannelSynced = event.type == FE_COMPLETION_EV;
else else
esyslog(LOG_ERR, "ERROR %d in qam get event", res); esyslog(LOG_ERR, "ERROR %d in frontend get event", res);
} }
else else
esyslog(LOG_ERR, "ERROR: timeout while tuning"); esyslog(LOG_ERR, "ERROR: timeout while tuning");

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: dvbapi.h 1.49 2001/09/09 14:37:18 kls Exp $ * $Id: dvbapi.h 1.50 2001/09/15 13:46:00 kls Exp $
*/ */
#ifndef __DVBAPI_H #ifndef __DVBAPI_H
@ -87,7 +87,7 @@ class cDvbApi {
friend class cTransferBuffer; friend class cTransferBuffer;
private: private:
int videoDev; int videoDev;
int fd_osd, fd_qpskfe, fd_qamfe, fd_sec, fd_dvr, fd_audio, fd_video, fd_demuxa1, fd_demuxa2, fd_demuxd1, fd_demuxd2, fd_demuxv, fd_demuxt; int fd_osd, fd_frontend, fd_sec, fd_dvr, fd_audio, fd_video, fd_demuxa1, fd_demuxa2, fd_demuxd1, fd_demuxd2, fd_demuxv, fd_demuxt;
int vPid, aPid1, aPid2, dPid1, dPid2; int vPid, aPid1, aPid2, dPid1, dPid2;
bool SetPid(int fd, dmxPesType_t PesType, int Pid, dmxOutput_t Output); bool SetPid(int fd, dmxPesType_t PesType, int Pid, dmxOutput_t Output);
bool SetVpid(int Vpid, dmxOutput_t Output) { return SetPid(fd_demuxv, DMX_PES_VIDEO, Vpid, Output); } bool SetVpid(int Vpid, dmxOutput_t Output) { return SetPid(fd_demuxv, DMX_PES_VIDEO, Vpid, Output); }