Skip to contentSkip to conversation

Alsa lib configure asoundlib.h

DISCUSSION Fausto Carvalho Marques SIlva 4 participants 12 messages Jul 5, 2007 – Jul 11, 2007

lore
Share & tools
lore
#0 lore raw

In salsa library(this library really saved my life, from am alsa-lib of 600K to 45K!!!), developed by Takashi Iwai, the creation of asoundlib.h is dynamic and based on the configure options ( --disable-mixer will remove mixer.h from asoundlib.h).
Can alsa-lib do the same??I think it is a good "cleanup" way of doing client header files.

Example from configure.ac from salsa-0.0.6:

"
echo "Creating asoundlib.h..."
cp "$srcdir"/src/asoundlib-head.h src/asoundlib.h
test "$mixer" = "yes" && echo "#include \"mixer.h\"" >> src/asoundlib.h test "$rawmidi" = "yes" && echo "#include \"rawmidi.h\"" >> src/asoundlib.h test "$hwdep" = "yes" && echo "#include \"hwdep.h\"" >> src/asoundlib.h test "$timer" = "yes" && echo "#include \"timer.h\"" >> src/asoundlib.h test "$sndconf" = "yes" && echo "#include \"conf.h\"" >> src/asoundlib.h test "$sndseq" = "yes" && echo "#include \"seq_event.h\"" >> src/asoundlib.h test "$sndseq" = "yes" && echo "#include \"seq.h\"" >> src/asoundlib.h test "$sndseq" = "yes" && echo "#include \"seqmid.h\"" >> src/asoundlib.h cat "$srcdir"/src/asoundlib-tail.h >> src/asoundlib.h
"

Fausto Carvalho Marques Silva

#1 lore raw

At Thu, 05 Jul 2007 12:15:06 -0300,

Quoted 10 lines · Fausto Carvalho Marques SIlva

In salsa library(this library really saved my life, from am alsa-lib of 600K to 45K!!!), developed by Takashi Iwai, the creation of asoundlib.h is dynamic and based on the configure options ( --disable-mixer will remove mixer.h from asoundlib.h).
Can alsa-lib do the same??I think it is a good "cleanup" way of doing client header files.

Example from configure.ac from salsa-0.0.6:

Quoted 13 lines

"
echo "Creating asoundlib.h..."
cp "$srcdir"/src/asoundlib-head.h src/asoundlib.h
test "$mixer" = "yes" && echo "#include \"mixer.h\"" >> src/asoundlib.h test "$rawmidi" = "yes" && echo "#include \"rawmidi.h\"" >> src/asoundlib.h test "$hwdep" = "yes" && echo "#include \"hwdep.h\"" >> src/asoundlib.h test "$timer" = "yes" && echo "#include \"timer.h\"" >> src/asoundlib.h test "$sndconf" = "yes" && echo "#include \"conf.h\"" >> src/asoundlib.h test "$sndseq" = "yes" && echo "#include \"seq_event.h\"" >> src/asoundlib.h test "$sndseq" = "yes" && echo "#include \"seq.h\"" >> src/asoundlib.h test "$sndseq" = "yes" && echo "#include \"seqmid.h\"" >> src/asoundlib.h cat "$srcdir"/src/asoundlib-tail.h >> src/asoundlib.h
"

Yeah, it's feasible, but a lower priority work.
I'll fix them later... Or, it'd be great if you send a patch ;)

Takashi

#2 lore raw

At Fri, 06 Jul 2007 11:46:59 +0200,

Quoted 27 lines · I wrote:

At Thu, 05 Jul 2007 12:15:06 -0300,

Quoted 10 lines · Fausto Carvalho Marques SIlva

In salsa library(this library really saved my life, from am alsa-lib of 600K to 45K!!!), developed by Takashi Iwai, the creation of asoundlib.h is dynamic and based on the configure options ( --disable-mixer will remove mixer.h from asoundlib.h).
Can alsa-lib do the same??I think it is a good "cleanup" way of doing client header files.

