All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] alsa-lib: Add option to allow calculations in float for soft float targets
@ 2016-05-07  6:45 Jörg Krause
  2016-05-07  7:16 ` Thomas Petazzoni
  2016-07-04 19:48 ` Peter Korsgaard
  0 siblings, 2 replies; 6+ messages in thread
From: Jörg Krause @ 2016-05-07  6:45 UTC (permalink / raw)
  To: buildroot

The `--with-softfloat` config option is a little bit misleading as it actually
means: "avoid calculations in float" [1].

Add a menu config option to allow floating point emulation for soft float
targets. This option is enabled by default for soft float targets.

[1]
http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=configure.ac;h=c265ec9e159bdf76a6829ab8f7d625ac72b25501;#l226

Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
---
 package/alsa-lib/Config.in   | 6 ++++++
 package/alsa-lib/alsa-lib.mk | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/package/alsa-lib/Config.in b/package/alsa-lib/Config.in
index 97e8489..8c50e4f 100644
--- a/package/alsa-lib/Config.in
+++ b/package/alsa-lib/Config.in
@@ -33,6 +33,12 @@ config BR2_PACKAGE_ALSA_LIB_DEVDIR
 	string "directory with ALSA device files"
 	default "/dev/snd"
 
+config BR2_PACKAGE_ALSA_LIB_NO_FLOAT
+	bool "Avoid calculation in float"
+	default y if BR2_SOFT_FLOAT
+	help
+	  Disables all calculations requiring floating point routines.
+
 config BR2_PACKAGE_ALSA_LIB_PCM_PLUGINS
 	string "built PCM plugins"
 	default "all" if BR2_USE_MMU
diff --git a/package/alsa-lib/alsa-lib.mk b/package/alsa-lib/alsa-lib.mk
index ae0377d..b065a54 100644
--- a/package/alsa-lib/alsa-lib.mk
+++ b/package/alsa-lib/alsa-lib.mk
@@ -62,7 +62,7 @@ else
 ALSA_LIB_CONF_OPTS += --disable-python
 endif
 
-ifeq ($(BR2_SOFT_FLOAT),y)
+ifeq ($(BR2_PACKAGE_ALSA_LIB_NO_FLOAT),y)
 ALSA_LIB_CONF_OPTS += --with-softfloat
 endif
 
-- 
2.8.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] alsa-lib: Add option to allow calculations in float for soft float targets
  2016-05-07  6:45 [Buildroot] [PATCH] alsa-lib: Add option to allow calculations in float for soft float targets Jörg Krause
@ 2016-05-07  7:16 ` Thomas Petazzoni
  2016-05-08 12:33   ` Jörg Krause
  2016-07-04 19:48 ` Peter Korsgaard
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2016-05-07  7:16 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat,  7 May 2016 08:45:25 +0200, J?rg Krause wrote:

> -ifeq ($(BR2_SOFT_FLOAT),y)
> +ifeq ($(BR2_PACKAGE_ALSA_LIB_NO_FLOAT),y)
>  ALSA_LIB_CONF_OPTS += --with-softfloat
>  endif

So we were already passing --with-softfloat when BR2_SOFT_FLOAT=y. So
what your option brings is:

 - Ability to use floating point operations when BR2_SOFT_FLOAT=y.

 - Ability to not use floating point operations when BR2_SOFT_FLOAT is
   disabled.

Do you have any actual use for such possibilities ?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] alsa-lib: Add option to allow calculations in float for soft float targets
  2016-05-07  7:16 ` Thomas Petazzoni
@ 2016-05-08 12:33   ` Jörg Krause
  2016-05-08 19:53     ` Arnout Vandecappelle
  0 siblings, 1 reply; 6+ messages in thread
From: Jörg Krause @ 2016-05-08 12:33 UTC (permalink / raw)
  To: buildroot

