* Re: About integer64
[not found] <200205091107.NAA14247@gate.perex.cz>
@ 2002-05-09 11:18 ` Jaroslav Kysela
2002-05-09 12:27 ` Abramo Bagnara
0 siblings, 1 reply; 6+ messages in thread
From: Jaroslav Kysela @ 2002-05-09 11:18 UTC (permalink / raw)
To: Paul Davis; +Cc: Abramo Bagnara, alsa-devel@lists.sourceforge.net
On Thu, 9 May 2002, Paul Davis wrote:
> >I don't think that's a bad thing to have support for 64 bit integers
> >(perhaps for future use, who knows), but I think that to use this to
> >store a fixed point float is a big mistake.
> >
> >If you think for it you realize that it's *not* an integer and
> >applications are betrayed in their expectation.
>
> in this case, it *is* an integer. your original question was about why
> its 64 bits - i think that comes from the fixed point internal
> arithmetic. but the end result is a straightforward 64 bit little
> endian integer that needs scaling to get the actual RMS value.
>
> which actually creates another problem that i've noticed with the
> control API. INTEGER and INTEGER64 assume that the control value is
> signed. there is no way to infer from the control element info that
> its unsigned. this isn't a "deep" problem, but it will mess up user
> interfaces that present a large unsigned value and end up displaying
> it as a negative number.
I think that we can add 'int unsign: 1;' to sndrv_ctl_elem_info for
integer and integer64. Any objections?
Jaroslav
-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project http://www.alsa-project.org
SuSE Linux http://www.suse.com
_______________________________________________________________
Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth@sourceforge.net
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: About integer64
2002-05-09 11:18 ` About integer64 Jaroslav Kysela
@ 2002-05-09 12:27 ` Abramo Bagnara
2002-05-09 12:59 ` Paul Davis
0 siblings, 1 reply; 6+ messages in thread
From: Abramo Bagnara @ 2002-05-09 12:27 UTC (permalink / raw)
To: Jaroslav Kysela; +Cc: Paul Davis, alsa-devel@lists.sourceforge.net
Jaroslav Kysela wrote:
>
> On Thu, 9 May 2002, Paul Davis wrote:
>
> > >I don't think that's a bad thing to have support for 64 bit integers
> > >(perhaps for future use, who knows), but I think that to use this to
> > >store a fixed point float is a big mistake.
> > >
> > >If you think for it you realize that it's *not* an integer and
> > >applications are betrayed in their expectation.
> >
> > in this case, it *is* an integer. your original question was about why
> > its 64 bits - i think that comes from the fixed point internal
> > arithmetic. but the end result is a straightforward 64 bit little
> > endian integer that needs scaling to get the actual RMS value.
> >
> > which actually creates another problem that i've noticed with the
> > control API. INTEGER and INTEGER64 assume that the control value is
> > signed. there is no way to infer from the control element info that
> > its unsigned. this isn't a "deep" problem, but it will mess up user
> > interfaces that present a large unsigned value and end up displaying
> > it as a negative number.
>
> I think that we can add 'int unsign: 1;' to sndrv_ctl_elem_info for
> integer and integer64. Any objections?
I'd avoid that.
About the problem Paul has shown the important thing is to know if all
64 bits are used. This is also the reason why I've asked the original
question: I can't imagine a quantity in audio problem space that need 64
bit of resolution and all the bits are significant and they make a
sensible difference.
However also if this is the case I'd prefer to have UINTEGER and/or
UINTEGER64.
--
Abramo Bagnara mailto:abramo@alsa-project.org
Opera Unica Phone: +39.546.656023
Via Emilia Interna, 140
48014 Castel Bolognese (RA) - Italy
ALSA project http://www.alsa-project.org
It sounds good!
_______________________________________________________________
Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth@sourceforge.net
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: About integer64
2002-05-09 12:27 ` Abramo Bagnara
@ 2002-05-09 12:59 ` Paul Davis
0 siblings, 0 replies; 6+ messages in thread
From: Paul Davis @ 2002-05-09 12:59 UTC (permalink / raw)
To: Abramo Bagnara; +Cc: Jaroslav Kysela, alsa-devel@lists.sourceforge.net
>However also if this is the case I'd prefer to have UINTEGER and/or
>UINTEGER64.
I agree. I would prefer specific types for unsigned controls, not an
extra bit to indicate this. imagine:
switch (control->type) {
case INTEGER:
if (control->unsigned) {
...
} else {
...
}
break;
versus:
switch (control->type) {
case INTEGER:
...
break;
case UINTEGER:
...
break;
i much prefer the latter.
--p
_______________________________________________________________
Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth@sourceforge.net
^ permalink raw reply [flat|nested] 6+ messages in thread
* About integer64
@ 2002-05-09 8:10 Abramo Bagnara
2002-05-09 10:37 ` Jaroslav Kysela
2002-05-09 11:07 ` Paul Davis
0 siblings, 2 replies; 6+ messages in thread
From: Abramo Bagnara @ 2002-05-09 8:10 UTC (permalink / raw)
To: Jaroslav Kysela, Paul Davis, alsa-devel
I don't think that's a bad thing to have support for 64 bit integers
(perhaps for future use, who knows), but I think that to use this to
store a fixed point float is a big mistake.
If you think for it you realize that it's *not* an integer and
applications are betrayed in their expectation.
I see two possible solutions:
1) convert internal representation to float (or double) and add support
for this type of data
2) use SNDRV_CTL_ELEM_TYPE_BYTES
As I've already said I prefer 1) but too 2) is far better that to have a
wrong use of a data type.
--
Abramo Bagnara mailto:abramo@alsa-project.org
Opera Unica Phone: +39.546.656023
Via Emilia Interna, 140
48014 Castel Bolognese (RA) - Italy
ALSA project http://www.alsa-project.org
It sounds good!
_______________________________________________________________
Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth@sourceforge.net
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: About integer64
2002-05-09 8:10 Abramo Bagnara
@ 2002-05-09 10:37 ` Jaroslav Kysela
2002-05-09 11:07 ` Paul Davis
1 sibling, 0 replies; 6+ messages in thread
From: Jaroslav Kysela @ 2002-05-09 10:37 UTC (permalink / raw)
To: Abramo Bagnara; +Cc: Paul Davis, alsa-devel@lists.sourceforge.net
On Thu, 9 May 2002, Abramo Bagnara wrote:
>
> I don't think that's a bad thing to have support for 64 bit integers
> (perhaps for future use, who knows), but I think that to use this to
> store a fixed point float is a big mistake.
>
> If you think for it you realize that it's *not* an integer and
> applications are betrayed in their expectation.
>
> I see two possible solutions:
> 1) convert internal representation to float (or double) and add support
> for this type of data
> 2) use SNDRV_CTL_ELEM_TYPE_BYTES
>
> As I've already said I prefer 1) but too 2) is far better that to have a
> wrong use of a data type.
I fully agree. We can add a float type when necessary, but only when it
follows IEEE-754. Hardware specific formats should be encapsulated into
more generic types...
Jaroslav
-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project http://www.alsa-project.org
SuSE Linux http://www.suse.com
_______________________________________________________________
Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth@sourceforge.net
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: About integer64
2002-05-09 8:10 Abramo Bagnara
2002-05-09 10:37 ` Jaroslav Kysela
@ 2002-05-09 11:07 ` Paul Davis
1 sibling, 0 replies; 6+ messages in thread
From: Paul Davis @ 2002-05-09 11:07 UTC (permalink / raw)
To: Abramo Bagnara; +Cc: Jaroslav Kysela, alsa-devel
>
>I don't think that's a bad thing to have support for 64 bit integers
>(perhaps for future use, who knows), but I think that to use this to
>store a fixed point float is a big mistake.
>
>If you think for it you realize that it's *not* an integer and
>applications are betrayed in their expectation.
in this case, it *is* an integer. your original question was about why
its 64 bits - i think that comes from the fixed point internal
arithmetic. but the end result is a straightforward 64 bit little
endian integer that needs scaling to get the actual RMS value.
which actually creates another problem that i've noticed with the
control API. INTEGER and INTEGER64 assume that the control value is
signed. there is no way to infer from the control element info that
its unsigned. this isn't a "deep" problem, but it will mess up user
interfaces that present a large unsigned value and end up displaying
it as a negative number.
--p
_______________________________________________________________
Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth@sourceforge.net
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-05-09 12:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <200205091107.NAA14247@gate.perex.cz>
2002-05-09 11:18 ` About integer64 Jaroslav Kysela
2002-05-09 12:27 ` Abramo Bagnara
2002-05-09 12:59 ` Paul Davis
2002-05-09 8:10 Abramo Bagnara
2002-05-09 10:37 ` Jaroslav Kysela
2002-05-09 11:07 ` Paul Davis
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.