Example from configure.ac from salsa-0.0.6:

Quoted 13 lines

"
echo "Creating asoundlib.h..."
cp "$srcdir"/src/asoundlib-head.h src/asoundlib.h
test "$mixer" = "yes" && echo "#include \"mixer.h\"" >> src/asoundlib.h test "$rawmidi" = "yes" && echo "#include \"rawmidi.h\"" >> src/asoundlib.h test "$hwdep" = "yes" && echo "#include \"hwdep.h\"" >> src/asoundlib.h test "$timer" = "yes" && echo "#include \"timer.h\"" >> src/asoundlib.h test "$sndconf" = "yes" && echo "#include \"conf.h\"" >> src/asoundlib.h test "$sndseq" = "yes" && echo "#include \"seq_event.h\"" >> src/asoundlib.h test "$sndseq" = "yes" && echo "#include \"seq.h\"" >> src/asoundlib.h test "$sndseq" = "yes" && echo "#include \"seqmid.h\"" >> src/asoundlib.h cat "$srcdir"/src/asoundlib-tail.h >> src/asoundlib.h
"

Quoted 2 lines

Yeah, it's feasible, but a lower priority work.
I'll fix them later... Or, it'd be great if you send a patch ;)

Fixed on HG tree now.

Takashi

#3 lore raw
Quoted 4 lines · Takashi Iwai

At Fri, 06 Jul 2007 11:46:59 +0200,

Quoted 1 line · I wrote:
Quoted 11 lines
Quoted 4 lines

At Thu, 05 Jul 2007 12:15:06 -0300,

Quoted 2 lines · Fausto Carvalho Marques SIlva

In salsa library(this library really saved my life, from am alsa-lib

of

Quoted 1 line
Quoted 1 line

600K to 45K!!!), developed by Takashi Iwai, the creation of

asoundlib.h

Quoted 4 lines
Quoted 4 lines

is dynamic and based on the configure options ( --disable-mixer will remove mixer.h from asoundlib.h).
Can alsa-lib do the same??I think it is a good "cleanup" way of doing client header files.

I really like the idea of Salsa as well. I have built both ALSA-libs and SALSA-libs for my ARM SoC system. However, there are a lot of features I am sure I do not need, e.g. mixer. I would like to build the minimal SALSA system for playing and capturing audio through a PCM interface. The audio is mono, 8k sample rate with no sw audio control, etc. What tags can I add to get the smallest possible SALSA build. Currently I am doing this:

CC=arm-linux-gcc ./configure --target=arm-linux --host=i686-pc-linux-gnu --with-versioned=no --disable-mixer

then

make install DESTDIR=$HOME/Linux_Builds/buildroot/build_arm/root/

But am still getting about a 400k addition to my rootfs. Anyway to make that smaller?

Thanks.

Paul

Signature · 7 lines
***************************************
Paul David Kavan
Project Engineer
GRH Electronics, Inc.
402-734-4900
[email protected]
***************************************
#4 lore raw

Paul Kavan wrote

Quoted 13 lines

<>I really like the idea of Salsa as well. I have built both ALSA-libs and SALSA-libs for my ARM SoC system. However, there are a lot of features I am
sure I do not need, e.g. mixer. I would like to build the minimal SALSA system for playing and capturing audio through a PCM interface. The audio is
mono, 8k sample rate with no sw audio control, etc. What tags can I add to get the smallest possible SALSA build. Currently I am doing this:

CC=arm-linux-gcc ./configure --target=arm-linux --host=i686-pc-linux-gnu --with-versioned=no --disable-mixe
then

Quoted 5 lines

make install DESTDIR=$HOME/Linux_Builds/buildroot/build_arm/root/

But am still getting about a 400k addition to my rootfs. Anyway to make that
smaller?

Alsa-lib is really big... I could make it in 340K but Salsa-lib is 45K (stripped and dynamic).
The default compilation of salsa-lib gives a 166K(with strip turns to 45K) you could remove more things like:
--diable-mixer, but i think is only this...(35K without mixer)

