Problem in alsa code

146 views
Skip to first unread message

Vandy

unread,
Jan 7, 2009, 11:42:17 PM1/7/09
to android-porting
Hi All,
I am getting the following errors when compiling alsa for the latest
repository. Please help.
----------------------------------------------------------------------------------------------------------
I am compiling android code for arm, when compiling in sound I am
getting the following errors.
hardware/alsa_sound/AudioHardwareInterface.cpp: In static member
function 'static android::AudioHardwareInterface*
android::AudioHardwareInterface::create()':
hardware/alsa_sound/AudioHardwareInterface.cpp:96: error: cannot
allocate an object of abstract type 'android::AudioHardwareALSA'
hardware/alsa_sound/AudioHardwareALSA.h:224: note: because the
following virtual functions are pure within
'android::AudioHardwareALSA':
hardware/libhardware/include/hardware/AudioHardwareInterface.h:178:
note: virtual android::status_t
android::AudioHardwareInterface::setRouting(int, uint32_t)
hardware/libhardware/include/hardware/AudioHardwareInterface.h:180:
note: virtual android::status_t
android::AudioHardwareInterface::getRouting(int, uint32_t*)
hardware/libhardware/include/hardware/AudioHardwareInterface.h:187:
note: virtual android::status_t
android::AudioHardwareInterface::setMode(int)
hardware/libhardware/include/hardware/AudioHardwareInterface.h:188:
note: virtual android::status_t
android::AudioHardwareInterface::getMode(int*)
hardware/libhardware/include/hardware/AudioHardwareInterface.h:196:
note: virtual android::status_t
android::AudioHardwareInterface::setParameter(const char*, const
char*)
hardware/libhardware/include/hardware/AudioHardwareInterface.h:200:
note: virtual size_t
android::AudioHardwareInterface::getInputBufferSize(uint32_t, int,
int)
hardware/libhardware/include/hardware/AudioHardwareInterface.h:207:
note: virtual android::AudioStreamOut*
android::AudioHardwareInterface::openOutputStream(int, int, uint32_t,
android::status_t*)
hardware/libhardware/include/hardware/AudioHardwareInterface.h:214:
note: virtual android::AudioStreamIn*
android::AudioHardwareInterface::openInputStream(int, int, uint32_t,
android::status_t*)
hardware/libhardware/include/hardware/AudioHardwareInterface.h:217:
note: virtual android::status_t
android::AudioHardwareInterface::dumpState(int, const
android::Vector<android::String16>&)
hardware/alsa_sound/AudioHardwareInterface.cpp:101: error: cannot
allocate an object of abstract type 'android::AudioHardwareStub'
hardware/alsa_sound/AudioHardwareStub.h:55: note: because the
following virtual functions are pure within
'android::AudioHardwareStub':
hardware/libhardware/include/hardware/AudioHardwareInterface.h:178:
note: virtual android::status_t
android::AudioHardwareInterface::setRouting(int, uint32_t)
hardware/libhardware/include/hardware/AudioHardwareInterface.h:180:
note: virtual android::status_t
android::AudioHardwareInterface::getRouting(int, uint32_t*)
hardware/libhardware/include/hardware/AudioHardwareInterface.h:187:
note: virtual android::status_t
android::AudioHardwareInterface::setMode(int)
hardware/libhardware/include/hardware/AudioHardwareInterface.h:188:
note: virtual android::status_t
android::AudioHardwareInterface::getMode(int*)
hardware/libhardware/include/hardware/AudioHardwareInterface.h:200:
note: virtual size_t
android::AudioHardwareInterface::getInputBufferSize(uint32_t, int,
int)
hardware/libhardware/include/hardware/AudioHardwareInterface.h:207:
note: virtual android::AudioStreamOut*
android::AudioHardwareInterface::openOutputStream(int, int, uint32_t,
android::status_t*)
hardware/libhardware/include/hardware/AudioHardwareInterface.h:214:
note: virtual android::AudioStreamIn*
android::AudioHardwareInterface::openInputStream(int, int, uint32_t,
android::status_t*)
hardware/libhardware/include/hardware/AudioHardwareInterface.h:217:
note: virtual android::status_t
android::AudioHardwareInterface::dumpState(int, const
android::Vector<android::String16>&)
hardware/alsa_sound/AudioHardwareInterface.cpp: At global scope:
hardware/alsa_sound/AudioHardwareInterface.cpp:136: error: definition
of implicitly-declared
'android::AudioHardwareInterface::AudioHardwareInterface()'
hardware/alsa_sound/AudioHardwareInterface.cpp: In constructor
'android::AudioHardwareInterface::AudioHardwareInterface()':
hardware/alsa_sound/AudioHardwareInterface.cpp:139: error: 'mRoutes'
was not declared in this scope
hardware/alsa_sound/AudioHardwareInterface.cpp:140: error: 'mMode' was
not declared in this scope
hardware/alsa_sound/AudioHardwareInterface.cpp: In member function
'virtual android::status_t android::AudioHardwareInterface::setRouting
(int, uint32_t)':
hardware/alsa_sound/AudioHardwareInterface.cpp:150: error: 'mMode' was
not declared in this scope
hardware/alsa_sound/AudioHardwareInterface.cpp:153: error: 'mRoutes'
was not declared in this scope
hardware/alsa_sound/AudioHardwareInterface.cpp:155: error: 'mMode' was
not declared in this scope
hardware/alsa_sound/AudioHardwareInterface.cpp: In member function
'virtual android::status_t android::AudioHardwareInterface::getRouting
(int, uint32_t*)':
hardware/alsa_sound/AudioHardwareInterface.cpp:169: error: 'mMode' was
not declared in this scope
hardware/alsa_sound/AudioHardwareInterface.cpp:172: error: 'mRoutes'
was not declared in this scope
hardware/alsa_sound/AudioHardwareInterface.cpp: In member function
'virtual android::status_t android::AudioHardwareInterface::setMode
(int)':
hardware/alsa_sound/AudioHardwareInterface.cpp:187: error: 'mMode' was
not declared in this scope
hardware/alsa_sound/AudioHardwareInterface.cpp:193: error: 'mMode' was
not declared in this scope
hardware/alsa_sound/AudioHardwareInterface.cpp: In member function
'virtual android::status_t android::AudioHardwareInterface::getMode
(int*)':
hardware/alsa_sound/AudioHardwareInterface.cpp:200: error: 'mMode' was
not declared in this scope
hardware/alsa_sound/AudioHardwareInterface.cpp: In member function
'virtual android::status_t android::AudioHardwareInterface::dumpState
(int, const android::Vector<android::String16>&)':
hardware/alsa_sound/AudioHardwareInterface.cpp:217: error: 'mMode' was
not declared in this scope
hardware/alsa_sound/AudioHardwareInterface.cpp:220: error: 'mRoutes'
was not declared in this scope

Rgds,
Vandy

Praveen

unread,
Jan 8, 2009, 12:07:02 AM1/8/09
to android-porting
Hi Vandy,

I am also getting the same error while compiling. Were you able to
make any progress on this?

If so please feel free to share the solution

Sean McNeil

unread,
Jan 8, 2009, 12:18:34 AM1/8/09
to android...@googlegroups.com
Google has made some minor changes to the audio interface and Wind River
is aware of them. There is a patch pending and it will hopefully be
committed soon.

Sorry for the inconvenience,
Sean

Vandana Vuthoo

unread,
Jan 8, 2009, 12:27:34 AM1/8/09
to android...@googlegroups.com
Hi Sean,

When will the patch be available ? I am in a total fix,please help,Can I get some workaround it for it?

Rgds,
Vandana

Sean McNeil

unread,
Jan 8, 2009, 12:33:30 AM1/8/09
to android...@googlegroups.com
Attached is an unofficial patch that should help. We still need to go
through our review process, so things will take time.

Vandana Vuthoo wrote:
> Hi Sean,
>
> When will the patch be available ? I am in a total fix,please help,Can
> I get some workaround it for it?
>
> Rgds,
> Vandana
>
> On Thu, Jan 8, 2009 at 10:48 AM, Sean McNeil <seanm...@gmail.com
> <mailto:seanm...@gmail.com>> wrote:
>
>
> Google has made some minor changes to the audio interface and Wind
> River
> is aware of them. There is a patch pending and it will hopefully be
> committed soon.
>
> Sorry for the inconvenience,
> Sean
>
> Praveen wrote:
> > Hi Vandy,
> >
> > I am also getting the same error while compiling. Were you able to
> > make any progress on this?
> >
> > If so please feel free to share the solution
> >
> > On Jan 8, 9:42 am, Vandy <vandana.vut...@gmail.com
alsa_sound.patch

Praveen

unread,
Jan 8, 2009, 12:35:09 AM1/8/09
to android-porting
Hi sean,

Do you know about changes to the audio interface made by Google? When
was this made?

Please let me know

Sean McNeil

unread,
Jan 8, 2009, 12:54:37 AM1/8/09
to android...@googlegroups.com
Essentially, they added a method to audio out for getting the latency of
audio output. I assume it is for video/audio sync. They also added a
standby method to the input stream. That I assume is for power
management. The open stream methods have an extra argument to get the
status back on open. Finally, they made the AudioHardwareInterface class
a pure template class and made AudioHardwareBase what used to be
AudioHardwareInterface.

All these changes appear to be helpful and desirable.

Sean

Vandana Vuthoo

unread,
Jan 8, 2009, 1:55:30 AM1/8/09
to android...@googlegroups.com
Hi Sean,
Now when I build I am getting the following error
target arm C++: libaudio <= hardware/alsa_sound/AudioHardwareALSA.cpp
make: *** No rule to make target `out/target/product/generic/obj/STATIC_LIBRARIES/libasound_intermediates/libasound.a', needed by `out/target/product/generic/obj/SHARED_LIBRARIES/libaudio_intermediates/LINKED/libaudio.so'.  Stop.


Rgds,
Vandana

Rupesh Gujare

unread,
Jan 8, 2009, 5:29:22 AM1/8/09
to android...@googlegroups.com
Thanks Sean,
  We tested it and found that, it is working nicely. Now we are able to compile build and play sound.

Regards,
Rupesh Gujare

Vandana Vuthoo

unread,
Jan 8, 2009, 5:31:21 AM1/8/09
to android...@googlegroups.com
Hi Sean/Rupesh,
I applied the same patch but got the foll errorrs

ow when I build I am getting the following error
target arm C++: libaudio <= hardware/alsa_sound/
AudioHardwareALSA.cpp
make: *** No rule to make target `out/target/product/generic/obj/STATIC_LIBRARIES/libasound_intermediates/libasound.a', needed by `out/target/product/generic/obj/SHARED_LIBRARIES/libaudio_intermediates/LINKED/libaudio.so'.  Stop.


please help.
Rgds,
vandana

Sean McNeil

unread,
Jan 8, 2009, 5:37:41 AM1/8/09
to android...@googlegroups.com
You are probably missing external/alsa-lib. You have to have both.
> > <mailto:seanm...@gmail.com
> <mailto:seanm...@gmail.com>>> wrote:
> >
> >
> > Google has made some minor changes to the audio
> interface and Wind
> > River
> > is aware of them. There is a patch pending and it will
> hopefully be
> > committed soon.
> >
> > Sorry for the inconvenience,
> > Sean
> >
> > Praveen wrote:
> > > Hi Vandy,
> > >
> > > I am also getting the same error while compiling. Were
> you able to
> > > make any progress on this?
> > >
> > > If so please feel free to share the solution
> > >
> > > On Jan 8, 9:42 am, Vandy <vandana.vut...@gmail.com
> <mailto:vandana.vut...@gmail.com>
> > <mailto:vandana.vut...@gmail.com

Vandana Vuthoo

unread,
Jan 8, 2009, 5:39:52 AM1/8/09
to android...@googlegroups.com
Hi,
I have taken external/alsa-lib, but still facing the same issue,
Rgds,
vandana

Rupesh Gujare

unread,
Jan 8, 2009, 6:01:16 AM1/8/09
to android...@googlegroups.com
Vandana,
  Try cleaning your build or take fresh build and recompile, might be your build is little screwed up.

Regards,
Rupesh Gujare

Marco Trevisan (Treviño)

unread,
Jan 18, 2009, 11:21:36 PM1/18/09
to android-porting
On 8 Gen, 06:33, Sean McNeil <seanmcne...@gmail.com> wrote:
> Attached is an unofficial patch that should help. We still need to go
> through our review process, so things will take time.

Thanks for the patch Sean, but I'm still getting an error:

target arm C++: libaudio <= hardware/alsa_sound/
AudioHardwareInterface.cpp
target arm C++: libaudio <= hardware/alsa_sound/AudioHardwareStub.cpp
hardware/alsa_sound/AudioHardwareStub.cpp: In member function 'virtual
android::AudioStreamOut* android::AudioHardwareStub::openOutputStream
(int, int, uint32_t, android::status_t*)':
hardware/alsa_sound/AudioHardwareStub.cpp:52: error: cannot allocate
an object of abstract type 'android::AudioStreamOutStub'
hardware/alsa_sound/AudioHardwareStub.h:30: note: because the
following virtual functions are pure within
'android::AudioStreamOutStub':
hardware/libhardware/include/hardware_legacy/AudioHardwareInterface.h:
88: note: virtual android::status_t
android::AudioStreamOut::standby()

Any fix?

Sean McNeil

unread,
Jan 18, 2009, 11:41:00 PM1/18/09
to android...@googlegroups.com
Yes, I noticed this as well. Seems like the patch I sent you was a
little messed up. Just copy over the files from

./frameworks/base/libs/audioflinger/AudioHardwareStub.*

and you should be OK.

Sean

Marco Trevisan (Treviño)

