Driver TerraTec Piranha functional, need some advice to finish up
Dear List,
I am finishing up the last stages of a new driver for the TerraTec Piranha DVB-T adapter (Sanio SMS-100x chipset), and I have some general questions some of the more experienced driver writers could perhaps provide some advice on.
First of all, because of some odd USB interfacing (see my previous mail about endpoints) I do not use the dvb-usb framework, but used the ttusb-budget driver as my main example.
The device scans, tunes, filters PIDs etc correctly. With Kaffeine, one can do all the usual watching-TV stuff. Some details such as reporting signal quality are missing (so far).
* All TS data comes in from a bulk endpoint, and always in quantities of exactly 21 TS packets (plus 8 byte header, so always exactly 3956 bytes, never more, never less). Occasionally a command-response is received on the same endpoint, about 12-60 bytes.
How many urbs should I have doing the reading ? Does having multiple urbs help also for bulk transfers ? I allocate the memory with pci_alloc_consistent, one large block of "how-many-urbs * 3965" bytes and distribute this over the urbs.
* When receiving a TS packet (so in the urb completion irq handler) I feed the TS data to dvb_dmx_swfilter(..). Is it OK to do that in the irq handler? (i.e. from a performance point of view the rule is to do as little as possbible in the completion function).
* Can usb urb read completion callbacks come back concurrently, i.e. do I need to lock the call to dvb_dmx_swfilter(...) ?
* When loading the module, and plugging in the device, the module becomes in-use and can not be unloaded until the device is unplugged. Is it possible to change this, so that the module will "close" the device and allow itself to be unloaded, event when the device is still plugged in ?
* When unplugging the device during playback, the tv app stops (obviously), but the module gets stuck, i.e. can not be unloaded anymore and may or may not be in some kind of sane state where replugging the device will work. Can this be handled gracefully ?
* Some applications request the frontend status very often (many times per second), to really ask the status from the device needs a round-trip request. Is it common to cache the results and only ask the device for an update occasionally, or is it normal to just ask every time ? (it just logs a lot of debug messages so it looks like a lot, don't know if it is really an issue)
* The only locking I am doing currently is in sending a request and reading a response from the device (the whole routine, including the completion wait at the read step). This is similar to the "semusb" lock of the ttusb-budget driver. Where else should I be careful with locking ?
* Any common gotchas I should keep in mind? :-)
Thanks!
Dennis
_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
Quoted 4 lines · Dennis Noordsij
I am finishing up the last stages of a new driver for the TerraTec Piranha DVB-T adapter (Sanio SMS-100x chipset), and I have some general questions some of the more experienced driver writers could perhaps provide some advice on.
Dennis,
I am currently in the process of cleaning up a public GPL'd driver released by Siano for the SMS1010 / SMS1150 silicon.
This driver functions correctly with Siano's reference design hardware.
This is a generic driver that should probably also be backwards compatible with the SMS1000 silicon used in your device.
I posted the work-in-progress to the following location:
http://linuxtv.org/hg/~mkrufky/siano
Please note: This driver has been publicly available on linuxtv.org for the past three weeks -- I recommend taking a quick look through the individual development repositories before starting to write a brand new driver, to prevent double-work efforts.
Please also note: The driver has only gone through basic testing -- I would not be surprised to find bugs in the code, and there is a plethora of codingstyle violations.
Please feel free to send me patches against that repository to support your device -- I will be happy to integrate them for you, although you should be prepared to rebase your tree when I push up the next round of updates / cleanups.
It makes more sense for you to add support for your device, rather than writing a new driver from scratch, especially considering that the driver I have comes directly from Siano, themselves.
Regards,
Mike
_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
Michael Krufky schreef:
Quoted 4 lines
Dennis,
I am currently in the process of cleaning up a public GPL'd driver released by Siano for the SMS1010 / SMS1150 silicon.
Hi Mike,
Ehh, D'OH I guess! I wrote to Siano in April when I bought this adapter, but never got any reply. I know it was advertised as a mobile linux chipset, but couldn't find any reference to any actual drivers.
At first try it seems to work in DVB-T mode with my device.
And at first glance it does the same things for DVB-T (only about 8 commands are really needed to function, though it is interesting to know the real meaning behind all the bits).
Quoted 3 lines
It makes more sense for you to add support for your device, rather than writing a new driver from scratch, especially considering that the driver I have comes directly from Siano, themselves.
Yes, of course. Well, at least it was interesting to reverse engineer the protocol :-)
Goodluck with the many coding style violations, and please let me know if you would like me to try or test something.
I will switch to this driver, and if I run into any issues with the SMS1000 chipset I will send you a patch.
Can you provide a link to the "officially supported" firmware blobs ?
Thanks for your reply,
Dennis
_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
Quoted 8 lines · Dennis Noordsij
Michael Krufky schreef:
Quoted 4 lines
Dennis,
I am currently in the process of cleaning up a public GPL'd driver released by Siano for the SMS1010 / SMS1150 silicon.
Quoted 7 lines
Hi Mike,
Ehh, D'OH I guess! I wrote to Siano in April when I bought this adapter, but never got any reply. I know it was advertised as a mobile linux chipset, but couldn't find any reference to any actual drivers.
At first try it seems to work in DVB-T mode with my device.
Great! Please continue testing with the driver -- let me know if you hit any issues.
I'm assuming that you didn't have to make any changes to the driver?
Quoted 1 line
Can you provide a link to the "officially supported" firmware blobs ?
Unfortunately, I can not distribute the firmware at this point in time. The firmware that I am working with is for the SMS1010 and SMS1150 -- I believe that you need different firmware for the SMS100X -- exactly which sms100x silicon is used in your device?
-Mike
_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
Quoted 2 lines
I'm assuming that you didn't have to make any changes to the driver?
No, (though had to override the default from DVB-H to DVB-T and substitute the firmware I have with the one the driver expects).
Quoted 6 lines
Quoted 1 line
Can you provide a link to the "officially supported" firmware blobs ?
Unfortunately, I can not distribute the firmware at this point in time. The firmware that I am working with is for the SMS1010 and SMS1150 -- I believe that you need different firmware for the SMS100X -- exactly which sms100x silicon is used in your device?
I did have the adapter open (wasn't as easy as it sounds!), but, eh, I think it might have been the SMS1001.
In any case, the firmware I have is the one distributed by TerraTec (with their adapter), afaict they used the Siano drivers without any modification (but add tv-viewing/recording software etc).
1c6e220399a8b1a5d9888952134436fd SMS100x_DabTdmb.inp (40096 bytes) 94a9f88c12c90700898cfeef4c86857f SMS100x_Dvbh.inp (40324 bytes) 4c156db5762f7fc40f567729d8bfea04 SMS100x_Dvbt.inp (38144 bytes)
These are freely available on terratec.net (those are the original names as well, so I guess they are completely different from what you have).
Perhaps you could ask your contact if/how firmware for the SMS100X can also be included with the release, if it's confirmed the driver supports all of these variants ? Since they re-use the same USB product id I guess (would hope) the firmware variants are supposed to expose the same API anyway.
One interesting thing is that the Piranha adapter is not advertised or documented to support DVB-H, yet the SMS100x and firmware should.
I have tried loading the Dvbh firmware, and the commands work the same, the adapter responds normally, but can't find any channels (surprise, there aren't any here). Promising though.
Again, please let me know if there is anything I can do to help, and thank you for your work in general
Cheers
Dennis
_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb