Audio random LOST on i.MX 6Q

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Audio random LOST on i.MX 6Q

3,148 Views
AndyHo
Contributor III

Hi,

We have a customer imx6q board based on 4.4.3_GA bsp, the OS is android 4.4.3 and kernel is 3.10.53. all cofiguration is set same as imx6q-sabresdb/sdp

We found the audio will lost when play vidio ( youtube, mxplayer...) or audio ( mp3 ) for several hours.

The error log shown as following:

Android tinyalsaHAL:

Failure start:
W/audio_hw_primary(  155): ret -1, pcm write 768 error cannot write stream data: I/O error.
W/audio_hw_primary(  155): pcm_state(pcm) = 3.
W/audio_hw_primary(  155): PCM_STATE_RUNNING
V/audio_hw_primary(  155): write error, sleep few ms
W/audio_hw_primary(  155): ret -1, pcm write 768 error cannot prepare channel1: Device or resource busy.
W/audio_hw_primary(  155): pcm_state(pcm) = 3.
W/audio_hw_primary(  155): PCM_STATE_RUNNING
V/audio_hw_primary(  155): write error, sleep few ms
W/audio_hw_primary(  155): ret -1, pcm write 768 error cannot prepare channel1: Device or resource busy.
W/audio_hw_primary(  155): pcm_state(pcm) = 3.
W/audio_hw_primary(  155): PCM_STATE_RUNNING
(loop)


kernel PCM_lib xrun_debug log

<7>ALSA sound/core/pcm_lib.c:407 period_update: pcmC0D0p:0: pos=768/192/1536, hwptr=192/1023552/1023744/1022976
<7>ALSA sound/core/pcm_lib.c:407 hwptr_update: pcmC0D0p:0: pos=768/192/1536, hwptr=0/1023744/1023744/1022976
<7>ALSA sound/core/pcm_lib.c:407 hwptr_update: pcmC0D0p:0: pos=768/192/1536, hwptr=0/1023744/1023744/1022976
<7>ALSA sound/core/pcm_lib.c:407 period_update: pcmC0D0p:0: pos=960/192/1536, hwptr=192/1023744/1023936/1022976
<7>ALSA sound/core/pcm_lib.c:407 hwptr_update: pcmC0D0p:0: pos=960/192/1536, hwptr=0/1023936/1023936/1022976
<7>ALSA sound/core/pcm_lib.c:407 hwptr_update: pcmC0D0p:0: pos=960/192/1536, hwptr=0/1023936/1023936/1022976
<7>ALSA sound/core/pcm_lib.c:407 period_update: pcmC0D0p:0: pos=1152/192/1536, hwptr=192/1023936/1024128/1022976
<7>ALSA sound/core/pcm_lib.c:407 hwptr_update: pcmC0D0p:0: pos=1152/192/1536, hwptr=0/1024128/1024128/1022976
<7>ALSA sound/core/pcm_lib.c:407 hwptr_update: pcmC0D0p:0: pos=1152/192/1536, hwptr=0/1024128/1024128/1022976
<7>ALSA sound/core/pcm_lib.c:407 period_update: pcmC0D0p:0: pos=1344/192/1536, hwptr=192/1024128/1024320/1022976
<7>ALSA sound/core/pcm_lib.c:407 hwptr_update: pcmC0D0p:0: pos=1344/192/1536, hwptr=0/1024320/1024320/1022976

Failure start.........................

<7>ALSA sound/core/pcm_lib.c:407 hwptr_update: pcmC0D0p:0: pos=1344/192/1536, hwptr=0/1130304/1130304/1128960
<7>ALSA sound/core/pcm_lib.c:407 hwptr_update: pcmC0D0p:0: pos=1344/192/1536, hwptr=0/1130304/1130304/1128960
<7>ALSA sound/core/pcm_lib.c:407 hwptr_update: pcmC0D0p:0: pos=1344/192/1536, hwptr=0/1130304/1130304/1128960
<7>ALSA sound/core/pcm_lib.c:407 hwptr_update: pcmC0D0p:0: pos=1344/192/1536, hwptr=0/1130304/1130304/1128960
<7>ALSA sound/core/pcm_lib.c:407 hwptr_update: pcmC0D0p:0: pos=1344/192/1536, hwptr=0/1130304/1130304/1128960
<7>ALSA sound/core/pcm_lib.c:407 hwptr_update: pcmC0D0p:0: pos=1344/192/1536, hwptr=0/1130304/1130304/1128960
<7>ALSA sound/core/pcm_lib.c:407 hwptr_update: pcmC0D0p:0: pos=1344/192/1536, hwptr=0/1130304/1130304/1128960

1.You can see the android and kernel log when failure started, the app continuous playing but no sound output
2.All hardware signal can be measured ( mclk, bclk,....) , even aud bus (PCM)
3.If the error just occured, stop the playing for a while, then start play again, the sound will back, but if the error occur for a long time, you must wait the pcm write error to stop then start play, or reboot.

4. From the kernel pcm error xrun_debug log, you can see no "period_update" when error occur (bold mark), the "hwptr_update" will never changed
5. I found the issue is simular to https://community.nxp.com/thread/304919 , but we have no "DMA or IRQ trouble" ( or I didn't enable DMA debug), and the asrc is not used

I think the issue may caused by imx dma implementation, but don't know how to debug and solve, hope I can get support here, thanks.

Labels (3)
0 Kudos
Reply
5 Replies

2,348 Views
igorpadykov
NXP Employee
NXP Employee

Hi Andy

was omxplayer (omxplayer_source.tar.gz) installed on board image, please refer to

sect.6 Freescale Extended Feature Packages attached Release Notes and Extended