On Sa, 2016-05-07 at 09:16 +0200, Thomas Petazzoni wrote:
> Hello,
> 
> On Sat,??7 May 2016 08:45:25 +0200, J?rg Krause wrote:
> 
> > -ifeq ($(BR2_SOFT_FLOAT),y)
> > +ifeq ($(BR2_PACKAGE_ALSA_LIB_NO_FLOAT),y)
> > ?ALSA_LIB_CONF_OPTS += --with-softfloat
> > ?endif
> 
> So we were already passing --with-softfloat when BR2_SOFT_FLOAT=y. So
> what your option brings is:
> 
> ?- Ability to use floating point operations when BR2_SOFT_FLOAT=y.
> 
> ?- Ability to not use floating point operations when BR2_SOFT_FLOAT
> is
> ???disabled.
> 
> Do you have any actual use for such possibilities ?

Yes, for the first case.

I want to use a feature from the alsa-lib which is opted-out at compile
time for softfloat targets by #ifndef HAVE_SOFT_FLOAT [1]. This
functionality requires floating point data types and libmath
operations.

I do not see any point in disabling this unconditionally for softfloat
targets, as a?software floating point library can emulate this.

[1]
http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/pcm/pcm_softvo
l.c;h=802aa4b7cb68e444b8b47e7140870141aad65ffc;hb=HEAD#l785

Best regards
J?rg Krause

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] alsa-lib: Add option to allow calculations in float for soft float targets
  2016-05-08 12:33   ` Jörg Krause
@ 2016-05-08 19:53     ` Arnout Vandecappelle
  2016-05-09  7:38       ` Jörg Krause
  0 siblings, 1 reply; 6+ messages in thread
From: Arnout Vandecappelle @ 2016-05-08 19:53 UTC (permalink / raw)
  To: buildroot

On 05/08/16 14:33, J?rg Krause wrote:
> On Sa, 2016-05-07 at 09:16 +0200, Thomas Petazzoni wrote:
>> Hello,
>>
>> On Sat,  7 May 2016 08:45:25 +0200, J?rg Krause wrote:
>>
>>> -ifeq ($(BR2_SOFT_FLOAT),y)
>>> +ifeq ($(BR2_PACKAGE_ALSA_LIB_NO_FLOAT),y)
>>>  ALSA_LIB_CONF_OPTS += --with-softfloat
>>>  endif
>>
>> So we were already passing --with-softfloat when BR2_SOFT_FLOAT=y. So
>> what your option brings is:
>>
>>  - Ability to use floating point operations when BR2_SOFT_FLOAT=y.
>>
>>  - Ability to not use floating point operations when BR2_SOFT_FLOAT
>> is
>>    disabled.
>>
>> Do you have any actual use for such possibilities ?
>
> Yes, for the first case.
>
> I want to use a feature from the alsa-lib which is opted-out at compile
> time for softfloat targets by #ifndef HAVE_SOFT_FLOAT [1]. This
> functionality requires floating point data types and libmath
> operations.
>
> I do not see any point in disabling this unconditionally for softfloat
> targets, as a software floating point library can emulate this.

  The question is: is there a point in disabling it at all, ever? Does it have a 
big impact on size, or does it require functionality which may not be available 
for a particular target arch?

  If not, I'd vote for unconditionally disabling the softfloat option.

  That said, I remember that there was some option (not sure if it was alsalib 
or another lib) to choose between floating point (accurate but slower) and fixed 
point (less accurate but faster) for some filtering operations. *That* would be 
a relevant user-settable option.

  Regards,
  Arnout


>
> [1]
> http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/pcm/pcm_softvo
> l.c;h=802aa4b7cb68e444b8b47e7140870141aad65ffc;hb=HEAD#l785
>
> Best regards
> J?rg Krause
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] alsa-lib: Add option to allow calculations in float for soft float targets
  2016-05-08 19:53     ` Arnout Vandecappelle
