Author Topic: Compilying mplayer with vorbis support on SL6000L  (Read 3572 times)

gab74

  • Sr. Member
  • ****
  • Posts: 344
    • View Profile
Compilying mplayer with vorbis support on SL6000L
« on: July 05, 2004, 04:43:36 am »
Good morning,
i want to compile mplayer with vorbis support ( tremor patch) on SL 6000L ( i search but i didnt find any version running on SL6000L !!!)

On the web i find this patch :

********************************************************************************
****
diff -ubr MPlayer-0.90pre8.orig/configure MPlayer-0.90pre8/configure
--- MPlayer-0.90pre8.orig/configure   Tue Sep 17 15:47:55 2002
+++ MPlayer-0.90pre8/configure   Sat Nov  9 15:53:11 2002
@@ -3393,11 +3394,11 @@
 #include <vorbis/codec.h>
 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
 EOF
-  cc_check -lvorbis -logg -lm && _vorbis=yes
+  cc_check -lvorbisidec -lm && _vorbis=yes
 fi
 if test "$_vorbis" = yes ; then
   _def_vorbis='#define HAVE_OGGVORBIS 1'
-  _ld_vorbis='-lvorbis -logg'
+  _ld_vorbis='-lvorbisidec'
   _codecmodules="libvorbis $_codecmodules"
 else
   _def_vorbis='#undef HAVE_OGGVORBIS'
diff -ubr MPlayer-0.90pre8.orig/libmpcodecs/ad_libvorbis.c MPlayer-0.90pre8/libmpcodecs/ad_libvorbis.c
--- MPlayer-0.90pre8.orig/libmpcodecs/ad_libvorbis.c   Sat Aug 31 09:09:23 2002
+++ MPlayer-0.90pre8/libmpcodecs/ad_libvorbis.c   Fri Nov  8 11:40:36 2002
@@ -19,7 +19,7 @@
 
 LIBAD_EXTERN(libvorbis)
 
-#include <vorbis/codec.h>
+#include <tremor/ivorbiscodec.h>
 
 // This struct is also defined in demux_ogg.c => common header ?
 typedef struct ov_struct_st {
@@ -121,11 +121,25 @@
   return CONTROL_UNKNOWN;
 }
 
