Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux-dvb] Re: Writing a DVB driver and some newbie stuff
On Wed, 13 Oct 2004, Holger Waechtler wrote:
> Mark Watson wrote:
>
> >I am looking into using a raw descrambled, but not demultiplexed, DVB data
> >stream (188 byte packets) from a satellite STB. I have built hardware to
> >shove the whole stream to the PC via USB2 (Cypress CY7C68013 based) and
> >wrote a simple Linux driver to receive it. I just used a simple 1MB ring
> >buffer exposed via mmap and some ioctls for timing.
> >
>
> If you are able to receive the stream in your driver you just have to
> register a software demultiplexer and push your data in by calling
> dvb_dmx_swfilter() with your DMA buffer as argument. that's all.
>
I now got my hardware working properly so am receiving the stream properly
in the driver. It plays ok if I dump to disk and load it directly with
vlc.
So now I'm trying to work out this dvb_dmx_swfilter you mention. It sounds
very simply the way you say it, but I'm struggling! I based some driver
code on the usb budget driver which also seems to use the software demux.
The only message I get in the log is DVB: registering new adaptor. Despite
that appearing I seem to be unable to open any device in
/dev/dvb/adaptor0/*. It always returns "No such device or address".
I attempted to register as follows:
--------------------------------------------------
/* General dvb register */
int res = dvb_register_adapter(&dev->adapter, "SkyMPEG",
THIS_MODULE);
dvb_add_frontend_ioctls(dev->adapter, skympeg_ioctl, NULL, dev);
err("dvb register returned:%d\n", res);
/* Register software demux */
memset(&dev->dvb_demux, 0, sizeof(dev->dvb_demux));
dev->dvb_demux.dmx.capabilities =
DMX_TS_FILTERING|DMX_SECTION_FILTERING;
dev->dvb_demux.priv = NULL;
dev->dvb_demux.filternum = 32; // ?
dev->dvb_demux.feednum = 32; // ?
dev->dvb_demux.start_feed = dvb_enable;
dev->dvb_demux.stop_feed = dvb_disable;
dev->dvb_demux.write_to_decoder = 0;
if ((dvb_dmx_init(&dev->dvb_demux)) < 0)
{
err("dvb_dmx_init failed");
goto error;
}
/* Not sure what this is? A container for the software
demux above */
dev->dmxdev.filternum = dev->dvb_demux.filternum;
dev->dmxdev.demux = &dev->dvb_demux.dmx;
dev->dmxdev.capabilities = 0;
if ((dvb_dmxdev_init(&dev->dmxdev, dev->adapter)) < 0)
{
err("dmxdev init failed");
goto error;
}
--------------------------------------------------
The dvb_enable and dvb_disable functions are not called at all. Not
surprising really I guess given the /dev/dvb/adaptor0 stuff may not be
opened... All I did in enable was check if it was a TS being requested and
if so enable a flag. Based on this flag I would call
dvb_dmx_swfilter(&dev->dvb_demux, dev->buffer, 188); whenever I get a
packet.
Please can someone point out what I'm doing wrong here? I expect its
something very trivial -> there is a lot to wade through and I'm still new
to this...
Thanks,
Mark
Home |
Main Index |
Thread Index