unread,
Jan 19, 2009, 12:07:29 AM1/19/09
to android-porting
On 19 Gen, 05:41, Sean McNeil <seanmcne...@gmail.com> wrote:
> Yes, I noticed this as well. Seems like the patch I sent you was a
> little messed up. Just copy over the files from
>
> ./frameworks/base/libs/audioflinger/AudioHardwareStub.*
>
> and you should be OK.

Thanks so much. It works ;)

lemontea

unread,
Feb 6, 2009, 3:04:48 AM2/6/09
to android-porting
Hi all,

I am compiling alsa-lib and alsa_sound for x86 target, but I get the
error as follows:

build/core/product_config.mk:211: WARNING: adding test OTA key
============================================
TARGET_PRODUCT=eee_701
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_ARCH=x86
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=
============================================
build/core/main.mk:180: implicitly installing apns-conf_sdk.xml
target arm C++: libaudio <= hardware/alsa_sound/AudioHardwareALSA.cpp
target SharedLib: libaudio (out/target/product/eee_701/obj/
SHARED_LIBRARIES/libaudio_intermediates/LINKED/libaudio.so)
out/target/product/eee_701/obj/SHARED_LIBRARIES/libaudio_intermediates/
AudioHardwareALSA.o: In function `android::AudioStreamOutALSA::standby
()':
hardware/alsa_sound/AudioHardwareALSA.cpp:906: undefined reference to
`release_wake_lock'
out/target/product/eee_701/obj/SHARED_LIBRARIES/libaudio_intermediates/
AudioHardwareALSA.o: In function `android::AudioStreamOutALSA::write
(void const*, unsigned int)':
hardware/alsa_sound/AudioHardwareALSA.cpp:831: undefined reference to
`acquire_wake_lock'
out/target/product/eee_701/obj/STATIC_LIBRARIES/
libasound_intermediates/libasound.a(shmarea.o): In function
`snd_shm_area_destructor':
external/alsa-lib/src/shmarea.c:106: undefined reference to `shmdt'
out/target/product/eee_701/obj/STATIC_LIBRARIES/
libasound_intermediates/libasound.a(shmarea.o): In function
`snd_shm_area_destroy':
external/alsa-lib/src/shmarea.c:92: undefined reference to `shmdt'
out/target/product/eee_701/obj/STATIC_LIBRARIES/
libasound_intermediates/libasound.a(pcm_mmap.o): In function
`snd_pcm_mmap':
external/alsa-lib/src/pcm/pcm_mmap.c:412: undefined reference to
`shmat'
external/alsa-lib/src/pcm/pcm_mmap.c:379: undefined reference to
`shmget'
external/alsa-lib/src/pcm/pcm_mmap.c:385: undefined reference to
`shmat'
external/alsa-lib/src/pcm/pcm_mmap.c:391: undefined reference to
`shmctl'
collect2: ld returned 1 exit status
make: *** [out/target/product/eee_701/obj/SHARED_LIBRARIES/
libaudio_intermediates/LINKED/libaudio.so] Error 1

Can you give me some suggestions?

Thanks a lot.

harish

unread,
Feb 19, 2009, 2:29:36 AM2/19/09
to android-porting
lemontea,

even iam also getting similoar kind of error

arget StaticLib: libasound (out/target/product/generic/obj/
STATIC_LIBRARIES/libasound_intermediates/libasound.a)
target SharedLib: libaudio (out/target/product/generic/obj/
SHARED_LIBRARIES/libaudio_intermediates/LINKED/libaudio.so)
out/target/product/generic/obj/SHARED_LIBRARIES/libaudio_intermediates/
AudioHardwareALSA.o: In function `android::AudioStreamOutALSA::standby
()':
hardware/alsa_sound/AudioHardwareALSA.cpp:906: undefined reference to
`release_wake_lock'
out/target/product/generic/obj/SHARED_LIBRARIES/libaudio_intermediates/
AudioHardwareALSA.o: In function `android::AudioStreamOutALSA::write
(void const*, unsigned int)':
hardware/alsa_sound/AudioHardwareALSA.cpp:831: undefined reference to
`acquire_wake_lock'
collect2: ld returned 1 exit status
make: *** [out/target/product/generic/obj/SHARED_LIBRARIES/
libaudio_intermediates/LINKED/libaudio.so] Error 1


how to solve this, i am unable to make any progress after this.

HarishKumar.V

lemontea chen

unread,
Feb 24, 2009, 4:04:21 AM2/24/09
to android...@googlegroups.com
Hi HarishKumar.V,

You can find these functions in hardware/libhardware_legacy/power/power.c

lemontea

2009/2/19 harish <harish...@gmail.com>
Reply all
Reply to author
Forward
0 new messages