From: Ondrej Zary <linux@rainbow-software.org>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org, alsa-devel@alsa-project.org,
Kernel development list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RFC v2] radio-sf16fmr2: convert to generic TEA575x interface
Date: Tue, 17 May 2011 22:05:26 +0200 [thread overview]
Message-ID: <201105172205.28899.linux@rainbow-software.org> (raw)
In-Reply-To: <201105172133.14835.hverkuil@xs4all.nl>
On Tuesday 17 May 2011 21:33:14 Hans Verkuil wrote:
> Hi Ondrej!
>
> On Sunday, May 15, 2011 23:26:33 Hans Verkuil wrote:
> > On Sunday, May 15, 2011 22:18:21 Ondrej Zary wrote:
> > > Thanks, it's much simpler with the new control framework.
> > > Do the negative volume control values make sense? The TC9154A chip can
> > > attenuate the volume from 0 to -68dB in 2dB steps.
> >
> > It does make sense, but I think I would offset the values so they start
> > at 0. Mostly because there might be some old apps that set the volume to
> > 0 when they want to mute, which in this case is full volume.
> >
> > I am not aware of any driver where a volume of 0 isn't the same as the
> > lowest volume possible, so in this particular case I would apply an
> > offset.
> >
> > I will have to do a closer review tomorrow or the day after. I think
> > there are a few subtleties that I need to look at. Ping me if you haven't
> > heard from me by Wednesday. I would really like to get these drivers up
> > to spec now that I have someone who can test them, and once that's done I
> > hope that I never have to look at them again :-) (Unlikely, but one can
> > dream...)
>
> OK, I looked at it a bit more and it needs to be changed a little bit. The
> problem is that the VOLUME control is added after snd_tea575x_init, i.e.
> after the video_register_device call. The video_register_device call should
> be the last thing done before the init sequence returns. There may be
> applications (dbus/hal) that open devices as soon as they appear, so doing
> more initialization after the video node is registered is not a good idea
> (many older V4L drivers make this mistake).
>
> Perhaps creating a snd_tea575x_register function doing just the
> registration may be a good idea. Or a callback before doing the
> video_register_device.
OK, I'll reorder the lines in snd_tea575x_init function and add a callback
that radio-sf16fmr2 can use.
Also upgraded my card with TC9154AP chip so I can actually test the volume
control code (and it was broken in my previous patch...). The left and right
channels can be separately controlled - is there a way to provide separate
left and right volume controls? Or do I need to fake up a balance control?
> Another thing: the tea->mute field shouldn't be needed anymore. And the
> 'mute on init' bit in snd_tea575x_init can be removed as well since that
> is automatically performed by v4l2_ctrl_handler_setup.
Thought about this too but the snd_tea575x_write() and snd_tea575x_read()
functions need to know the mute status. And these functions are also used to
detect the tuner presence before initializing the controls. I don't see any
elegant solution.
> In addition, the .ioctl field in tea575x_fops can be replaced by
> .unlocked_ioctl. The whole exclusive open stuff and the in_use field can be
> removed. The only thing needed is a struct mutex in struct snd_tea575x,
> initialize it and set tea575x_radio_inst->lock to the mutex. This will
> serialize all access safely.
I'll do this as a separate patch later.
> To do this really right you should add struct v4l2_device to struct
> snd_tea575x (the radio-sf16fmr2 driver has one, so you can use that as an
> example). With that in place you can also add support for 'priority'
> handling. I'd say see what you can do, and if it takes too much time then
> mail me the tea575x code and the radio-sf16frm2 code and I'll finish it.
>
> Regards,
>
> Hans
--
Ondrej Zary
next prev parent reply other threads:[~2011-05-17 20:05 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-13 22:17 [PATCH RFC] radio-sf16fmr2: convert to generic TEA575x interface Ondrej Zary
2011-05-14 10:01 ` [alsa-devel] " Takashi Iwai
2011-05-14 10:06 ` Hans Verkuil
2011-05-15 19:41 ` [PATCH RFC] tea575x: convert to control framework Ondrej Zary
2011-05-15 20:18 ` [PATCH RFC v2] radio-sf16fmr2: convert to generic TEA575x interface Ondrej Zary
2011-05-15 21:26 ` Hans Verkuil
2011-05-17 19:33 ` Hans Verkuil
2011-05-17 20:05 ` Ondrej Zary [this message]
2011-05-18 6:26 ` Hans Verkuil
2011-05-18 21:38 ` [PATCH v4] " Ondrej Zary
2011-05-17 21:45 ` [PATCH RFC v2] tea575x: convert to control framework Ondrej Zary
2011-05-18 6:21 ` Hans Verkuil
2011-05-18 19:36 ` [PATCH v3] " Ondrej Zary
2011-05-18 20:25 ` Hans Verkuil
2011-05-18 21:35 ` [PATCH v4] " Ondrej Zary
2011-05-19 6:45 ` Hans Verkuil
2011-05-19 16:11 ` [PATCH v5] " Ondrej Zary
2011-05-19 20:54 ` Hans Verkuil
2011-05-19 16:15 ` [PATCH v5] radio-sf16fmr2: convert to generic TEA575x interface Ondrej Zary
2011-05-19 20:56 ` Hans Verkuil
2011-05-17 21:45 ` [PATCH RFC v3] " Ondrej Zary
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=201105172205.28899.linux@rainbow-software.org \
--to=linux@rainbow-software.org \
--cc=alsa-devel@alsa-project.org \
--cc=hverkuil@xs4all.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).