Hello Murali,

Generally XRUN happens due to improper buffer size settings.Try
changing your buffer size.
You can use aplay utility to check different buffer sizes and for
recording you can use arecord.

Still if it doesn't work then it would be better if you can show us
the driver logs.Enable logs in your audio driver and ALSA core.

^^^keep trying^^^

On Jan 5, 11:45 am, "Murali K. Vemuri"
<vemuri.muralikris...@gmail.com> wrote:
> Hi Amit & group,
> I am using Eclair.
>
> My board is a custom board and I am making changes in the EVM kernel to
> match to my board.
> my Audio Codec is WM8993 (WolfSon Microelectronics). Little more info into
> the pin connections is:
>
> 1. I connected the OMAP 3530 MCBSP2  (phys_base: 0x49022000) to WM8993 for
> Audio data. (MCBSP2 DX2 --> AUDIO CODEC DX) & (MCBSP2 DR2 --> AUDIO CODEC
> DR)
> 2. WM8993 is Clock master, and sends the SCLK (MCBSP FSX) & LRCLK (MCBSP
> CLKX) to MCBSP. I checked with Oscilloscope that these clocks are fine.
> 3. WM8993 is controlled using the I2C3 of OMAP.
> 4. Data format between MCBSP and Audio CODEC is I2S  (with no companding)
>
> This is the MCBSP register dump:
> omap-mcbsp omap-mcbsp.2: **** McBSP2 regs ****
> omap-mcbsp omap-mcbsp.2: DRR2:  0xddbe3b7d
> omap-mcbsp omap-mcbsp.2: DRR1:  0x0000
> omap-mcbsp omap-mcbsp.2: DXR2:  0x0000
> omap-mcbsp omap-mcbsp.2: DXR1:  0x0000
> omap-mcbsp omap-mcbsp.2: SPCR2: 0x02f5
> omap-mcbsp omap-mcbsp.2: SPCR1: 0x0030
> omap-mcbsp omap-mcbsp.2: RCR2:  0x8041
> omap-mcbsp omap-mcbsp.2: RCR1:  0x0040
> omap-mcbsp omap-mcbsp.2: XCR2:  0x8041
> omap-mcbsp omap-mcbsp.2: XCR1:  0x0040
> omap-mcbsp omap-mcbsp.2: SRGR2: 0x001f
> omap-mcbsp omap-mcbsp.2: SRGR1: 0x0f00
> omap-mcbsp omap-mcbsp.2: PCR0:  0x0a0f
> omap-mcbsp omap-mcbsp.2: ***********************
>
> please let me know if you need more info.
> Thanks & regards
> Murali
>
> On Wed, Jan 5, 2011 at 3:07 PM, Amit Pundir <pundira...@gmail.com> wrote:
> > looping in rowboat mailing list.
>
> > On Wed, Jan 5, 2011 at 8:20 AM, Murali K. Vemuri <
> > vemuri.muralikris...@gmail.com> wrote:
>
> >> Okay,
> >> I kept digging further and finally found that my driver is going to XRUNs
> >> whenever I try to load any piece of audio .
>
> >> when my board completed booting, the params look like:
>
> >> #cat /proc/asound/card0/pcm0p/sub0/status
> >> state: PREPARED
> >> owner_pid   : 1055
> >> trigger_time: 0.000000000
> >> tstamp      : 10.809844973
> >> delay       : 0
> >> avail       : 2048
> >> avail_max   : 0
> >> -----
> >> hw_ptr      : 0
> >> appl_ptr    : 0
>
> >> But when android tries to play the booting sound, it immediately changes
> >> to the following. And is not able to recover .
>
> >> #cat /proc/asound/card0/pcm0p/sub0/status
> >> state: XRUN
> >> owner_pid   : 1055
> >> trigger_time: 30.074615484
> >> tstamp      : 39.793883833
> >> delay       : 0
> >> avail       : 2048
> >> avail_max   : 2083
> >> -----
> >> hw_ptr      : 2048
> >> appl_ptr    : 2048
>
> >> I am using Android RowBoat version and I am not sure if it is a known
> >> issue or has some_fix_I_did_not_adapt.
>
> > Which Android version(Eclair, Froyo etc) are you using? Are you building
> > the images yourself or using the pre-built images?
>
> > You don't need asound.conf for Android 2.2(Froyo) Rowboat port AFAIR. I
> > have used Rowboat froyo port on OMAP3EVM and Beagleboard as well and found
> > no such issues with sound.
>
> > Regards,
> > Amit Pundir
>
> >> any ideas?
>
> >> Thanks & regards
> >> Murali
>
> >> On Mon, Jan 3, 2011 at 4:15 PM, Amit Pundir <pundira...@gmail.com> wrote:
>
> >>> On Sun, Jan 2, 2011 at 6:34 PM, Murali K. Vemuri <
> >>> vemuri.muralikris...@gmail.com> wrote:
>
> >>>> Hello Srinath and group,
>
> >>>> I made the changes in asound.conf and also I found some h/w errors and
> >>>> also some issues at driver, and fixed one by one. Finally I checked the
> >>>> BIT(or Serial) CLK & LR (Left-Right) CLK for my codec, once I got all 
> >>>> these
> >>>> right, now I have the "logcat" filled with these log messages.
>
> >>>> W/AudioTrack( 1054): obtainBuffer timed out (is the CPU pegged?) 0x61e60
> >>>> user=00003000, server=00001000
> >>>> W/AudioTrack( 1054): obtainBuffer timed out (is the CPU pegged?) 0x61e60
> >>>> user=00003000, server=00001000
> >>>> W/AudioTrack( 1054): obtainBuffer timed out (is the CPU pegged?) 0x61e60
> >>>> user=00003000, server=00001000
> >>>> W/AudioTrack( 1054): obtainBuffer timed out (is the CPU pegged?) 0x61e60
> >>>> user=00003000, server=00001000
> >>>> W/AudioFlinger( 1054): write blocked for 9999 msecs, 5 delayed writes,
> >>>> thread 0x539c0
> >>>> W/AudioFlinger( 1054): write blocked for 9999 msecs, 6 delayed writes,
> >>>> thread 0x539c0
> >>>> W/AudioFlinger( 1054): write blocked for 9999 msecs, 7 delayed writes,
> >>>> thread 0x539c0
> >>>> W/AudioFlinger( 1054): write blocked for 9999 msecs, 8 delayed writes,
> >>>> thread 0x539c0
> >>>> I googled on this, but nothing much I could use on this error.
>
> >>> Hi Murali,
>
> >>> I got a similar issue sometime back on a different platform. In my case
> >>> the issue was with my audio driver which was not able to reset the device
> >>> properly. This causes the write to the Audio device to block indefinitely
> >>> and the buffers never got freed and thats why I was getting "unable to
> >>> obtain buffer, cpu pegged?" error.
>
> >>> 1) Recommended solution is to debug your audio driver and check if it
> >>> handles suspend/resume mode properly.
> >>> 2) A quick fix is to modify the Android user space and don't let your
> >>> audio go in stand-by mode.
>
> >>> As far as OMAP3 is concerned try Rowboat, Android port
> >>>http://code.google.com/p/rowboat/which has Android base port available
> >>> for TI OMAP35x, AM35x, AM37x and DM37x platforms.
>
> >>> Regards,
> >>> Amit Pundir
>
> >>>> Any pointers???
> >>>> Thanks & regards
> >>>> Murali
> >>>> On Mon, Dec 27, 2010 at 11:48 PM, srinath ramini <
> >>>> raminisrin...@gmail.com> wrote:
>
> >>>>> Hi Murali,
>
> >>>>> In your asound.conf file AndroidPlayback pcm configuration details are
> >>>>> not avilable.
>
> >>>>> Replace your asound.conf with the following content and try it.
>
> >>>>> ##
>
> >>>>> ## Mixer Devices
>
> >>>>> ##
>
> >>>>> ctl.AndroidPlayback {
>
> >>>>> type hw
>
> >>>>> card 1
>
> >>>>> device 0
>
> >>>>> }
>
> >>>>> ctl.AndroidCapture {
>
> >>>>> type hw
>
> >>>>> card 1
>
> >>>>> device 0
>
> >>>>> }
>
> >>>>> ##
>
> >>>>> ## Playback Devices
>
> >>>>> ##
>
> >>>>> pcm.AndroidPlayback {
>
> >>>>> type hw
>
> >>>>> card 1
>
> >>>>> device 0
>
> >>>>> }
>
> >>>>> ##
>
> >>>>> ## Recording device
>
> >>>>> ##
>
> >>>>> pcm.AndroidCapture {
>
> >>>>> type hw
>
> >>>>> card 1
>
> >>>>> device 0
>
> >>>>> }
>
> >>>>> Regards,
>
> >>>>> Sreenath
> >>>>>   On Sat, Dec 25, 2010 at 5:41 PM, Murali K. Vemuri <
> >>>>> vemuri.muralikris...@gmail.com> wrote:
>
> >>>>>> Hello there,
> >>>>>> Sorry for the delayed reply. I see these log messages on "logcat":
>
> >>>>>> E/AudioHardwareALSA( 1031): ERROR PIPE (underflow), resetting to
> >>>>>> RECOVER!!
>
> >>>>>> E/AudioHardwareALSA( 1031):
>
> >>>>>> and since I am not very familiar with the android config files, I am
> >>>>>> attaching my default config file. Can someone help me?
>
> >>>>>> Thanks &regards
> >>>>>> Murali
>
> >>>>>> On Thu, Dec 23, 2010 at 12:14 AM, srinath ramini <
> >>>>>> raminisrin...@gmail.com> wrote:
>
> >>>>>>> Hi Murali,
>
> >>>>>>> Please check your /etc/asound.conf file. File should conatin Hardware
> >>>>>>> configuration details.
>
> >>>>>>> Regards,
> >>>>>>> Sreenath
>
> >>>>>>>   On Wed, Dec 22, 2010 at 4:27 PM, Murali K. Vemuri <
> >>>>>>> vemuri.muralikris...@gmail.com> wrote:
>
> >>>>>>>>  Hello group,
>
> >>>>>>>> I am using LINUX with Android on OMAP3530 and am finding Audio is
> >>>>>>>> not working.
> >>>>>>>> I tried checking the "logcat" and the output:
>
> >>>>>>>>  W/AudioHardwareALSA( 1020): Unable to attach mixer to device
> >>>>>>>> AndroidOut: Invalid argument
>
> >>>>>>>> W/AudioHardwareALSA( 1020): Unable to attach mixer to device
> >>>>>>>> AndroidIn: Invalid argument
>
> >>>>>>>> I/CameraService( 1020): CameraService started: pid=1020
>
> >>>>>>>> D/AudioHardwareALSA( 1020): openOutputStream called for devices:
> >>>>>>>> 0x00000002
>
> >>>>>>>> D/ALSAModule( 1020): open called for devices 00000002 in mode 0...
>
> >>>>>>>> E/ALSALib ( 1020):
> >>>>>>>> external/alsa-lib/src/pcm/pcm.c:2201:(snd_pcm_open_noupdate) Unknown 
> >>>>>>>> PCM
> >>>>>>>> AndroidPlayback_Speaker_normal
>
> >>>>>>>> E/ALSALib ( 1020):
> >>>>>>>> external/alsa-lib/src/pcm/pcm.c:2201:(snd_pcm_open_noupdate) Unknown 
> >>>>>>>> PCM
> >>>>>>>> AndroidPlayback_Speaker
>
> >>>>>>>> E/ALSALib ( 1020):
> >>>>>>>> external/alsa-lib/src/pcm/pcm.c:2201:(snd_pcm_open_noupdate) Unknown 
> >>>>>>>> PCM
> >>>>>>>> AndroidPlayback
>
> >>>>>>>> D/AndroidRuntime( 1018): --- registering native functions ---
>
> >>>>>>>> I/ALSAModule( 1020): Initialized ALSA PLAYBACK device default
>
> >>>>>>>> I/AudioFlinger( 1020): AudioFlinger's thread 0x53018 ready to run
>
> >>>>>>>> D/ALSAModule( 1020): route called for devices 00000002 in mode 0...
>
> >>>>>>>> Any pointers????
>
> >>>>>>>> Thanks & regards
> >>>>>>>> Murali
>
> >>>>>>>> --
> >>>>>>>> unsubscribe: 
> >>>>>>>> android-porting+unsubscr...@googlegroups.com<android-porting%2bunsubscr...@googlegroups.com>
> >>>>>>>> website:http://groups.google.com/group/android-porting
>
> >>>> --
> >>>> न चोर हार्यं न च राजहार्यं
> >>>> न भ्रातृभाज्यं न च भारकारी
> >>>> व्ययी कृते वर्धत एव नित्यं
> >>>> विद्या धनं सर्व धनं प्रधानं
> >>>> Thieves cannot steal it, Kings cannot tax it,
> >>>> Siblings cannot demand a share in it, and it does not weigh a lot,
> >>>> The more you spend it, increases every day,
> >>>> the wealth of knowledge is the PRIME WEALTH .
>
> >>>>  --
> >>>> unsubscribe: 
> >>>> android-porting+unsubscr...@googlegroups.com<android-porting%2bunsubscr...@googlegroups.com>
> >>>> website:http://groups.google.com/group/android-porting
>
> >> --
> >> न चोर हार्यं न च राजहार्यं
> >> न भ्रातृभाज्यं न च भारकारी
> >> व्ययी कृते वर्धत एव नित्यं
>
> ...
>
> read more »

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to