Codec Release Notes. Otherwise software video codecs may be used and there may be underrun

issues.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

2,348 Views
AndyHo
Contributor III

Hi Igor,

After mxplayer is integrated, playing mp3 for a long time, the same error still occur.

The failure occur randomly when following conditions:


1. When android playing audio for a long time, the screen will be turned off, the music still play, when I wake up the system, it's possible that you can see the music time slidebar is still playing, but no sound output, Non of any audio logcat/kernel error log during suspend and resume, after few seconds, the error happens. If you stop the play, the error still happened for a long time, but the error will stop finally, then you can start play new audio, depends on how long the error happens.

2. When android playing audio, if you press "next track" randomly, it is also possible to speed up to reproduce the issue
3. If the error occur once, it is more easy to reproduce the issue in a short period.

Please note that we only test audio playback( no video), from my first post, the issue seems related to ssi/dma, when the issue happen, the pcm status is "running", not xrun, I know the tinyalsa have the solution to prevent xrun, but I need to a solution to solve/recover the PCM "running" failure.

Or if no solution provide, can we disable the ssi DMA? how to do it?

Thank you

Andy

0 Kudos
Reply

2,348 Views
igorpadykov
NXP Employee
NXP Employee

Hi Andy

android 4.4.3 is outdated and may be supported using mss services.

http://www.nxp.com/support/nxp-professional-services:PROFESSIONAL-SERVICE

suggested to migrate to latest android releases on

i.MX 6 Series Software and Development Tool|NXP 

Best regards
igor

0 Kudos
Reply

2,348 Views
AndyHo
Contributor III

Hi Igor,

Thank you.


0 Kudos
Reply

2,348 Views
AndyHo
Contributor III

Hi Igor,

Thank you very much for your support.
After build the omxplayer into android, I get additional messages when playing mp3 using android original Music2 app, does it means the omxplayer working ? If so, I will perform long time audio playing test again and will feedback the test result. Thanks
=================================================================================

I/OMXPlayer(  154): file size: 4815042, buffer size : 131072
I/OMXPlayer(  154): Loading content: sharedfd://27:0:4815042:0
I/OMXPlayer(  154): LEVEL: 1 FUNCTION: char* GMPlayer::MediaTypeInspect() LINE: 1863
I/OMXPlayer(  154): Can't inspect media content type by subfix.
I/OMXPlayer(  154): file size: 4815042, buffer size : 131072
I/OMXPlayer(  154): MediaTypeInspectByContent role: parser.mp3
E/MetadataRetrieverClient(  154): failed to extract an album art
I/OMXPlayer(  154): file size: 4815042, buffer size : 131072
I/OMXPlayer(  154): Loading content: sharedfd://27:0:4815042:0
I/OMXPlayer(  154): LEVEL: 1 FUNCTION: char* GMPlayer::MediaTypeInspect() LINE: 1863
I/OMXPlayer(  154): Can't inspect media content type by subfix.
I/OMXPlayer(  154): file size: 4815042, buffer size : 131072
I/OMXPlayer(  154): MediaTypeInspectByContent role: parser.mp3
E/MetadataRetrieverClient(  154): failed to extract an album art
I/OMXPlayer(  154): file size: 2801450, buffer size : 131072
I/OMXPlayer(  154): Loading content: sharedfd://27:0:2801450:0
I/OMXPlayer(  154): LEVEL: 1 FUNCTION: char* GMPlayer::MediaTypeInspect() LINE: 1863
I/OMXPlayer(  154): Can't inspect media content type by subfix.
I/OMXPlayer(  154): file size: 2801450, buffer size : 131072
I/OMXPlayer(  154): MediaTypeInspectByContent role: parser.mp3
E/MetadataRetrieverClient(  154): failed to extract an album art
I/OMXPlayer(  154): file size: 4815042, buffer size : 131072
I/OMXPlayer(  154): Loading content: sharedfd://27:0:4815042:0
I/OMXPlayer(  154): LEVEL: 1 FUNCTION: char* GMPlayer::MediaTypeInspect() LINE: 1863
I/OMXPlayer(  154): Can't inspect media content type by subfix.
I/OMXPlayer(  154): file size: 4815042, buffer size : 131072
I/OMXPlayer(  154): MediaTypeInspectByContent role: parser.mp3
E/MetadataRetrieverClient(  154): failed to extract an album art
I/ActivityManager(  465): Displayed com.android.music/.MediaPlaybackActivity: +353ms
I/OMXPlayer(  154): file size: 4815042, buffer size : 131072
I/OMXPlayer(  154): Loading content: sharedfd://27:0:4815042:0
I/OMXPlayer(  154): LEVEL: 1 FUNCTION: char* GMPlayer::MediaTypeInspect() LINE: 1863
I/OMXPlayer(  154): Can't inspect media content type by subfix.
I/OMXPlayer(  154): file size: 4815042, buffer size : 131072
I/OMXPlayer(  154): MediaTypeInspectByContent role: parser.mp3
E/MetadataRetrieverClient(  154): failed to extract an album art
I/OMXPlayer(  154): file size: 2801450, buffer size : 131072
I/OMXPlayer(  154): Loading content: sharedfd://27:0:2801450:0
I/OMXPlayer(  154): LEVEL: 1 FUNCTION: char* GMPlayer::MediaTypeInspect() LINE: 1863
I/OMXPlayer(  154): Can't inspect media content type by subfix.
I/OMXPlayer(  154): file size: 2801450, buffer size : 131072
I/OMXPlayer(  154): MediaTypeInspectByContent role: parser.mp3
E/MetadataRetrieverClient(  154): failed to extract an album art

0 Kudos
Reply