+static inline ogg_int32_t CLIP_TO_15(ogg_int32_t x) {
+  int tmp;
+  asm volatile("subs    %1, %0, #32768\n\t"
+               "movpl   %0, #0x7f00\n\t"
+               "orrpl   %0, %0, #0xff\n"
+               "adds    %1, %0, #32768\n\t"
+               "movmi   %0, #0x8000"
+               : "+r"(x),"=r"(tmp)
+               :
+               : "cc");
+  return(x);
+}
+
+
 static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen)
 {
         int len = 0;
         int samples;
-        float **pcm;
+        ogg_int32_t **pcm;
         ogg_packet op;
         struct ov_struct_st *ov = sh->context;
         op.b_o_s =  op.e_o_s = 0;
@@ -148,23 +162,9 @@
        for(i=0;i<ov->vi.channels;i++){
          ogg_int16_t *convbuffer=(ogg_int16_t *)(&buf[len]);
          ogg_int16_t *ptr=convbuffer+i;
-         float  *mono=pcm;
+         ogg_int32_t  *mono=pcm;
          for(j=0;j<bout;j++){
-#if 1
-      int val=mono[j]*32767.f;
-#else /* optional dither */
-      int val=mono[j]*32767.f+drand48()-0.5f;
-#endif
-      /* might as well guard against clipping */
-      if(val>32767){
-        val=32767;
-        clipflag=1;
-      }
-      if(val<-32768){
-        val=-32768;
-        clipflag=1;
-      }
-      *ptr=val;
+      *ptr=CLIP_TO_15(mono[j]>>9);
       ptr+=ov->vi.channels;
          }
        }
diff -ubr MPlayer-0.90pre8.orig/libmpdemux/demux_ogg.c MPlayer-0.90pre8/libmpdemux/demux_ogg.c
--- MPlayer-0.90pre8.orig/libmpdemux/demux_ogg.c   Sun Sep 15 18:38:30 2002
+++ MPlayer-0.90pre8/libmpdemux/demux_ogg.c   Sat Nov  9 15:49:58 2002
@@ -12,8 +12,8 @@
 #include "demuxer.h"
 #include "stheader.h"
 
-#include <ogg/ogg.h>
-#include <vorbis/codec.h>
+#include <tremor/ogg.h>
+#include <tremor/ivorbiscodec.h>
 
 #define BLOCK_SIZE 4096
 
@@ -518,7 +518,16 @@
         // Check new header
     } else if ( (*pack.packet & PACKET_TYPE_BITS ) == PACKET_TYPE_HEADER &&
          pack.bytes >= (int)sizeof(stream_header)+1) {
-      stream_header *st = (stream_header*)(pack.packet+1);
+      int i;
+      stream_header sst, *st;
+      char* t=(char*) &sst;
+
+      for(i = 0; i < sizeof sst; i++) {
+   t = pack.packet[i+1];
+      }
+
+      st = &sst;
+
       /// New video header
       if(strncmp(st->streamtype,"video",5) == 0) {
    sh_v = new_sh_video(demuxer,ogg_d->num_sub);
********************************************************************************
**************

So i downloaded mplayer090pre 8 and then i've modified the sources....

* Where can i find tremor sources for vorbis support ?
* Is there anything else i've to do before start compiling ?
I compile on my SL6000L with gcc2.95.1 cram fs (DEV_IMG1.3)

I see, most of softtware doesent run on sl6000l so...we have to recompile.....

iS THERE ANY PERSON WHO CAN HELP ME ? so SL6000L community will have a full functional mplayer ?

Any help will be appreciate !

Thanks !!
Gabriele
NOW : C3100 (code name Laudicus)- SOCKETCOMM CF MODEM 56K - CF GPS GLOBASAT BC-307 - BLUETOOTH CF BELKIN - ETHERNET CF TRENDNET TE-CF100
BEFORE: SL6000L (code name Anselmus) - 512MB SD - 256MB CF - SOCKETCOMM CF MODEM 56K - CF GPS GLOBASAT BC-307

gab74

  • Sr. Member
  • ****
  • Posts: 344
    • View Profile
Compilying mplayer with vorbis support on SL6000L
« Reply #1 on: July 05, 2004, 04:32:12 pm »
I see on http://www.killefiz.de/zaurus/showdetail.php?app=727 that the author say "many thanks to lucho" for his support for compiling mplayer.

If lucho is on this usergroup and will give me some infos i will be very happy.

Thanks....
Gabriele
NOW : C3100 (code name Laudicus)- SOCKETCOMM CF MODEM 56K - CF GPS GLOBASAT BC-307 - BLUETOOTH CF BELKIN - ETHERNET CF TRENDNET TE-CF100
BEFORE: SL6000L (code name Anselmus) - 512MB SD - 256MB CF - SOCKETCOMM CF MODEM 56K - CF GPS GLOBASAT BC-307

gab74

  • Sr. Member
  • ****
  • Posts: 344
    • View Profile
Compilying mplayer with vorbis support on SL6000L
« Reply #2 on: July 07, 2004, 05:42:49 am »
mmm..no aswer !
Ok probably this is not the rigth place for this Questions.........
Gabriele
NOW : C3100 (code name Laudicus)- SOCKETCOMM CF MODEM 56K - CF GPS GLOBASAT BC-307 - BLUETOOTH CF BELKIN - ETHERNET CF TRENDNET TE-CF100
BEFORE: SL6000L (code name Anselmus) - 512MB SD - 256MB CF - SOCKETCOMM CF MODEM 56K - CF GPS GLOBASAT BC-307

lucho

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
    • http://
Compilying mplayer with vorbis support on SL6000L
« Reply #3 on: July 07, 2004, 08:20:27 am »
gab74,

I am still reading the forums, but I don't remember anything particular about compiling mplayer. I remember discussing the compilation on devnet forum, but I couldn't find anything. May be it was the old zauruszone forum...

You can start compiling tremor library (you can get it from xiph.org). You may also need to compile libogg (not sure). You have to check the configure options for mplayer for yourself.

Not much help, sorry ...

gab74

  • Sr. Member
  • ****
  • Posts: 344
    • View Profile
Compilying mplayer with vorbis support on SL6000L
« Reply #4 on: July 09, 2004, 06:49:18 am »
Ok, thank you !

I've compiled lmplayer on my sl6000l but now i wanto to enable tremor....

problem is that source of tremor doesen't have any congiure file but has only a configure.in files .

This need autoconf but i have only gcc 2.95.2 on my zaurus without autoconf....

I've make a new post !

Any helps ?
Gabriele
NOW : C3100 (code name Laudicus)- SOCKETCOMM CF MODEM 56K - CF GPS GLOBASAT BC-307 - BLUETOOTH CF BELKIN - ETHERNET CF TRENDNET TE-CF100
BEFORE: SL6000L (code name Anselmus) - 512MB SD - 256MB CF - SOCKETCOMM CF MODEM 56K - CF GPS GLOBASAT BC-307

lucho

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
    • http://
Compilying mplayer with vorbis support on SL6000L
« Reply #5 on: July 09, 2004, 11:14:40 am »
Why don't you just install gcc cross compiler on you PC  It'll make your life so much simpler...

gab74

  • Sr. Member
  • ****
  • Posts: 344
    • View Profile
Compilying mplayer with vorbis support on SL6000L
« Reply #6 on: July 09, 2004, 11:41:54 am »
But with cross compiler i can compile a software on my linux desktop and simply send to Zaurus ???
Gabriele
NOW : C3100 (code name Laudicus)- SOCKETCOMM CF MODEM 56K - CF GPS GLOBASAT BC-307 - BLUETOOTH CF BELKIN - ETHERNET CF TRENDNET TE-CF100
BEFORE: SL6000L (code name Anselmus) - 512MB SD - 256MB CF - SOCKETCOMM CF MODEM 56K - CF GPS GLOBASAT BC-307

gab74

  • Sr. Member
  • ****
  • Posts: 344
    • View Profile
Compilying mplayer with vorbis support on SL6000L
« Reply #7 on: July 09, 2004, 11:44:43 am »
i read that Programs that use autoconf might not support cross building and
Programs that use configure might not support cross building....

so i cannot compile mplayer in this way.... is that right ???
Gabriele
NOW : C3100 (code name Laudicus)- SOCKETCOMM CF MODEM 56K - CF GPS GLOBASAT BC-307 - BLUETOOTH CF BELKIN - ETHERNET CF TRENDNET TE-CF100
BEFORE: SL6000L (code name Anselmus) - 512MB SD - 256MB CF - SOCKETCOMM CF MODEM 56K - CF GPS GLOBASAT BC-307

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Compilying mplayer with vorbis support on SL6000L
« Reply #8 on: July 09, 2004, 12:14:26 pm »
Works most of the time.

First make sure you source the appropriate variables CC, CXX, LINKER, etc. - all the stuff in the standard Sharp env-var.sh file. Then use something like:

./configure --host=arm-linux

There can be problems if the configure script tries to create then execute some code but this can be sorted out by editing the script, etc.


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

gab74

  • Sr. Member
  • ****
  • Posts: 344
    • View Profile
Compilying mplayer with vorbis support on SL6000L
« Reply #9 on: July 09, 2004, 12:46:09 pm »
>First make sure you source the appropriate variables CC, CXX, LINKER, etc. - all the stuff in the >standard Sharp env-var.sh file. Then use something like:

Please can you help me to configure theese variables ???
Gabriele
NOW : C3100 (code name Laudicus)- SOCKETCOMM CF MODEM 56K - CF GPS GLOBASAT BC-307 - BLUETOOTH CF BELKIN - ETHERNET CF TRENDNET TE-CF100
BEFORE: SL6000L (code name Anselmus) - 512MB SD - 256MB CF - SOCKETCOMM CF MODEM 56K - CF GPS GLOBASAT BC-307

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Compilying mplayer with vorbis support on SL6000L
« Reply #10 on: July 09, 2004, 02:09:48 pm »
Which toolchain will you use?

For my OZ toolchain this is what I have

dev-arm-OZ.sh script:

=======================================
#!/bin/bash

CC=arm-linux-gcc
CXX=arm-linux-g++
CCX=arm-linux-gcc
CXXX=arm-linux-g++
COMPILER=arm-linux-gcc
LINKER=arm-linux-g++
G77=arm-linux-g77
F77=arm-linux-g77

PATH=/usr/local/arm/3.3.2/bin:/usr/local/arm/3.3.2/arm-linux/bin:$PATH

export PATH CC CXX CCX CXXX COMPILER LINKER G77 F77
echo "Altered environment for OZ 3.3.2 Development"
========================================

Note the PATH vairiable will have to be changed if your compiler is supposed to be installed elsewhere (and it does make a difference to the compiler so don't just install it in the above location).

Then 'source dev-arm-OZ.sh', etc.

Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

gab74

  • Sr. Member
  • ****
  • Posts: 344
    • View Profile
Compilying mplayer with vorbis support on SL6000L
« Reply #11 on: July 09, 2004, 02:33:18 pm »
toolchain ?

At this moment i do not use anything....
Please can you tell me where i can find all the gcc / software for creating a full cross compiler ?
Gabriele
NOW : C3100 (code name Laudicus)- SOCKETCOMM CF MODEM 56K - CF GPS GLOBASAT BC-307 - BLUETOOTH CF BELKIN - ETHERNET CF TRENDNET TE-CF100
BEFORE: SL6000L (code name Anselmus) - 512MB SD - 256MB CF - SOCKETCOMM CF MODEM 56K - CF GPS GLOBASAT BC-307

cmisip

  • Sr. Member
  • ****
  • Posts: 256
    • View Profile
    • http://home.mchsi.com/~cmisip/index.htm
Compilying mplayer with vorbis support on SL6000L
« Reply #12 on: July 09, 2004, 10:20:26 pm »
I built my cross compiler gcc 2.95.3 using instructions from here:

http://www.ailis.de/~k/docs/crosscompiling/toolchain.php

except I used the sharp supplied kernel source 2.4.18-rmk7-pxa3 which of course does not need the arm kernel patch anymore.

Be very careful though as you can mess up your system.

There may be prebuilt rpms of toolchains available though.  I know for the 5600, there is a  prebuilt gcc 2.95.2 toolchain installable via rpms.  Don't know about the SL600L.  

My pda is a 5600.  So follow the instructions at your own risk.
Zaurus 5600
Zynergy Rootfs 1.1
Custom zImage

How Do You Do That in Linux