@ 2016-05-09  7:38       ` Jörg Krause
  0 siblings, 0 replies; 6+ messages in thread
From: Jörg Krause @ 2016-05-09  7:38 UTC (permalink / raw)
  To: buildroot

On So, 2016-05-08 at 21:53 +0200, Arnout Vandecappelle wrote:
> On 05/08/16 14:33, J?rg Krause wrote:
> > On Sa, 2016-05-07 at 09:16 +0200, Thomas Petazzoni wrote:
> > > Hello,
> > > 
> > > On Sat,??7 May 2016 08:45:25 +0200, J?rg Krause wrote:
> > > 
> > > > -ifeq ($(BR2_SOFT_FLOAT),y)
> > > > +ifeq ($(BR2_PACKAGE_ALSA_LIB_NO_FLOAT),y)
> > > > ?ALSA_LIB_CONF_OPTS += --with-softfloat
> > > > ?endif
> > > 
> > > So we were already passing --with-softfloat when
> > > BR2_SOFT_FLOAT=y. So
> > > what your option brings is:
> > > 
> > > ?- Ability to use floating point operations when
> > > BR2_SOFT_FLOAT=y.
> > > 
> > > ?- Ability to not use floating point operations when
> > > BR2_SOFT_FLOAT
> > > is
> > > ???disabled.
> > > 
> > > Do you have any actual use for such possibilities ?
> > 
> > Yes, for the first case.
> > 
> > I want to use a feature from the alsa-lib which is opted-out at
> > compile
> > time for softfloat targets by #ifndef HAVE_SOFT_FLOAT [1]. This
> > functionality requires floating point data types and libmath
> > operations.
> > 
> > I do not see any point in disabling this unconditionally for
> > softfloat
> > targets, as a software floating point library can emulate this.
> 
> ? The question is: is there a point in disabling it at all, ever?
> Does it have a?
> big impact on size, or does it require functionality which may not be
> available?
> for a particular target arch?

No, it does not. Setting softfloat only disables functionality using
floating point types and routines.

> ? If not, I'd vote for unconditionally disabling the softfloat
> option.

I agree. However, this changes the current behaviour how alsa-lib is
build for soft-float targets. That's why I added an option which
preserves the current configuration.

> ? That said, I remember that there was some option (not sure if it
> was alsalib?
> or another lib) to choose between floating point (accurate but
> slower) and fixed?
> point (less accurate but faster) for some filtering operations.
> *That* would be?
> a relevant user-settable option.

Yes, but it does not apply to alsa-lib.

Best regards
J?rg Krause

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH] alsa-lib: Add option to allow calculations in float for soft float targets
  2016-05-07  6:45 [Buildroot] [PATCH] alsa-lib: Add option to allow calculations in float for soft float targets Jörg Krause
  2016-05-07  7:16 ` Thomas Petazzoni
@ 2016-07-04 19:48 ` Peter Korsgaard
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2016-07-04 19:48 UTC (permalink / raw)
  To: buildroot

>>>>> "J?rg" == J?rg Krause <joerg.krause@embedded.rocks> writes:

 > The `--with-softfloat` config option is a little bit misleading as it actually
 > means: "avoid calculations in float" [1].

 > Add a menu config option to allow floating point emulation for soft float
 > targets. This option is enabled by default for soft float targets.

 > [1]
 > http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=configure.ac;h=c265ec9e159bdf76a6829ab8f7d625ac72b25501;#l226

 > Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>

I had a look and the size difference is really quite small (65K):

-rwxr-xr-x 1 peko peko 774K Jul  4 18:50 target-orig/usr/lib/libasound.so.2.0.0
-rwxr-xr-x 1 peko peko 709K Jul  4 19:08 target-softfloat/usr/lib/libasound.so.2.0.0

So having an option for it imho doesn't make any sense.

The size difference basically all comes from the fact that the lfloat and
ladspa get disabled when --with-softfloat is passed. If these are
manually disabled (instead of passing all) the extra bloat is gone:

-rwxr-xr-x 1 peko peko 709K Jul  4 19:08 target-softfloat/usr/lib/libasound.so.2.0.0
-rwxr-xr-x 1 peko peko 709K Jul  4 21:34 target/usr/lib/libasound.so.2.0.0

So I've simply dropped --with-softfloat and marked this patch as
rejected.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-07-04 19:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-07  6:45 [Buildroot] [PATCH] alsa-lib: Add option to allow calculations in float for soft float targets Jörg Krause
2016-05-07  7:16 ` Thomas Petazzoni
2016-05-08 12:33   ` Jörg Krause
2016-05-08 19:53     ` Arnout Vandecappelle
2016-05-09  7:38       ` Jörg Krause
2016-07-04 19:48 ` Peter Korsgaard

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.