Teh

Quoted 4 lines

<>
Thanks.

Paul

#5 lore raw
In reply to Paul Kavan
Quoted 29 lines · On Tue, 10 Jul 2007 10:05:12 -0500 "Paul Kavan" <[email protected]> wrote:
Quoted 4 lines · Takashi Iwai

At Fri, 06 Jul 2007 11:46:59 +0200,

Quoted 1 line · I wrote:
Quoted 11 lines
Quoted 4 lines

At Thu, 05 Jul 2007 12:15:06 -0300,

Quoted 2 lines · Fausto Carvalho Marques SIlva

In salsa library(this library really saved my life, from am alsa-lib

of

Quoted 1 line
Quoted 1 line

600K to 45K!!!), developed by Takashi Iwai, the creation of

asoundlib.h

Quoted 4 lines
Quoted 4 lines

is dynamic and based on the configure options ( --disable-mixer will remove mixer.h from asoundlib.h).
Can alsa-lib do the same??I think it is a good "cleanup" way of doing client header files.

I really like the idea of Salsa as well. I have built both ALSA-libs and SALSA-libs for my ARM SoC system. However, there are a lot of features I am sure I do not need, e.g. mixer. I would like to build the minimal SALSA system for playing and capturing audio through a PCM interface. The audio is mono, 8k sample rate with no sw audio control, etc. What tags can I add to get the smallest possible SALSA build. Currently I am doing this:

CC=arm-linux-gcc ./configure --target=arm-linux --host=i686-pc-linux-gnu --with-versioned=no --disable-mixer

Quoted 6 lines

then

make install DESTDIR=$HOME/Linux_Builds/buildroot/build_arm/root/

But am still getting about a 400k addition to my rootfs. Anyway to make that smaller?

Perhaps you just need to run the "strip" tool to remove symbols from the Object file ?

#6 lore raw
Quoted 3 lines

Perhaps you just need to run the "strip" tool to remove symbols from the Object file ?

I am really new to this. Could you tell me how to do that?

Thanks.

Paul

Signature · 7 lines
***************************************
Paul David Kavan
Project Engineer
GRH Electronics, Inc.
402-734-4900
[email protected]
***************************************
#7 lore raw
Quoted 8 lines · Paul Kavan

Perhaps you just need to run the "strip" tool to remove symbols from the
Object file ?

I am really new to this. Could you tell me how to do that?

strip <dynamic-object-file> or
strip libasound.so

Fausto Carvalho Marques Silva

#8 lore raw
In reply to Paul Kavan
Quoted 5 lines · On Tue, 10 Jul 2007 15:22:30 -0500 "Paul Kavan" <[email protected]> wrote:
Quoted 3 lines

Perhaps you just need to run the "strip" tool to remove symbols from the Object file ?

I am really new to this. Could you tell me how to do that?

I haven't followed closely, but I believe that you are cross compiling. In other words, somewhere you found/built a copy of "gcc" that runs on your host and builds executables for your target.

In the same "place" that you found/built that copy of gcc, there should be some other tools, including "strip". Simply run:
"strip libasound.so" or perhaps "strip libsalsa.so".

#9 lore raw
Quoted 11 lines · J. Scott Merritt
Quoted 1 line · On Tue, 10 Jul 2007 15:22:30 -0500 "Paul Kavan" <[email protected]> wrote:
Quoted 1 line

Perhaps you just need to run the "strip" tool to remove symbols from

the

Quoted 4 lines
Quoted 2 lines

Object file ?

I am really new to this. Could you tell me how to do that?

Quoted 8 lines

I haven't followed closely, but I believe that you are cross compiling. In other words, somewhere you found/built a copy of "gcc" that runs on your host and builds executables for your target.

In the same "place" that you found/built that copy of gcc, there should be some other tools, including "strip". Simply run:
"strip libasound.so" or perhaps "strip libsalsa.so".

Thanks Scott:

That is exactly the case. I am developing an embedded system for an ARM platform. My host machine is a i686 type. I do in fact have a cross-tool called arm-linux-strip. I will work on that first with alsa then look at salsa. My problem with salsa is that for testing, I want to make sure I can use aplay and am having a hard time cross-compiling aplay with salsa.

Thanks.

Paul

Signature · 7 lines
***************************************
Paul David Kavan
Project Engineer
GRH Electronics, Inc.
402-734-4900
[email protected]
***************************************
#10 lore raw

At Tue, 10 Jul 2007 16:11:33 -0500,

Quoted 23 lines · Paul Kavan
Quoted 11 lines · J. Scott Merritt
Quoted 1 line · On Tue, 10 Jul 2007 15:22:30 -0500 "Paul Kavan" <[email protected]> wrote:
Quoted 1 line

Perhaps you just need to run the "strip" tool to remove symbols from

the

Quoted 4 lines
Quoted 2 lines

Object file ?

I am really new to this. Could you tell me how to do that?

Quoted 8 lines

I haven't followed closely, but I believe that you are cross compiling. In other words, somewhere you found/built a copy of "gcc" that runs on your host and builds executables for your target.

In the same "place" that you found/built that copy of gcc, there should be some other tools, including "strip". Simply run:
"strip libasound.so" or perhaps "strip libsalsa.so".

Quoted 7 lines

Thanks Scott:

That is exactly the case. I am developing an embedded system for an ARM platform. My host machine is a i686 type. I do in fact have a cross-tool called arm-linux-strip. I will work on that first with alsa then look at salsa. My problem with salsa is that for testing, I want to make sure I can use aplay and am having a hard time cross-compiling aplay with salsa.

You may better to build SALSA with --enable-libasound configure option. This will create a symlink to libasound.so, which makes easier for apps to detect the library.

Then, for alsa-utils, use --with-alsa-inc-prefix=$ROOT/usr/include and --with-alsa-prefix=$ROOT/usr/lib configure options.

Also, don't install both alsa-lib and salsa-lib on the same system. Especially the confliction of development files should be avoided.

Takashi

#11 lore raw
In reply to Paul Kavan

At Tue, 10 Jul 2007 10:05:12 -0500,

Quoted 24 lines · Paul Kavan

On 7/10/07, Takashi Iwai <[email protected]> wrote:

At Fri, 06 Jul 2007 11:46:59 +0200,
I wrote:
>
> At Thu, 05 Jul 2007 12:15:06 -0300,
> Fausto Carvalho Marques SIlva wrote:
> >
> > In salsa library(this library really saved my life, from am alsa-lib of > > 600K to 45K!!!), developed by Takashi Iwai, the creation of asoundlib.h > > is dynamic and based on the configure options ( --disable-mixer will > > remove mixer.h from asoundlib.h).
> > Can alsa-lib do the same??I think it is a good "cleanup" way of doing > > client header files.

I really like the idea of Salsa as well. I have built both ALSA-libs and SALSA-libs for my ARM SoC system. However, there are a lot of features I am sure I do not need, e.g. mixer. I would like to build the minimal SALSA system for playing and capturing audio through a PCM interface. The audio is mono, 8k sample rate with no sw audio control, etc. What tags can I add to get the smallest possible SALSA build. Currently I am doing this:

Quoted 8 lines

CC=arm-linux-gcc ./configure --target=arm-linux --host=i686-pc-linux-gnu --with-versioned=no --disable-mixer

then

make install DESTDIR=$HOME/Linux_Builds/buildroot/build_arm/root/

But am still getting about a 400k addition to my rootfs. Anyway to make that smaller?

400k? It's definitely too much.

First, disable static library via --disable-static configure option. You need only libsalsa.so.* for running system. The rest, pkgconfig and include files, are needed only for development.
Also, install stripped binaries via 'make install-strip'.

On my system, the above will result in 36kB binary.

(BTW, salsa-lib has no versioned symbols, so --with-versioned=no is useless.)

Takashi