[MPlayer-users] Latest SVN audio sync & high cpu usage with channels=6

Jesús Guerrero i92guboj at terra.es
Tue Sep 29 15:23:52 CEST 2009


On Tue, 29 Sep 2009 10:09:39 +0200, Reimar Döffinger
<Reimar.Doeffinger at gmx.de> wrote:
> On Fri, Sep 25, 2009 at 12:43:50AM +0200, Jesús Guerrero wrote:
>> On Fri, 25 Sep 2009 00:29:37 +0200, Reimar Döffinger
>> <Reimar.Doeffinger at gmx.de> wrote:
>> > On Thu, Sep 24, 2009 at 11:56:17PM +0200, Jesús Guerrero wrote:
>> >> 29549 is the first one that I can compile against current mplayer
(and
>> it
>> >> exhibits this same problem), 29548 will not compile:
>> >> 
>> >> $ make
>> >> cc -MM -Wundef -Wdisabled-optimization -Wno-pointer-sign
>> >> -Wdeclaration-after-statement -std=gnu99 -Wall -Wno-switch
>> >> -Wpointer-arith
>> >> -Wredundant-decls -O4 -march=native -mtune=native -pipe -ffast-math
>> >> -fomit-frame-pointer -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
>> >> -D_LARGEFILE64_SOURCE -Ilibdvdread4 -I.  -D_REENTRANT
>> >> -I/usr/include/directfb  -I/usr/include/SDL  -D_REENTRANT 
>> >> -I/usr/include/freetype2   -I/usr/include/dirac  
>> >> -I/usr/include/schroedinger-1.0 -I/usr/include/liboil-0.3    
>> >> libao2/ao_alsa.c | sed -e "s,[0-9a-z._-]*: \([a-z0-9/]*/\)[^/]*
,\1&,"
>> -e
>> >> "s,\(.*\)\.o: ,\1.d &," > libao2/ao_alsa.d
>> >> cc -Wundef -Wdisabled-optimization -Wno-pointer-sign
>> >> -Wdeclaration-after-statement -std=gnu99 -Wall -Wno-switch
>> >> -Wpointer-arith
>> >> -Wredundant-decls -O4 -march=native -mtune=native -pipe -ffast-math
>> >> -fomit-frame-pointer -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
>> >> -D_LARGEFILE64_SOURCE -Ilibdvdread4 -I.  -D_REENTRANT
>> >> -I/usr/include/directfb  -I/usr/include/SDL  -D_REENTRANT 
>> >> -I/usr/include/freetype2   -I/usr/include/dirac  
>> >> -I/usr/include/schroedinger-1.0 -I/usr/include/liboil-0.3     -c -o
>> >> libao2/ao_alsa.o libao2/ao_alsa.c
>> >> libao2/ao_alsa.c: In function 'init':
>> >> libao2/ao_alsa.c:647: error: 'MSGTR_AO_ALSA_UnableToSetPeriodSize'
>> >> undeclared (first use in this function)
>> >> libao2/ao_alsa.c:647: error: (Each undeclared identifier is reported
>> only
>> >> once
>> >> libao2/ao_alsa.c:647: error: for each function it appears in.)
>> >> make: *** [libao2/ao_alsa.o] Error 1
>> > 
>> > So it gets ugly :-(. You can comment out any mp_msg lines that causes
>> > an
>> > issue (line 647 in this case).
>> 
>> It compiles commenting that, and it works beautifully. So yes, it's
>> 29548->29549 which broke this somewhat.
> 
> I can't reproduce the issue, could you
> 1) say which version of ALSA/the kernel you use?

I've tested many, from 2.6.28.10 to 2.6.31.1, which is what I use right
now.

> 2) add the patch below and see if there are any particular values
> when the issue starts appearing (I'd expect some rather small values
> < 512 there)
>
> Index: libao2/ao_alsa.c
> ===================================================================
> --- libao2/ao_alsa.c    (revision 29731)
> +++ libao2/ao_alsa.c    (working copy)
> @@ -819,6 +819,7 @@
>      ret = snd_pcm_status_get_avail(status) * bytes_per_sample;
>      if (ret > ao_data.buffersize)  // Buffer underrun?
>         ret = ao_data.buffersize;
> +printf("space: %i\n", ret);
>      return ret;
>  }

If you mean A-V, the values continue growing indefinitely, attached output
of this patch as patch1.output.txt.bz2

> 3) add the patch even further below and tell me what changes (if
> anything)?
> 
> Index: libao2/ao_alsa.c
> ===================================================================
> --- libao2/ao_alsa.c    (revision 29731)
> +++ libao2/ao_alsa.c    (working copy)
> @@ -763,8 +763,10 @@
>  
>  static int play(void* data, int len, int flags)
>  {
> -  int num_frames = len / bytes_per_sample;
> +  int num_frames;
>    snd_pcm_sframes_t res = 0;
> +  len = len / ao_data.outburst * ao_data.outburst;
> +  num_frames = len / bytes_per_sample;
>  
>    //mp_msg(MSGT_AO,MSGL_ERR,"alsa-play: frames=%i,
>    //len=%i\n",num_frames,len);

Attached output as patch2.output.txt.bz2, this patch solves the problem
completely, in the attached log, the A-V sync is always zero :)

Thank you.
-- 
Jesús Guerrero

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch1.output.txt.bz2
Type: application/octet-stream
Size: 4015 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-users/attachments/20090929/6db1d5f8/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch2.output.txt.bz2
Type: application/octet-stream
Size: 8029 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-users/attachments/20090929/6db1d5f8/attachment-0001.obj>


More information about the MPlayer-users mailing list