All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Courtier-Dutton <James@superbug.co.uk>
To: Takashi Iwai <tiwai@suse.de>
Cc: Jaroslav Kysela <perex@suse.cz>,
	alsa-devel <alsa-devel@lists.sourceforge.net>
Subject: Re: [PATCH] Adds dB gain to alsa-driver, alsa-lib.
Date: Fri, 16 Dec 2005 13:47:43 +0000	[thread overview]
Message-ID: <43A2C57F.6020503@superbug.co.uk> (raw)
In-Reply-To: <s5hfyotyxws.wl%tiwai@suse.de>

Takashi Iwai wrote:
>>In my thoughts, I started with just the hint, then tried what Liam 
>>described (long before Liam described it. I think we all discussed it a 
>>some time ago.), and then when back to hint.
>>The "hint" is also a lot neater on the kernel side.
> 
> 
> Well, the composition of 4-bytes info can be done via a macro, so it's
> even more readable than a strange index.

How do you propose that 4 separate bytes composed will contain enough 
information. Some of the current volume controls range more than 0-255.

> 
> 
>>I am also looking forward to when we finally do have a card-mixer.conf 
>>config file. We would then put all the conversion function information 
>>in there.
> 
> 
> This will result in the bloat exactly as same as you pointed in your
> last mail.

But a lot less bloat than the alternative or user land only.

> 
> 
>> So, when a new card driver appears, one also adds the alsa-lib 
>>card-pcm.conf and card-mixer.conf and you are done. We already have to 
>>add the card-pcm.conf file with each new sound card type, so it is not 
>>adding much bloat.
> 
> 
> If you introduce the extra data and the extra parsing/handling codes
> for each driver/control type, then there is no merit to embed the
> information in the kernel at all.  The only merit to have information
> in the kernel is to reduce the total size.

Untrue, it will still result is a lot less bloat than a user land only 
solution

> 
> 
>>The "hint" is also perfect for the "reverse conversion" requirement. The 
>>same "hint" can be the index into the "reverse conversion function" 
>>lookup as well as the "forward conversion function".
> 
> 
> Ditto for the composed info.  It's pretty reversible.
> 
> The composed information is not perfect at all.  But it can conver
> most things.  That's the point.

We can't ignore the edge cases where the composed information will not 
be suitable. How do you propose to support them?

> 
> 
> 
>>>In addition, some suggestions/questions about your patch:
>>>
>>>- The name snd_ctl_misc sounds too ambiguous
>>
>>The name "snd_ctl_misc" could be anything. It is not dB specific, 
>>because that same ioctl could be used for other things. Don't know what 
>>yet, but some future requirement might need it. I suppose we could call 
>>is "snd_ctl_tlv" but that is about as descriptive as "snd_ctl_misc"
> 
> 
> Sure, I understood that it's to be generic.  But, snd_ctl_misc...
> misc what?  I'd better understand if it's called snd_ctl_misc_info.
> Anyway, I leave this decision to native english speaker.
> 
> 
>>>- (in kernel) Move the dB-specific stuff out of snd_ctl_elem_misc_user()
>>
>>Do you just mean move the dB-specific stuff out to it's own function.
>>I just figured to leave it there for now, as it is quite short. If it 
>>gets more complicated, we can break it up.
> 
> 
> The current code looks messy and far from the concenpt to be generic.
> 
> 
>>>- TLV parser (e.g. uint32_to_message) should be more optimized :)
>>
>>True, but hardly important at this stage.
> 
> 
> For example, you call kmalloc at each time for this ioctl.  This can
> be better done by direct read. 
> Such implementation details may influence on the definition,
> e.g. reducing the struct size, etc.
> 
> 
>>>- As Jaroslav pointed, the parsing of dB information should be in the
>>>  mixer layer instead of [h]control.
>>
>>No problem, so move the stuff from
>>hcontrol.c:snd_hctl_elem_get_db_gain
>>to
>>simple_none.c:get_dB_ops
>>or some extra sub function in simple_none.c
>>
>>If you mean move the parsing done in
>>control.c:snd_ctl_elem_get_db_scale
>>out to simple_none.c, then I don't think we can do that.
>>The snd_ctl_misc_t is only visible to control.c.
> 
> 
> How about to simply pass snd_ctl_misc_t to the higher layer?
> We don't have to export this function to external.
> 

I thought one of the points of the layers was to hide stuff below it.
Your suggestion just breaks that.

> 
> Takashi
> 
> 



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

  reply	other threads:[~2005-12-16 13:47 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-15 18:34 [PATCH] Adds dB gain to alsa-driver, alsa-lib James Courtier-Dutton
2005-12-15 18:58 ` Lee Revell
2005-12-15 19:06   ` James Courtier-Dutton
2005-12-15 19:16     ` Lee Revell
2005-12-15 19:13 ` Jaroslav Kysela
2005-12-15 19:45   ` James Courtier-Dutton
2005-12-16 10:27     ` Takashi Iwai
2005-12-16 10:47       ` James Courtier-Dutton
2005-12-16 12:05         ` Takashi Iwai
2005-12-16 12:14           ` Jaroslav Kysela
2005-12-16 12:43           ` James Courtier-Dutton
2005-12-16 13:27             ` Takashi Iwai
2005-12-16 13:47               ` James Courtier-Dutton [this message]
2005-12-16 14:11                 ` Takashi Iwai
2005-12-16 14:11                   ` Jaroslav Kysela
2005-12-16 14:55                     ` Liam Girdwood
2005-12-16 11:09       ` Liam Girdwood
2005-12-16 12:37     ` Jaroslav Kysela
2005-12-16 13:08       ` James Courtier-Dutton
2005-12-16 14:05         ` Jaroslav Kysela
2005-12-16 14:24   ` Takashi Iwai
2005-12-15 19:32 ` Liam Girdwood
2005-12-15 19:48   ` James Courtier-Dutton
2005-12-16 10:49     ` Liam Girdwood

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=43A2C57F.6020503@superbug.co.uk \
    --to=james@superbug.co.uk \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=perex@suse.cz \
    --cc=tiwai@suse.de \
    /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.