GNOME Bugzilla – Bug 489107
Autoscan for GstTuner interface
Last modified: 2011-05-19 06:02:35 UTC
Provide autoscanning functionality in the GstTuner interface. Something for providing 'scan forward' and 'scan backward'. Edgard_ has given some points, I'll list them here: 1- the app could implement it by using only get_frequency , set_frequency and get_signal_strength , for example 2- the plugin could start a new thread for scan (possible listening the application for a possibly 'cancel') 3- or else could be synchronous, and the plugin could call a callback function in the app (passing a app user data to it and possibly some other values, and then based on return from the app the scan stops) 4- there still are some details, like, the scan function could decide to wait some mili-seconds before get the signal strength or get for example the signal strength 10 times and make a average Let's discuss this.
I see in the following way (use GstTuner X use Element property) X implemented by Application - I'm not sure it should be in the library or application - I have look in v4l2 specification and there is nothing related to scanning - I would be good to talk to v4l2 guys and ask him if it is application specific or it should be inside a general library * I'm starting thinking it should be implemented by the application (but I'm not sure) 2- if decided to put in Plugins side (GstTuner X Element property) - I think it is better to use GstTuner because it is related to tuners and not plugin specific. 3- using GstTuner we should have - is_scan_available (not every plugin will have scanning functionality or scanning is not available...or should we implement this in all of them).....because of this I think scanning should be implemented by the applicationb - scan_forward - scan_backward - scan_get_min_strength - scan_set_min_strength - scan_get_default_min_strength - ret = scan_start (loop_count) loop_count = 0 -> if scanning forward, stops at max frenquancy loop_count = 1 -> loop until reach the start point loop_count = -1 -> scan forever until find a good signal strength ret = 0 -> frequency found ret = -1 -> frequency not found ret = 1 -> user called stop - scan_stop * for the application point of view it is easier to use a asynchronous scan function - - - - - - - - - - - - - - - - - - - I have already seem two types of scanning 1- for fm radio (which are always in 'X.n' MHz where 'n' is a odd, ex: 88,7 MHz) The function just jump each 0.2 MHz then get the signal ...tow variations 1.1 - just get the signal and compare against min_strength 1.1.1 - sometimes you have to wait a millisecond before get the signal strnght 1.2 - get the signal 'c' times (spaced by 'm' milliseconds) and get the average 2- get the signal strength at, for example, 0.01 MHz then get the average signal strength of each 10 measures, and make a simple heuristic to get the desired frequency somewhere in the middle. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Well.....I think it is application specific but we could think a way to help application writers
It would be good to add to GstTuner get_max_frequency, get_min_frequency, get_frequency_step (precision of set_frequency) anyway
I agree that the application should be responsible for the "auto-scan". I think it would be nice to add to GstTuner some get_max_signal_strength method. That way the application gets a signal range to work with it.
Ok, so. 1- scanning is up to the application 2- we need to add the following methods to GstTuner a- (int) get_max_frequency() - so application knows what the maximum value for 'set_frequency' (the next step would be loop around) b- (int) get_min_frequency() - to know the min value c- (step, units) get_frequency_step() - it is the resolution of the tuner * for all of them there is something similar in v4l2 spec 3- Danilo, instead of have a get_max_signal_strength, I think we could have pre-defined values (for example, from 0 to 100, or else from 0 to 1000). I mean just need to be documented in GstTuner interface, and the plugins would have to convert different strength ranges for it. * I think it is like this already for GstTuner (I'm not sure) * I think it is like this for v4l2 spec (ie there is a defined range)
Is anything happening in this bug, is this still a required feature?
I don't think so. My problem was solved a long time ago with a different approach that I can't remember right now.