[android-porting] Re: Audio support
Hi Daniel and Reed, can you please post the asound.conf for WM9713 to me too? Cheers Marco -- unsubscribe: android-porting+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-porting
[android-porting] Re: Audio support
Hi Daniel, Could you paste or send me your asound.conf file? I am having the same WM9713 codec and I have no idea how to get the correct values such as type and card name for the AndroidPlayback device. Could you tell me how you found that? Thanks. Reed On Dec 16 2008, 6:56 pm, Daniel Youn youn.dan...@gmail.com wrote: Hi, Gougou I've checked /dev and /dev/snd directory. There is PCMC0D0 and other device files in /dev not in /dev/snd. It is curious, because a few days ago, I've patched system/core/init/devices.c file with this command: repo download platform/system/core 4432/2 But system/core/init/devices.c file actually didn't modified at all. ( I don't know why ) So, I manually modified system/core/init/devices.c file. And this time, PCMC0D0 and other device files located in /dev/snd. As a result, now I can here sound on my android. :) Thanks for advice. Regards. Daniel Yun. On Tue, Dec 16, 2008 at 11:44 AM, gougou zqy2000...@gmail.com wrote: Can you check your audio device files (like PCMC0D0 )in /dev/snd or /dev If sb get the error: no such device, please check the alsa-lib -- alsa-lib-1.0.13/include/config.h #define ALSA_DEVICE_DIRECTORY /dev/ The old device path is /dev if Andriod has below update, this value need to be /dev/snd On 12月15日, 下午1时16分, Daniel Youn youn.dan...@gmail.com wrote: Hi, gougou I am also using WM9713 codec but I can't get sound driver working. After reading this mailling list, I've check the following: 1) get source for /platform/external/alas-lib 2) get source for /platform/hardware/alsasound 3) modified BoardConfig.mk like this #HAVE_HTC_AUDIO_DRIVER := true #BOARD_USES_GENERIC_AUDIO := true BOARD_USES_ALSA_AUDIO := true 4) add sample asound.conf file to /platform/system/core/rootdir/etc/ But, when the system starts up, there's some infinite loop like this log I/ServiceManager( 42): Waiting for sevice media.audio_flinger... and the cause is this log E/AudioHardwareALSA( 123): Unable to attach mixer to device AndroidPlayback: No such file or directory E/AudioHardwareALSA( 123): Unable to attach mixer to device default: No such file or directory E/AudioHardwareALSA( 123): Unable to attach mixer to device AndroidRecord: No such file or directory E/AudioHardwareALSA( 123): Unable to attach mixer to device default: No such file or directory Do you guys have any idea, what's wrong? Thanks for help in advance. On Fri, Dec 12, 2008 at 3:45 PM, gougou zqy2000...@gmail.com wrote: Hi Yang I am using WM97xx codec and has it's ALSA driver worked. And I also integrated the alsa-lib into my source. Now the audio working fine. But the only thing I wanna know is : How the asound.conf work and How to write this file. Now I skip this config file and wite the configurations directly into my hardware. Thanks PS: If sb get the error: no such device, please check the alsa-lib -- alsa-lib-1.0.13/include/config.h #define ALSA_DEVICE_DIRECTORY /dev/ The old device path is /dev if Andriod has below update, this value need to be /dev/snd http://review.source.android.com/r/e2ff04fb6804 On 11月26日, 下午5时09分, Yang, Xiaopeng xiaopeng.y...@windriver.com wrote: Hi Maxime, The ALSA contribution from Wind River includes alsa-lib and libaudio-alsa libraries, along with other patches for bionic and system/core. Because alsa-lib and libaudio-alsa are new projects, they have been sent to Google for integration, and may be available in the repositories soon. The other modifications on bionic and system/core have been submitted to Gerrit for review: [OK] bionic/ defaulthttp:// review.source.android.com/r/fad1668b10d5 (as xiaopeng.y...@windriver.com) [OK] system/core/defaulthttp:// review.source.android.com/r/e2ff04fb6804 (as xiaopeng.y...@windriver.com) After above projects and patches have been integrated into andorid, you can build android images with ALSA support. To that end, there are still two things need to do: 1. A /etc/asound.conf is required for ALSA to work. Attached patch adds a sample asound.conf for zoom board, copy this sample file to system/core/rootdir/etc/asound.conf and make necessary changes to it according to your hardware. 2. Add the following line into the BoardConfig.mk of your board: BOARD_USES_ALSA_AUDIO := true then rebuild android to see whether ALSA audio work. Regards, Xiaopeng Maxime Petazzoni 写道: Hi Sean, Do you have more information to give us about when and how this code is going to be available? The implementation proposed down here by Misael looks nice too, but I'd like to have a
[android-porting] Re: Audio support
Is there any iMX31 ADS/PDK developers here that got their sound working with alsa? Mine got to the point where it starts up the correct PMIC clocks, pulls the TX pin high but there is no sound coming out. Any help would be quite nice... On Dec 16, 12:56 pm, Daniel Youn youn.dan...@gmail.com wrote: Hi, Gougou I've checked /dev and /dev/snd directory. There is PCMC0D0 and other device files in /dev not in /dev/snd. It is curious, because a few days ago, I've patched system/core/init/devices.c file with this command: repo download platform/system/core 4432/2 But system/core/init/devices.c file actually didn't modified at all. ( I don't know why ) So, I manually modified system/core/init/devices.c file. And this time, PCMC0D0 and other device files located in /dev/snd. As a result, now I can here sound on my android. :) Thanks for advice. Regards. Daniel Yun. On Tue, Dec 16, 2008 at 11:44 AM, gougou zqy2000...@gmail.com wrote: Can you check your audio device files (like PCMC0D0 )in /dev/snd or /dev If sb get the error: no such device, please check the alsa-lib -- alsa-lib-1.0.13/include/config.h #define ALSA_DEVICE_DIRECTORY /dev/ The old device path is /dev if Andriod has below update, this value need to be /dev/snd On 12月15日, 下午1时16分, Daniel Youn youn.dan...@gmail.com wrote: Hi, gougou I am also using WM9713 codec but I can't get sound driver working. After reading this mailling list, I've check the following: 1) get source for /platform/external/alas-lib 2) get source for /platform/hardware/alsasound 3) modified BoardConfig.mk like this #HAVE_HTC_AUDIO_DRIVER := true #BOARD_USES_GENERIC_AUDIO := true BOARD_USES_ALSA_AUDIO := true 4) add sample asound.conf file to /platform/system/core/rootdir/etc/ But, when the system starts up, there's some infinite loop like this log I/ServiceManager( 42): Waiting for sevice media.audio_flinger... and the cause is this log E/AudioHardwareALSA( 123): Unable to attach mixer to device AndroidPlayback: No such file or directory E/AudioHardwareALSA( 123): Unable to attach mixer to device default: No such file or directory E/AudioHardwareALSA( 123): Unable to attach mixer to device AndroidRecord: No such file or directory E/AudioHardwareALSA( 123): Unable to attach mixer to device default: No such file or directory Do you guys have any idea, what's wrong? Thanks for help in advance. On Fri, Dec 12, 2008 at 3:45 PM, gougou zqy2000...@gmail.com wrote: Hi Yang I am using WM97xx codec and has it's ALSA driver worked. And I also integrated the alsa-lib into my source. Now the audio working fine. But the only thing I wanna know is : How the asound.conf work and How to write this file. Now I skip this config file and wite the configurations directly into my hardware. Thanks PS: If sb get the error: no such device, please check the alsa-lib -- alsa-lib-1.0.13/include/config.h #define ALSA_DEVICE_DIRECTORY /dev/ The old device path is /dev if Andriod has below update, this value need to be /dev/snd http://review.source.android.com/r/e2ff04fb6804 On 11月26日, 下午5时09分, Yang, Xiaopeng xiaopeng.y...@windriver.com wrote: Hi Maxime, The ALSA contribution from Wind River includes alsa-lib and libaudio-alsa libraries, along with other patches for bionic and system/core. Because alsa-lib and libaudio-alsa are new projects, they have been sent to Google for integration, and may be available in the repositories soon. The other modifications on bionic and system/core have been submitted to Gerrit for review: [OK] bionic/ defaulthttp:// review.source.android.com/r/fad1668b10d5 (as xiaopeng.y...@windriver.com) [OK] system/core/defaulthttp:// review.source.android.com/r/e2ff04fb6804 (as xiaopeng.y...@windriver.com) After above projects and patches have been integrated into andorid, you can build android images with ALSA support. To that end, there are still two things need to do: 1. A /etc/asound.conf is required for ALSA to work. Attached patch adds a sample asound.conf for zoom board, copy this sample file to system/core/rootdir/etc/asound.conf and make necessary changes to it according to your hardware. 2. Add the following line into the BoardConfig.mk of your board: BOARD_USES_ALSA_AUDIO := true then rebuild android to see whether ALSA audio work. Regards, Xiaopeng Maxime Petazzoni 写道: Hi Sean, Do you have more information to give us about when and how this code is going to be available? The implementation proposed down here by Misael looks nice too, but I'd like to have a peek about the code
[android-porting] Re: Audio support
Can you check your audio device files (like PCMC0D0 )in /dev/snd or /dev If sb get the error: no such device, please check the alsa-lib -- alsa-lib-1.0.13/include/config.h #define ALSA_DEVICE_DIRECTORY /dev/ The old device path is /dev if Andriod has below update, this value need to be /dev/snd On 12月15日, 下午1时16分, Daniel Youn youn.dan...@gmail.com wrote: Hi, gougou I am also using WM9713 codec but I can't get sound driver working. After reading this mailling list, I've check the following: 1) get source for /platform/external/alas-lib 2) get source for /platform/hardware/alsasound 3) modified BoardConfig.mk like this #HAVE_HTC_AUDIO_DRIVER := true #BOARD_USES_GENERIC_AUDIO := true BOARD_USES_ALSA_AUDIO := true 4) add sample asound.conf file to /platform/system/core/rootdir/etc/ But, when the system starts up, there's some infinite loop like this log I/ServiceManager( 42): Waiting for sevice media.audio_flinger... and the cause is this log E/AudioHardwareALSA( 123): Unable to attach mixer to device AndroidPlayback: No such file or directory E/AudioHardwareALSA( 123): Unable to attach mixer to device default: No such file or directory E/AudioHardwareALSA( 123): Unable to attach mixer to device AndroidRecord: No such file or directory E/AudioHardwareALSA( 123): Unable to attach mixer to device default: No such file or directory Do you guys have any idea, what's wrong? Thanks for help in advance. On Fri, Dec 12, 2008 at 3:45 PM, gougou zqy2000...@gmail.com wrote: Hi Yang I am using WM97xx codec and has it's ALSA driver worked. And I also integrated the alsa-lib into my source. Now the audio working fine. But the only thing I wanna know is : How the asound.conf work and How to write this file. Now I skip this config file and wite the configurations directly into my hardware. Thanks PS: If sb get the error: no such device, please check the alsa-lib -- alsa-lib-1.0.13/include/config.h #define ALSA_DEVICE_DIRECTORY /dev/ The old device path is /dev if Andriod has below update, this value need to be /dev/snd http://review.source.android.com/r/e2ff04fb6804 On 11月26日, 下午5时09分, Yang, Xiaopeng xiaopeng.y...@windriver.com wrote: Hi Maxime, The ALSA contribution from Wind River includes alsa-lib and libaudio-alsa libraries, along with other patches for bionic and system/core. Because alsa-lib and libaudio-alsa are new projects, they have been sent to Google for integration, and may be available in the repositories soon. The other modifications on bionic and system/core have been submitted to Gerrit for review: [OK] bionic/ defaulthttp:// review.source.android.com/r/fad1668b10d5 (as xiaopeng.y...@windriver.com) [OK] system/core/defaulthttp:// review.source.android.com/r/e2ff04fb6804 (as xiaopeng.y...@windriver.com) After above projects and patches have been integrated into andorid, you can build android images with ALSA support. To that end, there are still two things need to do: 1. A /etc/asound.conf is required for ALSA to work. Attached patch adds a sample asound.conf for zoom board, copy this sample file to system/core/rootdir/etc/asound.conf and make necessary changes to it according to your hardware. 2. Add the following line into the BoardConfig.mk of your board: BOARD_USES_ALSA_AUDIO := true then rebuild android to see whether ALSA audio work. Regards, Xiaopeng Maxime Petazzoni 写道: Hi Sean, Do you have more information to give us about when and how this code is going to be available? The implementation proposed down here by Misael looks nice too, but I'd like to have a peek about the code you used for the Freerunner, and more importantly how you used it. Thanks in advance, - Maxime On 12 nov, 05:42, Sean McNeil seanmcne...@gmail.com wrote: Hi Maxime, Wind River is in the process of submitting an ALSA audio implementation. That is what I use on the Openmoko Freerunner and what has been successfully used on the TI OMAP Zoom reference platform. Maxime Petazzoni wrote: Hi, I believe most of the porting efforts on the various hardware platform will soon get to the point (if not already) of a running system ; the next step being making sure all the basic functionality is there. Audio being one of the most important one, since telephony also depends on it. Without anything done on that front, we're facing the using stubbed audio hardware, no sound will be produced warning message when Dalvik starts. From what I've read, Android relies on an hardware glue library libaudio, providing AudioFlinger with the appropriate AudioInterface implementation to output sound to whatever sound driver the hardware uses. For
[android-porting] Re: Audio support
Hi Yang I am using WM97xx codec and has it's ALSA driver worked. And I also integrated the alsa-lib into my source. Now the audio working fine. But the only thing I wanna know is : How the asound.conf work and How to write this file. Now I skip this config file and wite the configurations directly into my hardware. Thanks PS: If sb get the error: no such device, please check the alsa-lib -- alsa-lib-1.0.13/include/config.h #define ALSA_DEVICE_DIRECTORY /dev/ The old device path is /dev if Andriod has below update, this value need to be /dev/snd http://review.source.android.com/r/e2ff04fb6804 On 11月26日, 下午5时09分, Yang, Xiaopeng xiaopeng.y...@windriver.com wrote: Hi Maxime, The ALSA contribution from Wind River includes alsa-lib and libaudio-alsa libraries, along with other patches for bionic and system/core. Because alsa-lib and libaudio-alsa are new projects, they have been sent to Google for integration, and may be available in the repositories soon. The other modifications on bionic and system/core have been submitted to Gerrit for review: [OK] bionic/ defaulthttp://review.source.android.com/r/fad1668b10d5 (as xiaopeng.y...@windriver.com) [OK] system/core/ defaulthttp://review.source.android.com/r/e2ff04fb6804 (as xiaopeng.y...@windriver.com) After above projects and patches have been integrated into andorid, you can build android images with ALSA support. To that end, there are still two things need to do: 1. A /etc/asound.conf is required for ALSA to work. Attached patch adds a sample asound.conf for zoom board, copy this sample file to system/core/rootdir/etc/asound.conf and make necessary changes to it according to your hardware. 2. Add the following line into the BoardConfig.mk of your board: BOARD_USES_ALSA_AUDIO := true then rebuild android to see whether ALSA audio work. Regards, Xiaopeng Maxime Petazzoni 写道: Hi Sean, Do you have more information to give us about when and how this code is going to be available? The implementation proposed down here by Misael looks nice too, but I'd like to have a peek about the code you used for the Freerunner, and more importantly how you used it. Thanks in advance, - Maxime On 12 nov, 05:42, Sean McNeil seanmcne...@gmail.com wrote: Hi Maxime, Wind River is in the process of submitting an ALSA audio implementation. That is what I use on the Openmoko Freerunner and what has been successfully used on the TI OMAP Zoom reference platform. Maxime Petazzoni wrote: Hi, I believe most of the porting efforts on the various hardware platform will soon get to the point (if not already) of a running system ; the next step being making sure all the basic functionality is there. Audio being one of the most important one, since telephony also depends on it. Without anything done on that front, we're facing the using stubbed audio hardware, no sound will be produced warning message when Dalvik starts. From what I've read, Android relies on an hardware glue library libaudio, providing AudioFlinger with the appropriate AudioInterface implementation to output sound to whatever sound driver the hardware uses. For example, on the HTC G1/MSM72xx hardware platform, Google useshttp://android.git.kernel.org/?p=platform/hardware/msm7k.git;a=summary But I think most of the Androids ports are made on hardware that have ALSA device drivers (OMAP for example). And before 20 different people start implementing their own libaudio bridging to ALSA, maybe we should coordinate this community effort. Starting by knowing if anything has already been started by someone, somewhere :) If not, I will most likely start working on one, and I foresee that it's going to be tough, as the only real documentation is the msm7k libaudio source code itself. Ideas, comments, suggestions ... and help are most welcome! - Maxime PS: of course, if you got audio working without going through this libaudio stuff, please share your discoveries ! sample_asound_conf.patch 3K查看下载- 隐藏被引用文字 - - 显示引用的文字 - --~--~-~--~~~---~--~~ unsubscribe: android-porting+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-porting -~--~~~~--~~--~--~---
[android-porting] Re: Audio support
[Brian Code [EMAIL PROTECTED]] You will need to either download them separately using a git-clone operation, or by editing the platform/manifest.git default.xml file. We have added the ALSA stuff to the Openmoko Freerunner port at http://git.koolu.org. The example manifest git can be found there. You can also use a local_manifest.xml to add or remove projects to the baseline manifest.xml. There's an example of doing that here: http://source.android.com/documentation/building-for-dream --~--~-~--~~~---~--~~ unsubscribe: [EMAIL PROTECTED] website: http://groups.google.com/group/android-porting -~--~~~~--~~--~--~---
[android-porting] Re: Audio support
[Brian Code [EMAIL PROTECTED]] You will need to either download them separately using a git-clone operation, or by editing the platform/manifest.git default.xml file. We have added the ALSA stuff to the Openmoko Freerunner port at http://git.koolu.org. The example manifest git can be found there. You can also use a local_manifest.xml to add or remove projects to the baseline manifest.xml. There's an example of doing that here: http://source.android.com/documentation/building-for-dream Thanks for the advice. In fact, I had to modify the main manifest in .repo directory and audio worked fine in my platform. But it's cleaner to use this local_manifest.xml method for additional projects. -Misa --~--~-~--~~~---~--~~ unsubscribe: [EMAIL PROTECTED] website: http://groups.google.com/group/android-porting -~--~~~~--~~--~--~---
[android-porting] Re: Audio support
I did a 'repo init ...' and 'repo sync' but neither alsa-lib nor libaudio-alsa code is downloaded but they are showed in gitweb interface of android code. Why arent they downloaded with default manifest? Did you add entries for those projects in manifest file? -Misa 2008/12/5 mvniekerk [EMAIL PROTECTED] I've sorted the problem. If you go to line 2962 of alsa-lib/src/conf.c, I've changed it to the following: { if (!configs) { configs = ALSA_CONFIG_PATH_DEFAULT; if (!configs) configs = getenv(ALSA_CONFIG_PATH_VAR); } } What happens is when the config is read, strace throws out EISDIR. Thus the system wanted to get a file but instead found a directory. Now I've changed it to the default config file path. Everything is picked up nicely. I know this is probably not the necessarily correct way of doing things, but if it gets my sound working then I'll use it! On Dec 2, 4:25 am, Sean McNeil [EMAIL PROTECTED] wrote: asound.conf should go in /system/etc/asound.conf, not /etc. Most of the time /etc is a symlink, so it doesn't matter. You will probably have to go through your complete asound.conf to see if it is correct for your hardware and kernel. The best suggestion I have is to use something like alsactl -f /tmp/xxx save (sorry, I'm going by memory here and it might not be accurate) to save the alsa control state and then compare your switches. mvniekerk wrote: I'm on the way of pulling my hair out. 1) iMX Alsa Kernel driver loads i) PROCFS entries in /proc/asound are made ii) /proc/asound/version says 1.0.15 iii) /proc/asound/card0 has all the right entries iv) Special device files are made in /dev/snd/ (pcmC0D0p/c mixer0 timer etc) with (forced by me) write permissions as 0777. 2) Alsa lib compiles in Android environment, identified as 1.0.16 3) AlsaAudioHardware code from Wind River compiles 4) Alsa utils compiled, identified as 1.0.16 5) /ets/asound.conf set up aplayer cannot find any devices, nor does amixer (`aplayer -l`). libaudio crashes the repeatedly, without even the Android interface showing up, complaining of Invalid CTL AndroidPlayback. On Nov 27, 3:37 pm, Sangsu Park [EMAIL PROTECTED] wrote: Hi. did you check if alsa-lib is working well? I checked it using aplay. It's very simple to compile into Android. I refered to below site. http://letsgoustc.spaces.live.com/Blog/cns!89AD27DFB5E249BA!404.entry On 11/27/08, mvniekerk [EMAIL PROTECTED] wrote: I'm sorry to dump this on a mailing list, but here goes: cd /proc/asound # ls -l lrwxrwxrwx root root 1970-01-01 00:00 PMICaudio - card0 dr-xr-xr-x root root 1970-01-01 00:00 card0 -r--r--r-- root root0 1970-01-01 00:00 pcm -r--r--r-- root root0 1970-01-01 00:00 timers -r--r--r-- root root0 1970-01-01 00:00 cards -r--r--r-- root root0 1970-01-01 00:00 devices -r--r--r-- root root0 1970-01-01 00:00 version dr-xr-xr-x root root 1970-01-01 00:00 oss # cd card0 # ls -l -rw-r--r-- root root0 1970-01-01 00:00 oss_mixer -r--r--r-- root root0 1970-01-01 00:00 id dr-xr-xr-x root root 1970-01-01 00:00 pcm2p dr-xr-xr-x root root 1970-01-01 00:00 pcm1p dr-xr-xr-x root root 1970-01-01 00:00 pcm0c dr-xr-xr-x root root 1970-01-01 00:00 pcm0p # cd ../ # ls -l lrwxrwxrwx root root 1970-01-01 00:01 PMICaudio - card0 dr-xr-xr-x root root 1970-01-01 00:01 card0 -r--r--r-- root root0 1970-01-01 00:01 pcm -r--r--r-- root root0 1970-01-01 00:01 timers -r--r--r-- root root0 1970-01-01 00:01 cards -r--r--r-- root root0 1970-01-01 00:01 devices -r--r--r-- root root0 1970-01-01 00:01 version dr-xr-xr-x root root 1970-01-01 00:01 oss # cat devices 0: [ 0] : control 16: [ 0- 0]: digital audio playback 17: [ 0- 1]: digital audio playback 18: [ 0- 2]: digital audio playback 24: [ 0- 0]: digital audio capture 33:: timer # cd /dev/snd # ls -l crw-rw-r-- system audio 14, 0 1970-01-01 00:00 mixer crw-rw-r-- system audio116, 0 1970-01-01 00:00 controlC0 crw-rw-r-- system audio 14, 4 1970-01-01 00:00 audio crw-rw-r-- system audio 14, 3 1970-01-01 00:00 dsp crw-rw-r-- system audio116, 24 1970-01-01 00:00 pcmC0D0c crw-rw-r-- system audio116, 16 1970-01-01 00:00 pcmC0D0p crw-rw-r-- system audio 14, 12 1970-01-01 00:00 adsp crw-rw-r-- system
[android-porting] Re: Audio support
about file permission, Hi, you should check the init.rc, the mediaservice run as `not` a root group , so the device file permission should chown to that user group or change mode to 777 (a bad way) you can submit you crash log to here, because i know some compiler 's config can lead to a kernel send a EBUS signal , you should check you kernel and ALSA lib 's gcc config , in default , android 's cross-compile will turn on -fshort-enums, this will cause compile a enum in a sturct in to a shortest integers in you system (16bits in my environment), if the ioctl 's third parameter is only a enum, this will cause a bus error. you should check the volume adjust 's ioctl code in alsa lib. 2008/11/30 Maxime Petazzoni [EMAIL PROTECTED] Ok, after tweaking mixer control names in the asound.conf file, I have sound. Kind of, because changing the volume makes the mediaserver crash one out of three times. After it's crashed, sound still comes out, but changing the volume is not possible until reboot. Anyway, that's still a good start, I'll continue working on it next week and stabilize all this. Thanks for the help, and for the release of Windriver's code. - Maxime On Nov 27, 7:02 pm, Sean McNeil [EMAIL PROTECTED] wrote: Maxime Petazzoni wrote: Hi Sean, On Nov 27, 11:01 am, Sean McNeil [EMAIL PROTECTED] wrote: There are a few things you can check: 1) Make sure you have an ALSA audio device enabled in your kernel. 2) Check from a shell if the directory /dev/snd is created and if there is anything in it. 3) Provide your /system/etc/asound.conf file that you are using to describe the audio devices. Yes, I have all that. The TWL4030 device is discovered at boot time by the kernel, and the corresponding devices are created in the /dev/snd directory (with correct permissions). The asound.conf file is included in the system, in its correct location (/system/etc/). Where did you get the asound.conf? It must relate to your hardware and kernel. It is very specific to a platform. The example version provided relates to the OMAP zoom board with I think kernel 2.6.22 (not sure about this, though). You'll have to use something like alsactl to save off the states and see if they correspond to what is in asound.conf. As suggested by Sangsu, I will try aplay, but I don't have much hope. Could you give more information about the ALSA driver you're using? Do you have the mixer device called T2 Master codec configure Switch defined in the sound/arm/omap/omap-alsa-twl4030-mixer.c file? I don't, but I do have a T2 Master codec Sample Rate for example. I don't have my zoom board available, so I can't check this for you. Thanks, - Maxime Sean mvniekerk wrote: Wow, you got that far. I followed the instructions as posted above and the hardware throws out the following: E/ALSALib ( 1610): external/alsa-lib/src/control/control.c:909: (snd_ctl_open_noupdate) Invalid CTL AndroidPlayback E/AudioHardwareALSA( 1610): Unable to attach mixer to device AndroidPlayback: No such file or directory E/ALSALib ( 1610): external/alsa-lib/src/control/control.c:909: (snd_ctl_open_noupdate) Invalid CTL hw:00 E/AudioHardwareALSA( 1610): Unable to attach mixer to device default: No such file or directory E/ALSALib ( 1610): external/alsa-lib/src/control/control.c:909: (snd_ctl_open_noupdate) Invalid CTL AndroidRecord E/AudioHardwareALSA( 1610): Unable to attach mixer to device AndroidRecord: No such file or directory E/ALSALib ( 1610): external/alsa-lib/src/control/control.c:909: (snd_ctl_open_noupdate) Invalid CTL hw:00 E/AudioHardwareALSA( 1610): Unable to attach mixer to device default: No such file or directory Is this missing files and/or wrong permissions? This is code running from git code updated yesterday (26 Nov). All the device files are listed at /dev/snd and /proc/asound is populated with the right files. /etc/asound.conf is there with the right device names (e.g. I've changed card TWL4030 to 0 and also tried MXC). Please be so kind and attach your asound.conf file. On Nov 27, 11:09 am, Maxime Petazzoni [EMAIL PROTECTED] wrote: Hi, I tried putting it all together. The end system has the device nodes in the correct place with valid permissions, and I even get some promising debug messages. But if I try to play any sound or change the volume, the AudioFlinger service crashes (and is restarted endlessly). And of course, no sound is produced. Apparently, it's looking for a mixer device that does not exist : D/AudioHardwareALSA( 665): mixer initialized. E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback E/ALSALib (
[android-porting] Re: Audio support
Ok, after tweaking mixer control names in the asound.conf file, I have sound. Kind of, because changing the volume makes the mediaserver crash one out of three times. After it's crashed, sound still comes out, but changing the volume is not possible until reboot. Anyway, that's still a good start, I'll continue working on it next week and stabilize all this. Thanks for the help, and for the release of Windriver's code. - Maxime On Nov 27, 7:02 pm, Sean McNeil [EMAIL PROTECTED] wrote: Maxime Petazzoni wrote: Hi Sean, On Nov 27, 11:01 am, Sean McNeil [EMAIL PROTECTED] wrote: There are a few things you can check: 1) Make sure you have an ALSA audio device enabled in your kernel. 2) Check from a shell if the directory /dev/snd is created and if there is anything in it. 3) Provide your /system/etc/asound.conf file that you are using to describe the audio devices. Yes, I have all that. The TWL4030 device is discovered at boot time by the kernel, and the corresponding devices are created in the /dev/snd directory (with correct permissions). The asound.conf file is included in the system, in its correct location (/system/etc/). Where did you get the asound.conf? It must relate to your hardware and kernel. It is very specific to a platform. The example version provided relates to the OMAP zoom board with I think kernel 2.6.22 (not sure about this, though). You'll have to use something like alsactl to save off the states and see if they correspond to what is in asound.conf. As suggested by Sangsu, I will try aplay, but I don't have much hope. Could you give more information about the ALSA driver you're using? Do you have the mixer device called T2 Master codec configure Switch defined in the sound/arm/omap/omap-alsa-twl4030-mixer.c file? I don't, but I do have a T2 Master codec Sample Rate for example. I don't have my zoom board available, so I can't check this for you. Thanks, - Maxime Sean mvniekerk wrote: Wow, you got that far. I followed the instructions as posted above and the hardware throws out the following: E/ALSALib ( 1610): external/alsa-lib/src/control/control.c:909: (snd_ctl_open_noupdate) Invalid CTL AndroidPlayback E/AudioHardwareALSA( 1610): Unable to attach mixer to device AndroidPlayback: No such file or directory E/ALSALib ( 1610): external/alsa-lib/src/control/control.c:909: (snd_ctl_open_noupdate) Invalid CTL hw:00 E/AudioHardwareALSA( 1610): Unable to attach mixer to device default: No such file or directory E/ALSALib ( 1610): external/alsa-lib/src/control/control.c:909: (snd_ctl_open_noupdate) Invalid CTL AndroidRecord E/AudioHardwareALSA( 1610): Unable to attach mixer to device AndroidRecord: No such file or directory E/ALSALib ( 1610): external/alsa-lib/src/control/control.c:909: (snd_ctl_open_noupdate) Invalid CTL hw:00 E/AudioHardwareALSA( 1610): Unable to attach mixer to device default: No such file or directory Is this missing files and/or wrong permissions? This is code running from git code updated yesterday (26 Nov). All the device files are listed at /dev/snd and /proc/asound is populated with the right files. /etc/asound.conf is there with the right device names (e.g. I've changed card TWL4030 to 0 and also tried MXC). Please be so kind and attach your asound.conf file. On Nov 27, 11:09 am, Maxime Petazzoni [EMAIL PROTECTED] wrote: Hi, I tried putting it all together. The end system has the device nodes in the correct place with valid permissions, and I even get some promising debug messages. But if I try to play any sound or change the volume, the AudioFlinger service crashes (and is restarted endlessly). And of course, no sound is produced. Apparently, it's looking for a mixer device that does not exist : D/AudioHardwareALSA( 665): mixer initialized. E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback I/AudioHardwareALSA( 665): Initialized ALSA PLAYBACK device AndroidPlayback D/AudioHardwareALSA( 665): Set PLAYBACK PCM format to S16_LE (Signed 16 bit Little Endian) D/AudioHardwareALSA( 665): Using 2 channels for PLAYBACK. D/AudioHardwareALSA( 665): Set PLAYBACK sample rate to 44100 HZ E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback_Speaker_normal E/ALSALib ( 665): external/alsa-lib/src/control/setup.c:555: (add_elem) Cannot obtain info for CTL elem (MIXER,'T2 Master codec configure Switch',0,0,0) E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback I/AudioHardwareALSA( 665): Initialized ALSA PLAYBACK
[android-porting] Re: Audio support
Hi, I tried putting it all together. The end system has the device nodes in the correct place with valid permissions, and I even get some promising debug messages. But if I try to play any sound or change the volume, the AudioFlinger service crashes (and is restarted endlessly). And of course, no sound is produced. Apparently, it's looking for a mixer device that does not exist : D/AudioHardwareALSA( 665): mixer initialized. E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback I/AudioHardwareALSA( 665): Initialized ALSA PLAYBACK device AndroidPlayback D/AudioHardwareALSA( 665): Set PLAYBACK PCM format to S16_LE (Signed 16 bit Little Endian) D/AudioHardwareALSA( 665): Using 2 channels for PLAYBACK. D/AudioHardwareALSA( 665): Set PLAYBACK sample rate to 44100 HZ E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback_Speaker_normal E/ALSALib ( 665): external/alsa-lib/src/control/setup.c:555: (add_elem) Cannot obtain info for CTL elem (MIXER,'T2 Master codec configure Switch',0,0,0) E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback I/AudioHardwareALSA( 665): Initialized ALSA PLAYBACK device AndroidPlayback D/AudioHardwareALSA( 665): Set PLAYBACK PCM format to S16_LE (Signed 16 bit Little Endian) D/AudioHardwareALSA( 665): Using 2 channels for PLAYBACK. D/AudioHardwareALSA( 665): Set PLAYBACK sample rate to 44100 HZ W/AudioFlinger( 813): write blocked for 179 msecs W/AudioFlinger( 813): write blocked for 55 msecs D/VolumePanel( 684): onVolumeChanged(streamType: 3, flags: 17) D/VolumePanel( 684): onShowVolumeChanged(streamType: 3, flags: 17), index: 12 I/DEBUG ( 662): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** I/DEBUG ( 662): Build fingerprint: 'generic/omap/omap/:1.0/MVA-RC1/ eng.mpetazzoni.20081126.111057:eng/test- keys' I/DEBUG ( 662): pid: 665, tid: 680 /system/bin/mediaserver I/DEBUG ( 662): signal 11 (SIGSEGV), fault addr Could that be related to a mismatched ALSA driver for the TWL4030? Any idea would help :) Thanks! - Maxime On 26 nov, 11:41, Maxime Petazzoni [EMAIL PROTECTED] wrote: Thanks for making all this work available to the community. I'm building all this right now, and hope I will get it working :) - Maxime On 26 nov, 10:09, Yang, Xiaopeng [EMAIL PROTECTED] wrote: Hi Maxime, The ALSA contribution from Wind River includes alsa-lib and libaudio-alsa libraries, along with other patches for bionic and system/core. Because alsa-lib and libaudio-alsa are new projects, they have been sent to Google for integration, and may be available in the repositories soon. The other modifications on bionic and system/core have been submitted to Gerrit for review: [OK] bionic/ defaulthttp://review.source.android.com/r/fad1668b10d5 (as [EMAIL PROTECTED]) [OK] system/core/ defaulthttp://review.source.android.com/r/e2ff04fb6804 (as [EMAIL PROTECTED]) After above projects and patches have been integrated into andorid, you can build android images with ALSA support. To that end, there are still two things need to do: 1. A /etc/asound.conf is required for ALSA to work. Attached patch adds a sample asound.conf for zoom board, copy this sample file to system/core/rootdir/etc/asound.conf and make necessary changes to it according to your hardware. 2. Add the following line into the BoardConfig.mk of your board: BOARD_USES_ALSA_AUDIO := true then rebuild android to see whether ALSA audio work. Regards, Xiaopeng Maxime Petazzoni 写道: Hi Sean, Do you have more information to give us about when and how this code is going to be available? The implementation proposed down here by Misael looks nice too, but I'd like to have a peek about the code you used for the Freerunner, and more importantly how you used it. Thanks in advance, - Maxime On 12 nov, 05:42, Sean McNeil [EMAIL PROTECTED] wrote: Hi Maxime, Wind River is in the process of submitting an ALSA audio implementation. That is what I use on the Openmoko Freerunner and what has been successfully used on the TI OMAP Zoom reference platform. Maxime Petazzoni wrote: Hi, I believe most of the porting efforts on the various hardware platform will soon get to the point (if not already) of a running system ; the next step being making sure all the basic functionality is there. Audio being one of the most important one, since telephony also depends on it. Without anything done on that front, we're facing the using stubbed
[android-porting] Re: Audio support
Hi. did you check if alsa-lib is working well? I checked it using aplay. It's very simple to compile into Android. I refered to below site. http://letsgoustc.spaces.live.com/Blog/cns!89AD27DFB5E249BA!404.entry On 11/27/08, mvniekerk [EMAIL PROTECTED] wrote: I'm sorry to dump this on a mailing list, but here goes: cd /proc/asound # ls -l lrwxrwxrwx root root 1970-01-01 00:00 PMICaudio - card0 dr-xr-xr-x root root 1970-01-01 00:00 card0 -r--r--r-- root root0 1970-01-01 00:00 pcm -r--r--r-- root root0 1970-01-01 00:00 timers -r--r--r-- root root0 1970-01-01 00:00 cards -r--r--r-- root root0 1970-01-01 00:00 devices -r--r--r-- root root0 1970-01-01 00:00 version dr-xr-xr-x root root 1970-01-01 00:00 oss # cd card0 # ls -l -rw-r--r-- root root0 1970-01-01 00:00 oss_mixer -r--r--r-- root root0 1970-01-01 00:00 id dr-xr-xr-x root root 1970-01-01 00:00 pcm2p dr-xr-xr-x root root 1970-01-01 00:00 pcm1p dr-xr-xr-x root root 1970-01-01 00:00 pcm0c dr-xr-xr-x root root 1970-01-01 00:00 pcm0p # cd ../ # ls -l lrwxrwxrwx root root 1970-01-01 00:01 PMICaudio - card0 dr-xr-xr-x root root 1970-01-01 00:01 card0 -r--r--r-- root root0 1970-01-01 00:01 pcm -r--r--r-- root root0 1970-01-01 00:01 timers -r--r--r-- root root0 1970-01-01 00:01 cards -r--r--r-- root root0 1970-01-01 00:01 devices -r--r--r-- root root0 1970-01-01 00:01 version dr-xr-xr-x root root 1970-01-01 00:01 oss # cat devices 0: [ 0] : control 16: [ 0- 0]: digital audio playback 17: [ 0- 1]: digital audio playback 18: [ 0- 2]: digital audio playback 24: [ 0- 0]: digital audio capture 33:: timer # cd /dev/snd # ls -l crw-rw-r-- system audio 14, 0 1970-01-01 00:00 mixer crw-rw-r-- system audio116, 0 1970-01-01 00:00 controlC0 crw-rw-r-- system audio 14, 4 1970-01-01 00:00 audio crw-rw-r-- system audio 14, 3 1970-01-01 00:00 dsp crw-rw-r-- system audio116, 24 1970-01-01 00:00 pcmC0D0c crw-rw-r-- system audio116, 16 1970-01-01 00:00 pcmC0D0p crw-rw-r-- system audio 14, 12 1970-01-01 00:00 adsp crw-rw-r-- system audio116, 17 1970-01-01 00:00 pcmC0D1p crw-rw-r-- system audio116, 18 1970-01-01 00:00 pcmC0D2p crw-rw-r-- system audio116, 33 1970-01-01 00:00 timer Here is the asound.conf file: # cat /etc/asound.conf # Android ALSA configuration file for OMAP2430SDP using the MXC audio. ## ## Mixer Devices ## ctl.AndroidPlayback { type hw card 0 } ctl.AndroidRecord { type hw card 0 } ## ## Playback Devices ## pcm.AndroidPlayback_Speaker { type hooks slave.pcm { type hw card 0 device 0# Must be of type digital audio playback } hooks.0 { type ctl_elems hook_args [ # Enable audio output from the DSP { name T2 Master codec configure Switch lock false preserve true optional false value true } { name T2 Master codec Sample Rate lock false preserve true optional true value 48000 } { name Playback Source lock false preserve true optional false # Values are: # 0 - 'Stereo Headset' # 1 - 'Hands-free (Speakers)' # 2 - 'Mono Handset' # 3 'USB CarKit' value 'Hands-free (Speakers)' } ] } } pcm.AndroidPlayback_Headset { type hooks slave.pcm { type hw card 0 device 0# Must be of type digital audio playback } hooks.0 { type ctl_elems hook_args [ # Enable audio output from the DSP {
[android-porting] Re: Audio support
I'm sorry to dump this on a mailing list, but here goes: cd /proc/asound # ls -l lrwxrwxrwx root root 1970-01-01 00:00 PMICaudio - card0 dr-xr-xr-x root root 1970-01-01 00:00 card0 -r--r--r-- root root0 1970-01-01 00:00 pcm -r--r--r-- root root0 1970-01-01 00:00 timers -r--r--r-- root root0 1970-01-01 00:00 cards -r--r--r-- root root0 1970-01-01 00:00 devices -r--r--r-- root root0 1970-01-01 00:00 version dr-xr-xr-x root root 1970-01-01 00:00 oss # cd card0 # ls -l -rw-r--r-- root root0 1970-01-01 00:00 oss_mixer -r--r--r-- root root0 1970-01-01 00:00 id dr-xr-xr-x root root 1970-01-01 00:00 pcm2p dr-xr-xr-x root root 1970-01-01 00:00 pcm1p dr-xr-xr-x root root 1970-01-01 00:00 pcm0c dr-xr-xr-x root root 1970-01-01 00:00 pcm0p # cd ../ # ls -l lrwxrwxrwx root root 1970-01-01 00:01 PMICaudio - card0 dr-xr-xr-x root root 1970-01-01 00:01 card0 -r--r--r-- root root0 1970-01-01 00:01 pcm -r--r--r-- root root0 1970-01-01 00:01 timers -r--r--r-- root root0 1970-01-01 00:01 cards -r--r--r-- root root0 1970-01-01 00:01 devices -r--r--r-- root root0 1970-01-01 00:01 version dr-xr-xr-x root root 1970-01-01 00:01 oss # cat devices 0: [ 0] : control 16: [ 0- 0]: digital audio playback 17: [ 0- 1]: digital audio playback 18: [ 0- 2]: digital audio playback 24: [ 0- 0]: digital audio capture 33:: timer # cd /dev/snd # ls -l crw-rw-r-- system audio 14, 0 1970-01-01 00:00 mixer crw-rw-r-- system audio116, 0 1970-01-01 00:00 controlC0 crw-rw-r-- system audio 14, 4 1970-01-01 00:00 audio crw-rw-r-- system audio 14, 3 1970-01-01 00:00 dsp crw-rw-r-- system audio116, 24 1970-01-01 00:00 pcmC0D0c crw-rw-r-- system audio116, 16 1970-01-01 00:00 pcmC0D0p crw-rw-r-- system audio 14, 12 1970-01-01 00:00 adsp crw-rw-r-- system audio116, 17 1970-01-01 00:00 pcmC0D1p crw-rw-r-- system audio116, 18 1970-01-01 00:00 pcmC0D2p crw-rw-r-- system audio116, 33 1970-01-01 00:00 timer Here is the asound.conf file: # cat /etc/asound.conf # Android ALSA configuration file for OMAP2430SDP using the MXC audio. ## ## Mixer Devices ## ctl.AndroidPlayback { type hw card 0 } ctl.AndroidRecord { type hw card 0 } ## ## Playback Devices ## pcm.AndroidPlayback_Speaker { type hooks slave.pcm { type hw card 0 device 0# Must be of type digital audio playback } hooks.0 { type ctl_elems hook_args [ # Enable audio output from the DSP { name T2 Master codec configure Switch lock false preserve true optional false value true } { name T2 Master codec Sample Rate lock false preserve true optional true value 48000 } { name Playback Source lock false preserve true optional false # Values are: # 0 - 'Stereo Headset' # 1 - 'Hands-free (Speakers)' # 2 - 'Mono Handset' # 3 'USB CarKit' value 'Hands-free (Speakers)' } ] } } pcm.AndroidPlayback_Headset { type hooks slave.pcm { type hw card 0 device 0# Must be of type digital audio playback } hooks.0 { type ctl_elems hook_args [ # Enable audio output from the DSP { name T2 Master codec configure Switch value true } { name T2 Master codec Sample Rate value 48000 } {
[android-porting] Re: Audio support
Hi Sean, On Nov 27, 11:01 am, Sean McNeil [EMAIL PROTECTED] wrote: There are a few things you can check: 1) Make sure you have an ALSA audio device enabled in your kernel. 2) Check from a shell if the directory /dev/snd is created and if there is anything in it. 3) Provide your /system/etc/asound.conf file that you are using to describe the audio devices. Yes, I have all that. The TWL4030 device is discovered at boot time by the kernel, and the corresponding devices are created in the /dev/snd directory (with correct permissions). The asound.conf file is included in the system, in its correct location (/system/etc/). As suggested by Sangsu, I will try aplay, but I don't have much hope. Could you give more information about the ALSA driver you're using? Do you have the mixer device called T2 Master codec configure Switch defined in the sound/arm/omap/omap-alsa-twl4030-mixer.c file? I don't, but I do have a T2 Master codec Sample Rate for example. Thanks, - Maxime Sean mvniekerk wrote: Wow, you got that far. I followed the instructions as posted above and the hardware throws out the following: E/ALSALib ( 1610): external/alsa-lib/src/control/control.c:909: (snd_ctl_open_noupdate) Invalid CTL AndroidPlayback E/AudioHardwareALSA( 1610): Unable to attach mixer to device AndroidPlayback: No such file or directory E/ALSALib ( 1610): external/alsa-lib/src/control/control.c:909: (snd_ctl_open_noupdate) Invalid CTL hw:00 E/AudioHardwareALSA( 1610): Unable to attach mixer to device default: No such file or directory E/ALSALib ( 1610): external/alsa-lib/src/control/control.c:909: (snd_ctl_open_noupdate) Invalid CTL AndroidRecord E/AudioHardwareALSA( 1610): Unable to attach mixer to device AndroidRecord: No such file or directory E/ALSALib ( 1610): external/alsa-lib/src/control/control.c:909: (snd_ctl_open_noupdate) Invalid CTL hw:00 E/AudioHardwareALSA( 1610): Unable to attach mixer to device default: No such file or directory Is this missing files and/or wrong permissions? This is code running from git code updated yesterday (26 Nov). All the device files are listed at /dev/snd and /proc/asound is populated with the right files. /etc/asound.conf is there with the right device names (e.g. I've changed card TWL4030 to 0 and also tried MXC). Please be so kind and attach your asound.conf file. On Nov 27, 11:09 am, Maxime Petazzoni [EMAIL PROTECTED] wrote: Hi, I tried putting it all together. The end system has the device nodes in the correct place with valid permissions, and I even get some promising debug messages. But if I try to play any sound or change the volume, the AudioFlinger service crashes (and is restarted endlessly). And of course, no sound is produced. Apparently, it's looking for a mixer device that does not exist : D/AudioHardwareALSA( 665): mixer initialized. E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback I/AudioHardwareALSA( 665): Initialized ALSA PLAYBACK device AndroidPlayback D/AudioHardwareALSA( 665): Set PLAYBACK PCM format to S16_LE (Signed 16 bit Little Endian) D/AudioHardwareALSA( 665): Using 2 channels for PLAYBACK. D/AudioHardwareALSA( 665): Set PLAYBACK sample rate to 44100 HZ E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback_Speaker_normal E/ALSALib ( 665): external/alsa-lib/src/control/setup.c:555: (add_elem) Cannot obtain info for CTL elem (MIXER,'T2 Master codec configure Switch',0,0,0) E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback I/AudioHardwareALSA( 665): Initialized ALSA PLAYBACK device AndroidPlayback D/AudioHardwareALSA( 665): Set PLAYBACK PCM format to S16_LE (Signed 16 bit Little Endian) D/AudioHardwareALSA( 665): Using 2 channels for PLAYBACK. D/AudioHardwareALSA( 665): Set PLAYBACK sample rate to 44100 HZ W/AudioFlinger( 813): write blocked for 179 msecs W/AudioFlinger( 813): write blocked for 55 msecs D/VolumePanel( 684): onVolumeChanged(streamType: 3, flags: 17) D/VolumePanel( 684): onShowVolumeChanged(streamType: 3, flags: 17), index: 12 I/DEBUG ( 662): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** I/DEBUG ( 662): Build fingerprint: 'generic/omap/omap/:1.0/MVA-RC1/ eng.mpetazzoni.20081126.111057:eng/test- keys' I/DEBUG ( 662): pid: 665, tid: 680 /system/bin/mediaserver I/DEBUG ( 662): signal 11 (SIGSEGV), fault addr Could that be related to a mismatched ALSA driver for the TWL4030? Any idea would help :) Thanks! - Maxime On 26
[android-porting] Re: Audio support
Maxime Petazzoni wrote: Hi Sean, On Nov 27, 11:01 am, Sean McNeil [EMAIL PROTECTED] wrote: There are a few things you can check: 1) Make sure you have an ALSA audio device enabled in your kernel. 2) Check from a shell if the directory /dev/snd is created and if there is anything in it. 3) Provide your /system/etc/asound.conf file that you are using to describe the audio devices. Yes, I have all that. The TWL4030 device is discovered at boot time by the kernel, and the corresponding devices are created in the /dev/snd directory (with correct permissions). The asound.conf file is included in the system, in its correct location (/system/etc/). Where did you get the asound.conf? It must relate to your hardware and kernel. It is very specific to a platform. The example version provided relates to the OMAP zoom board with I think kernel 2.6.22 (not sure about this, though). You'll have to use something like alsactl to save off the states and see if they correspond to what is in asound.conf. As suggested by Sangsu, I will try aplay, but I don't have much hope. Could you give more information about the ALSA driver you're using? Do you have the mixer device called T2 Master codec configure Switch defined in the sound/arm/omap/omap-alsa-twl4030-mixer.c file? I don't, but I do have a T2 Master codec Sample Rate for example. I don't have my zoom board available, so I can't check this for you. Thanks, - Maxime Sean mvniekerk wrote: Wow, you got that far. I followed the instructions as posted above and the hardware throws out the following: E/ALSALib ( 1610): external/alsa-lib/src/control/control.c:909: (snd_ctl_open_noupdate) Invalid CTL AndroidPlayback E/AudioHardwareALSA( 1610): Unable to attach mixer to device AndroidPlayback: No such file or directory E/ALSALib ( 1610): external/alsa-lib/src/control/control.c:909: (snd_ctl_open_noupdate) Invalid CTL hw:00 E/AudioHardwareALSA( 1610): Unable to attach mixer to device default: No such file or directory E/ALSALib ( 1610): external/alsa-lib/src/control/control.c:909: (snd_ctl_open_noupdate) Invalid CTL AndroidRecord E/AudioHardwareALSA( 1610): Unable to attach mixer to device AndroidRecord: No such file or directory E/ALSALib ( 1610): external/alsa-lib/src/control/control.c:909: (snd_ctl_open_noupdate) Invalid CTL hw:00 E/AudioHardwareALSA( 1610): Unable to attach mixer to device default: No such file or directory Is this missing files and/or wrong permissions? This is code running from git code updated yesterday (26 Nov). All the device files are listed at /dev/snd and /proc/asound is populated with the right files. /etc/asound.conf is there with the right device names (e.g. I've changed card TWL4030 to 0 and also tried MXC). Please be so kind and attach your asound.conf file. On Nov 27, 11:09 am, Maxime Petazzoni [EMAIL PROTECTED] wrote: Hi, I tried putting it all together. The end system has the device nodes in the correct place with valid permissions, and I even get some promising debug messages. But if I try to play any sound or change the volume, the AudioFlinger service crashes (and is restarted endlessly). And of course, no sound is produced. Apparently, it's looking for a mixer device that does not exist : D/AudioHardwareALSA( 665): mixer initialized. E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback I/AudioHardwareALSA( 665): Initialized ALSA PLAYBACK device AndroidPlayback D/AudioHardwareALSA( 665): Set PLAYBACK PCM format to S16_LE (Signed 16 bit Little Endian) D/AudioHardwareALSA( 665): Using 2 channels for PLAYBACK. D/AudioHardwareALSA( 665): Set PLAYBACK sample rate to 44100 HZ E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback_Speaker_normal E/ALSALib ( 665): external/alsa-lib/src/control/setup.c:555: (add_elem) Cannot obtain info for CTL elem (MIXER,'T2 Master codec configure Switch',0,0,0) E/ALSALib ( 665): external/alsa-lib/src/pcm/pcm.c:2144: (snd_pcm_open_noupdate) Unknown PCM AndroidPlayback I/AudioHardwareALSA( 665): Initialized ALSA PLAYBACK device AndroidPlayback D/AudioHardwareALSA( 665): Set PLAYBACK PCM format to S16_LE (Signed 16 bit Little Endian) D/AudioHardwareALSA( 665): Using 2 channels for PLAYBACK. D/AudioHardwareALSA( 665): Set PLAYBACK sample rate to 44100 HZ W/AudioFlinger( 813): write blocked for 179 msecs W/AudioFlinger( 813): write blocked for 55 msecs D/VolumePanel( 684): onVolumeChanged(streamType: 3, flags: 17) D/VolumePanel( 684):
[android-porting] Re: Audio support
Hi Maxime, The ALSA contribution from Wind River includes alsa-lib and libaudio-alsa libraries, along with other patches for bionic and system/core. Because alsa-lib and libaudio-alsa are new projects, they have been sent to Google for integration, and may be available in the repositories soon. The other modifications on bionic and system/core have been submitted to Gerrit for review: [OK] bionic/ default http://review.source.android.com/r/fad1668b10d5 (as [EMAIL PROTECTED]) [OK] system/core/default http://review.source.android.com/r/e2ff04fb6804 (as [EMAIL PROTECTED]) After above projects and patches have been integrated into andorid, you can build android images with ALSA support. To that end, there are still two things need to do: 1. A /etc/asound.conf is required for ALSA to work. Attached patch adds a sample asound.conf for zoom board, copy this sample file to system/core/rootdir/etc/asound.conf and make necessary changes to it according to your hardware. 2. Add the following line into the BoardConfig.mk of your board: BOARD_USES_ALSA_AUDIO := true then rebuild android to see whether ALSA audio work. Regards, Xiaopeng Maxime Petazzoni 写道: Hi Sean, Do you have more information to give us about when and how this code is going to be available? The implementation proposed down here by Misael looks nice too, but I'd like to have a peek about the code you used for the Freerunner, and more importantly how you used it. Thanks in advance, - Maxime On 12 nov, 05:42, Sean McNeil [EMAIL PROTECTED] wrote: Hi Maxime, Wind River is in the process of submitting an ALSA audio implementation. That is what I use on the Openmoko Freerunner and what has been successfully used on the TI OMAP Zoom reference platform. Maxime Petazzoni wrote: Hi, I believe most of the porting efforts on the various hardware platform will soon get to the point (if not already) of a running system ; the next step being making sure all the basic functionality is there. Audio being one of the most important one, since telephony also depends on it. Without anything done on that front, we're facing the using stubbed audio hardware, no sound will be produced warning message when Dalvik starts. From what I've read, Android relies on an hardware glue library libaudio, providing AudioFlinger with the appropriate AudioInterface implementation to output sound to whatever sound driver the hardware uses. For example, on the HTC G1/MSM72xx hardware platform, Google useshttp://android.git.kernel.org/?p=platform/hardware/msm7k.git;a=summary But I think most of the Androids ports are made on hardware that have ALSA device drivers (OMAP for example). And before 20 different people start implementing their own libaudio bridging to ALSA, maybe we should coordinate this community effort. Starting by knowing if anything has already been started by someone, somewhere :) If not, I will most likely start working on one, and I foresee that it's going to be tough, as the only real documentation is the msm7k libaudio source code itself. Ideas, comments, suggestions ... and help are most welcome! - Maxime PS: of course, if you got audio working without going through this libaudio stuff, please share your discoveries ! --~--~-~--~~~---~--~~ unsubscribe: [EMAIL PROTECTED] website: http://groups.google.com/group/android-porting -~--~~~~--~~--~--~--- Index: b/system/core/rootdir/Android.mk === --- a/system/core/rootdir/Android.mk 2008-11-25 21:16:57.0 +0800 +++ b/system/core/rootdir/Android.mk 2008-11-25 21:30:13.0 +0800 @@ -18,6 +18,14 @@ etc/ppp/ip-down \ etc/ppp/ip-up +ifeq ($(strip $(BOARD_USES_ALSA_AUDIO)),true) + ifeq ($(wildcard $(LOCAL_PATH)/etc/asound.conf),) +$(error $(LOCAL_PATH)/etc/asound.conf not found, create one for your hardware, refer to $(LOCAL_PATH)/etc/asound.conf.zoom as a reference) + else +copy_from += etc/asound.conf + endif +endif + copy_to := $(addprefix $(TARGET_OUT)/,$(copy_from)) copy_from := $(addprefix $(LOCAL_PATH)/,$(copy_from)) Index: b/system/core/rootdir/etc/asound.conf.zoom === --- /dev/null 1970-01-01 00:00:00.0 + +++ b/system/core/rootdir/etc/asound.conf.zoom 2008-11-25 21:30:13.0 +0800 @@ -0,0 +1,167 @@ +# Android ALSA configuration file for OMAP2430SDP using the TWL4030 audio. + +## +## Mixer Devices +## + +ctl.AndroidPlayback { + type hw + card TWL4030 +} + +ctl.AndroidRecord { + type hw + card TWL4030 +} + + +## +## Playback Devices +## + +pcm.AndroidPlayback_Speaker { + type hooks + slave.pcm { + type hw + card TWL4030 + device 0 # Must be of type digital audio playback + } + hooks.0 { + type ctl_elems + hook_args [ + # Enable audio
[android-porting] Re: Audio support
Thanks very much for your help :) These are very helpful to my work. Have a nice day ~~~ :-) On 11/26/08, Maxime Petazzoni [EMAIL PROTECTED] wrote: Thanks for making all this work available to the community. I'm building all this right now, and hope I will get it working :) - Maxime On 26 nov, 10:09, Yang, Xiaopeng [EMAIL PROTECTED] wrote: Hi Maxime, The ALSA contribution from Wind River includes alsa-lib and libaudio-alsa libraries, along with other patches for bionic and system/core. Because alsa-lib and libaudio-alsa are new projects, they have been sent to Google for integration, and may be available in the repositories soon. The other modifications on bionic and system/core have been submitted to Gerrit for review: [OK] bionic/ defaulthttp:// review.source.android.com/r/fad1668b10d5 (as [EMAIL PROTECTED]) [OK] system/core/defaulthttp:// review.source.android.com/r/e2ff04fb6804 (as [EMAIL PROTECTED]) After above projects and patches have been integrated into andorid, you can build android images with ALSA support. To that end, there are still two things need to do: 1. A /etc/asound.conf is required for ALSA to work. Attached patch adds a sample asound.conf for zoom board, copy this sample file to system/core/rootdir/etc/asound.conf and make necessary changes to it according to your hardware. 2. Add the following line into the BoardConfig.mk of your board: BOARD_USES_ALSA_AUDIO := true then rebuild android to see whether ALSA audio work. Regards, Xiaopeng Maxime Petazzoni 写道: Hi Sean, Do you have more information to give us about when and how this code is going to be available? The implementation proposed down here by Misael looks nice too, but I'd like to have a peek about the code you used for the Freerunner, and more importantly how you used it. Thanks in advance, - Maxime On 12 nov, 05:42, Sean McNeil [EMAIL PROTECTED] wrote: Hi Maxime, Wind River is in the process of submitting an ALSA audio implementation. That is what I use on the Openmoko Freerunner and what has been successfully used on the TI OMAP Zoom reference platform. Maxime Petazzoni wrote: Hi, I believe most of the porting efforts on the various hardware platform will soon get to the point (if not already) of a running system ; the next step being making sure all the basic functionality is there. Audio being one of the most important one, since telephony also depends on it. Without anything done on that front, we're facing the using stubbed audio hardware, no sound will be produced warning message when Dalvik starts. From what I've read, Android relies on an hardware glue library libaudio, providing AudioFlinger with the appropriate AudioInterface implementation to output sound to whatever sound driver the hardware uses. For example, on the HTC G1/MSM72xx hardware platform, Google useshttp:// android.git.kernel.org/?p=platform/hardware/msm7k.git;a=summary But I think most of the Androids ports are made on hardware that have ALSA device drivers (OMAP for example). And before 20 different people start implementing their own libaudio bridging to ALSA, maybe we should coordinate this community effort. Starting by knowing if anything has already been started by someone, somewhere :) If not, I will most likely start working on one, and I foresee that it's going to be tough, as the only real documentation is the msm7k libaudio source code itself. Ideas, comments, suggestions ... and help are most welcome! - Maxime PS: of course, if you got audio working without going through this libaudio stuff, please share your discoveries ! sample_asound_conf.patch 3KAfficherTélécharger --~--~-~--~~~---~--~~ unsubscribe: [EMAIL PROTECTED] website: http://groups.google.com/group/android-porting -~--~~~~--~~--~--~---
[android-porting] Re: Audio support
I managed to make Android build the libaudio shared library (taken from omapzoom.org), which was then put where it should be in /system/ lib/. I also have BOARD_USE_GENERIC_AUDIO set to false, which should make audioflinger use this libaudio instead of the generic libaudiointerface, but I still get the error message: W/AudioHardwareInterface( 665): Using stubbed audio hardware. No sound will be produced. Any idea what I could be missing here? Thanks in advance, - Maxime On 12 nov, 06:23, Misael Lopez [EMAIL PROTECTED] wrote: I have been working in that audio interface for ALSA in OMAP processor, you can find our tree at: http://git.omapzoom.org/?p=android/hardware/ti/omap3.git;a=summary We have been successfully played and capture audio using TWL4030 chip in OmapZoom board with that current version of the interface. I'm working on bringing the control part, probably we can have that part ready soon. It will be great if the community collaborates to correct/improve current code. You can find more information atwww.omapzoom.org, particularly about Android if you go to Projects-Android on OMAPZoom. Misa 2008/11/11 Sean McNeil [EMAIL PROTECTED]: Hi Maxime, Wind River is in the process of submitting an ALSA audio implementation. That is what I use on the Openmoko Freerunner and what has been successfully used on the TI OMAP Zoom reference platform. Maxime Petazzoni wrote: Hi, I believe most of the porting efforts on the various hardware platform will soon get to the point (if not already) of a running system ; the next step being making sure all the basic functionality is there. Audio being one of the most important one, since telephony also depends on it. Without anything done on that front, we're facing the using stubbed audio hardware, no sound will be produced warning message when Dalvik starts. From what I've read, Android relies on an hardware glue library libaudio, providing AudioFlinger with the appropriate AudioInterface implementation to output sound to whatever sound driver the hardware uses. For example, on the HTC G1/MSM72xx hardware platform, Google useshttp://android.git.kernel.org/?p=platform/hardware/msm7k.git;a=summary But I think most of the Androids ports are made on hardware that have ALSA device drivers (OMAP for example). And before 20 different people start implementing their own libaudio bridging to ALSA, maybe we should coordinate this community effort. Starting by knowing if anything has already been started by someone, somewhere :) If not, I will most likely start working on one, and I foresee that it's going to be tough, as the only real documentation is the msm7k libaudio source code itself. Ideas, comments, suggestions ... and help are most welcome! - Maxime PS: of course, if you got audio working without going through this libaudio stuff, please share your discoveries ! --~--~-~--~~~---~--~~ unsubscribe: [EMAIL PROTECTED] website: http://groups.google.com/group/android-porting -~--~~~~--~~--~--~---
[android-porting] Re: Audio support
Hi, On 25 nov, 16:26, Sangsu Park [EMAIL PROTECTED] wrote: I had same problem with you. But after clean build, audiofligner use the libaudio. I think that android build system have some weakness. That makes sense. I will try from a clean build. But I have another problem. When AudioHardwareOmap::openOutputStream() is called, snd_pcm_open() is failed. Error message is like 'no device file'. (I didn't remember exactly) I think that this is caused by no device file that time. Who can you explain this situation? or solve? Maybe check your /dev/pcm* and /dev/control* device node permissions ? Just a wild guess. - Maxime On 11/25/08, Maxime Petazzoni [EMAIL PROTECTED] wrote: I managed to make Android build the libaudio shared library (taken from omapzoom.org), which was then put where it should be in /system/ lib/. I also have BOARD_USE_GENERIC_AUDIO set to false, which should make audioflinger use this libaudio instead of the generic libaudiointerface, but I still get the error message: W/AudioHardwareInterface( 665): Using stubbed audio hardware. No sound will be produced. Any idea what I could be missing here? Thanks in advance, - Maxime On 12 nov, 06:23, Misael Lopez [EMAIL PROTECTED] wrote: I have been working in that audio interface for ALSA in OMAP processor, you can find our tree at: http://git.omapzoom.org/?p=android/hardware/ti/omap3.git;a=summary We have been successfully played and capture audio using TWL4030 chip in OmapZoom board with that current version of the interface. I'm working on bringing the control part, probably we can have that part ready soon. It will be great if the community collaborates to correct/improve current code. You can find more information atwww.omapzoom.org, particularly about Android if you go to Projects-Android on OMAPZoom. Misa 2008/11/11 Sean McNeil [EMAIL PROTECTED]: Hi Maxime, Wind River is in the process of submitting an ALSA audio implementation. That is what I use on the Openmoko Freerunner and what has been successfully used on the TI OMAP Zoom reference platform. Maxime Petazzoni wrote: Hi, I believe most of the porting efforts on the various hardware platform will soon get to the point (if not already) of a running system ; the next step being making sure all the basic functionality is there. Audio being one of the most important one, since telephony also depends on it. Without anything done on that front, we're facing the using stubbed audio hardware, no sound will be produced warning message when Dalvik starts. From what I've read, Android relies on an hardware glue library libaudio, providing AudioFlinger with the appropriate AudioInterface implementation to output sound to whatever sound driver the hardware uses. For example, on the HTC G1/MSM72xx hardware platform, Google useshttp://android.git.kernel.org/?p=platform/hardware/msm7k.git;a=summary But I think most of the Androids ports are made on hardware that have ALSA device drivers (OMAP for example). And before 20 different people start implementing their own libaudio bridging to ALSA, maybe we should coordinate this community effort. Starting by knowing if anything has already been started by someone, somewhere :) If not, I will most likely start working on one, and I foresee that it's going to be tough, as the only real documentation is the msm7k libaudio source code itself. Ideas, comments, suggestions ... and help are most welcome! - Maxime PS: of course, if you got audio working without going through this libaudio stuff, please share your discoveries ! --~--~-~--~~~---~--~~ unsubscribe: [EMAIL PROTECTED] website: http://groups.google.com/group/android-porting -~--~~~~--~~--~--~---
[android-porting] Re: Audio support
Is your device show up in /dev? Have you checked permissions? Did you add your device to the devperms table in system/core/init/devices.c? On Nov 25, 5:29 pm, Sangsu Park [EMAIL PROTECTED] wrote: Thanks for your reply. But I think that you had some misunderstanding about my article. I now use own implementation which is called AudioHardwareOmap. You can see them below url. http://git.omapzoom.org/?p=android/hardware/ti/omap3.git;a=summary I had some problem when snd_pcm_open is called in AudioHardwareOmap. snd_pcm_open is failed because of no device node. So I tried attaching below code into init.rc But, the result is same. T.T on early-init device /dev/pcmC0D0p 0666 root audio Who can help me? :) On 11/26/08, Dave Sparks [EMAIL PROTECTED] wrote: AudioHardwareGeneric tries to open /dev/eac. If /dev/eac fails to open or respond correctly to I/O requests (read/write,ioctl), the audio HAL will fall back to AudioHardwareStub which is just a null output driver that emulates timing using usleep() calls. You can either write your own implementation of own AudioHardwareInterface, or make your audio kernel driver respond to the same I/O requests as /dev/eac. On Nov 25, 8:29 am, Maxime Petazzoni [EMAIL PROTECTED] wrote: Hi, On 25 nov, 16:26, Sangsu Park [EMAIL PROTECTED] wrote: I had same problem with you. But after clean build, audiofligner use the libaudio. I think that android build system have some weakness. That makes sense. I will try from a clean build. But I have another problem. When AudioHardwareOmap::openOutputStream() is called, snd_pcm_open() is failed. Error message is like 'no device file'. (I didn't remember exactly) I think that this is caused by no device file that time. Who can you explain this situation? or solve? Maybe check your /dev/pcm* and /dev/control* device node permissions ? Just a wild guess. - Maxime On 11/25/08, Maxime Petazzoni [EMAIL PROTECTED] wrote: I managed to make Android build the libaudio shared library (taken from omapzoom.org), which was then put where it should be in /system/ lib/. I also have BOARD_USE_GENERIC_AUDIO set to false, which should make audioflinger use this libaudio instead of the generic libaudiointerface, but I still get the error message: W/AudioHardwareInterface( 665): Using stubbed audio hardware. No sound will be produced. Any idea what I could be missing here? Thanks in advance, - Maxime On 12 nov, 06:23, Misael Lopez [EMAIL PROTECTED] wrote: I have been working in that audio interface for ALSA in OMAP processor, you can find our tree at: http://git.omapzoom.org/?p=android/hardware/ti/omap3.git;a=summary We have been successfully played and capture audio using TWL4030 chip in OmapZoom board with that current version of the interface. I'm working on bringing the control part, probably we can have that part ready soon. It will be great if the community collaborates to correct/improve current code. You can find more information atwww.omapzoom.org, particularly about Android if you go to Projects-Android on OMAPZoom. Misa 2008/11/11 Sean McNeil [EMAIL PROTECTED]: Hi Maxime, Wind River is in the process of submitting an ALSA audio implementation. That is what I use on the Openmoko Freerunner and what has been successfully used on the TI OMAP Zoom reference platform. Maxime Petazzoni wrote: Hi, I believe most of the porting efforts on the various hardware platform will soon get to the point (if not already) of a running system ; the next step being making sure all the basic functionality is there. Audio being one of the most important one, since telephony also depends on it. Without anything done on that front, we're facing the using stubbed audio hardware, no sound will be produced warning message when Dalvik starts. From what I've read, Android relies on an hardware glue library libaudio, providing AudioFlinger with the appropriate AudioInterface implementation to output sound to whatever sound driver the hardware uses. For example, on the HTC G1/MSM72xx hardware platform, Google useshttp:// android.git.kernel.org/?p=platform/hardware/msm7k.git;a=summary But I think most of the Androids ports are made on hardware that have ALSA device drivers (OMAP for example). And before 20 different people start implementing their own libaudio bridging to ALSA, maybe we should coordinate this community effort. Starting by knowing if anything has already been started by someone, somewhere :) If not, I will most likely start working on one, and I foresee that it's going to be tough, as the only real documentation