All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	linux-media@vger.kernel.org,
	halli manjunatha <hallimanju@gmail.com>,
	Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [RFCv2 PATCH 4/6] videodev2.h: add frequency band information.
Date: Sat, 23 Jun 2012 08:41:42 +0200	[thread overview]
Message-ID: <4FE56526.3060501@redhat.com> (raw)
In-Reply-To: <4FE49A32.3060307@redhat.com>

Hi,

On 06/22/2012 06:15 PM, Mauro Carvalho Chehab wrote:
> Em 22-06-2012 11:07, Hans Verkuil escreveu:

<snip>

>>> Reusing G_TUNER/S_TUNER or not, the issue is that a bitfield parameter for
>>> frequency range is not actually able to express what are the supported
>>> ranges. As I said before, the tuner ranges can only be properly expressed
>>> by an array with:
>>> 	- range low/high;
>>> 	- modulation (AM, FM, ...);
>>> 	- sub-carriers (mono, stereo, lang1, lang2);
>>> 	- properties (RDS, seek caps, ...).
>>
>> Agreed.
>>
>> So, in my opinion we still need the band field, but instead of this being a
>> fixed band it is an index.
>>
>> In order to enumerate over all bands I propose a new ioctl:
>>
>> VIDIOC_ENUM_TUNER_BAND
>>
>> with struct:
>>
>> struct v4l2_tuner_band {
>> 	__u32 tuner;
>> 	__u32 index;
>> 	char name[32];
>> 	__u32 capability;	/* The same as in v4l2_tuner */
>> 	__u32 rangelow;
>> 	__u32 rangehigh;
>> 	__u32 reserved[7];
>> };
>>
>> It enumerates the supported bands by the tuner, each with a human readable name,
>> frequency range and capabilities.
>>
>> If you change the band using S_TUNER, then G_TUNER will return the frequency range
>> and capabilities from the corresponding v4l2_tuner_band struct.
>>
>> The only capability that needs to be added is one that tells the application that
>> the tuner has the capability to do band enumeration (V4L2_TUNER_CAP_HAS_BANDS or
>> something).
>>
>> I am not 100% certain about the name field: it is very nice for apps, but we do
>> need some guidelines here.
>>
>> A similar struct would be needed for modulators if we ever need to add support for
>> modulators with multiple bands.
>>
>> We could perhaps rename v4l2_tuner_band to just v4l2_band to make it tuner/modulator
>> agnostic.

I've not replied before because I've been thinking about Hans V's proposal for a bit,
I've come to the conclusion that Hans V's proposal is better, because it avoids a
discrepancy in how tuners work between tv and radio, which is something which worried
me about my own proposal. Hans V's proposal also has the benefit that it will work fine
for tv-tuners too, so if we ever need bands for tv tuners we can use the *same* API.

> The above proposal would be great if we were starting to write the radio API today, but
> your proposal is not backward compatible with the status quo.

Huh? Hans V. is proposing adding a band field to the tuner struct (using one of the
reserved fields) and adding a new ioctl to enumerate bands. Old apps will have that field
set to 0 on a S_TUNER, selecting band 0, and G_TUNER will give info on the current band,
where-as S/G_FREQ will be unmodified (they will work on the current band). I don't see how
this breaks current apps...

Anyways both proposals seem workable to me, although I prefer Hans V.'s one. Lets just pick
one and get on with this.

Regards,

Hans




>
> Regards,
> Mauro
>


  reply	other threads:[~2012-06-23  6:36 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-28 10:46 [RFCv2 PATCH 0/5] Add hwseek caps and frequency bands Hans Verkuil
2012-05-28 10:46 ` [RFCv2 PATCH 1/6] videodev2.h: add new hwseek capability bits Hans Verkuil
2012-05-28 10:46   ` [RFCv2 PATCH 2/6] v4l2 spec: document the new v4l2_tuner capabilities Hans Verkuil
2012-05-28 10:46   ` [RFCv2 PATCH 3/6] S_HW_FREQ_SEEK: set capability flags and return ENODATA instead of EAGAIN Hans Verkuil
2012-05-28 10:46   ` [RFCv2 PATCH 4/6] videodev2.h: add frequency band information Hans Verkuil
2012-06-19  0:47     ` Mauro Carvalho Chehab
2012-06-19  8:27       ` Hans de Goede
2012-06-19 11:09         ` Mauro Carvalho Chehab
2012-06-19 12:36           ` Hans de Goede
2012-06-19 13:31             ` halli manjunatha
2012-06-19 15:41               ` Mauro Carvalho Chehab
2012-06-19 16:25                 ` halli manjunatha
2012-06-19 14:14             ` Mauro Carvalho Chehab
2012-06-19 16:47               ` Hans de Goede
2012-06-19 17:33                 ` Hans de Goede
2012-06-19 17:43                   ` halli manjunatha
2012-06-19 19:19                     ` Hans de Goede
2012-06-19 18:23                   ` Hans Verkuil
2012-06-22 14:07               ` Hans Verkuil
2012-06-22 16:15                 ` Mauro Carvalho Chehab
2012-06-23  6:41                   ` Hans de Goede [this message]
2012-05-28 10:46   ` [RFCv2 PATCH 5/6] V4L2 spec: add frequency band documentation Hans Verkuil
2012-05-28 10:46   ` [RFCv2 PATCH 6/6] V4L2 spec: clarify a few modulator issues Hans Verkuil
2012-05-28 11:20 ` [RFCv2 PATCH 0/5] Add hwseek caps and frequency bands Hans de Goede
2012-05-28 11:58   ` Hans Verkuil
2012-05-29  8:21     ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FE56526.3060501@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=hallimanju@gmail.com \
    --cc=hans.verkuil@cisco.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.