It is currently Thu Oct 24, 2019 4:13 am


All times are UTC [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Linux x86_64 support
PostPosted: Thu Jul 31, 2008 8:03 pm 
Registered User
Registered  User

Joined: Thu Jul 31, 2008 7:37 pm
Posts: 5
Location: Switzerland
Hello

I've spent some time building Daphne on my x86_64 Linux system.
I had to change/create the following files to get it done. Maybe they
could be help full for others too.

patch for ldv1000.cpp:
Code:
--- ldv1000.cpp.orig    2008-07-31 20:19:02.000000000 +0200
+++ ldv1000.cpp 2008-07-31 20:19:15.000000000 +0200
@@ -607,9 +607,9 @@

void ldv1000_event_callback(void *eventType)
{
-       g_ldv1000_last_event = (unsigned int) eventType;
+       g_ldv1000_last_event = (unsigned long) eventType;

-       switch ((unsigned int) eventType)
+       switch ((unsigned long) eventType)
        {
        case LDV1000_EVENT_VSYNC_END:
#ifdef DEBUG



src/Makefile.vars.linux_x86_64:
Code:
# This file contains linux-specific environment variables
# It is included by Makefile if a symlink is created to point to it

export CXX=g++
export CC=gcc

# debugging version
#DFLAGS = -g -DCPU_DEBUG

# optimized version
# NOTE : gcc 3.x has a bug that causes compilation to choke on m80.cpp
# If you want to -DGCC_X86_ASM for extra speed, you have to use g++ 3.0 or earlier
DFLAGS = -O3 -fexpensive-optimizations -funroll-loops -fPIC

# this is to be exported for MMX assembly optimization
#export USE_MMX = 1

# uncomment this to link VLDP statically instead of dynamically
#export STATIC_VLDP = 1

# platform-specific compile flags
PFLAGS = ${DFLAGS} `sdl-config --cflags` -DUNIX -DLINUX \
        -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DUSE_OPENGL

# platform-specific lib flags
LIBS = `sdl-config --libs` -ldl -lz -logg -lvorbis -lvorbisfile -lGLEW


src/vldp2/Makefile.linux64:
Code:
# Makefile for VLDP2
# Written by Matt Ownby

# TODO: Add dependencies

CC = gcc
#DFLAGS = -pg
#DFLAGS = -g -DVLDP_DEBUG

# Benchmarking version
#DFLAGS = -O3 -march=i686 -fomit-frame-pointer -funroll-loops -DVLDP_BENCHMARK

# Standard version
DFLAGS = -O3 -funroll-loops -fPIC

CFLAGS = ${DFLAGS} `sdl-config --cflags` -I./include
LIBS = `sdl-config --libs`

OBJS =  vldp/vldp.o vldp/vldp_internal.o vldp/mpegscan.o \
        libmpeg2/cpu_accel.o libmpeg2/alloc.o libmpeg2/cpu_state.o \
        libmpeg2/decode.o libmpeg2/header.o libmpeg2/motion_comp.o      \
        libmpeg2/idct.o libmpeg2/idct_mmx.o libmpeg2/motion_comp_mmx.o \
                libmpeg2/slice.o        \
        libvo/video_out.o libvo/video_out_null.o

LIBNAME =       libvldp2.so

.SUFFIXES:      .c

.c.o:
                ${CC} ${CFLAGS} -c $< -o $@

all:            vldp2

vldp2:          ${OBJS}
                ${CC} -shared -o ${LIBNAME} ${OBJS} ${LIBS}
                cp ${LIBNAME} ../../.

clean:
                rm ${LIBNAME} ${OBJS}


Also available here:
http://www.netswarm.net/daphne/

vldp2 needs to be configured with "--disable-accel-detect" otherwise
the build fails. There are still some type warnings left there.

I'm unable to get any sound out of it yet. However the same thing
happens when i use a pre-compiled x86 (32bit) binary.

Quote:
OGG ERROR : Your .ogg file needs to have 2 channels and 44100 Hz
OGG ERROR : Your .ogg file has 0 channel(s) and is 0 Hz
OGG ERROR : Your .ogg file will be ignored (you won't hear any audio)

Error messages like "save me" work, they aren't ogg anyway.
Also, the ogg files play perfect with ogg123.

I can make it fully work with sound when using the win32 binary
with WINE and exactly the same command line arguments. So it's
not broken media files.


Christian


Top
Offline Profile  
 
 Post subject:
PostPosted: Fri Aug 01, 2008 1:03 am 
Registered User
Registered  User

Joined: Thu Jul 31, 2008 7:37 pm
Posts: 5
Location: Switzerland
Quote:
vldp2 needs to be configured with "--disable-accel-detect" otherwise
the build fails. There are still some type warnings left there.


libvo/video_out_null.c: In function 'null_draw_frame':
libvo/video_out_null.c:85: warning: cast from pointer to integer of different size
libvo/video_out_null.c:136: warning: cast from pointer to integer of different size
libvo/video_out_null.c: In function 'null_setup_fbuf':
libvo/video_out_null.c:275: warning: cast to pointer from integer of different size

The first 2 disappear by using "long" instead of "int", no clue about the 3rd.

Quote:
OGG ERROR : Your .ogg file needs to have 2 channels and 44100 Hz
OGG ERROR : Your .ogg file has 0 channel(s) and is 0 Hz
OGG ERROR : Your .ogg file will be ignored (you won't hear any audio)


I'm out of ideas here. The mapped file must be accepted otherwise
ov_open_callbacks shouldn't return with 0.

All values are 0 from ov_info for some reason. I also tried to do a
ov_comment for a test and there "vendor" is also (null) and not
the string which ogg123 reports.

I've checked ogg123 and it uses the same ov_xxxxx funcs to
play the file. I don't see why it works in ogg123 but fails in
daphne.


Top
Offline Profile  
 
 Post subject:
PostPosted: Fri Aug 01, 2008 4:33 pm 
DAPHNE Creator
DAPHNE Creator

Joined: Sat Jan 20, 2001 1:00 am
Posts: 2122
Location: Salt Lake City,Utah, USA
Your ogg error may be because daphne may be using the wrong version of the ogg library at runtime. That is, it may be using a different version of the ogg library when running than what it used when it was built. I include ogg libraries in the daphne binaries that I release that are generally not compatible with other ogg libraries, so make sure that if you're building from source that you delete the ogg libraries inside the "lib" directory, assuming you are using my binaries as a starting point.

At any rate, I think you've got some conflicting ogg libs on your system somewhere.


Top
Offline Profile  
 
 Post subject:
PostPosted: Sat Aug 02, 2008 12:34 am 
Registered User
Registered  User

Joined: Thu Jul 31, 2008 7:37 pm
Posts: 5
Location: Switzerland
Matt Ownby wrote:
Your ogg error may be because daphne may be using the wrong version of the ogg library at runtime. That is, it may be using a different version of the ogg library when running than what it used when it was built. I include ogg libraries in the daphne binaries that I release that are generally not compatible with other ogg libraries, so make sure that if you're building from source that you delete the ogg libraries inside the "lib" directory, assuming you are using my binaries as a starting point.

At any rate, I think you've got some conflicting ogg libs on your system somewhere.


The 32bit x86 Linux binary has only the following libs included:
libGLEW.so.1.3* libcrypto.so.0.9.7 libexpat.so.1 libssl.so.0.9.7 libstdc++.so.6

So i cannot test it with the libogg you used. If it was included
i could adjust the lib path or preload them to override the installed
32bit libs of my system.

I cannot find any prebuilt libs or source parts in the source tarball
which could conflict either. The test source builds i did with more
verbose ov_xxx func output was pure x86_64 (64bit) anyway and
that's using another set of ogg libs. 32bit libraries cannot be used
and only native 64bit libs get linked or loaded when
bulding or running a x86_64 64bit binary.

So all in all the 32bit ogg compat lib is incompatible with the released
binaries. Building it in x86 (32bit) mode on my system with those ogg
libs also is incompaible. So it looks like a pure runtime problem no
matter if the same libogg has been used at build/link time or not.

Building in x86_64 (64bit) mode with native 64bit ogg libs is also
incompatible.

Too bad both archs have exactly the same version here so i guess
its the version libogg-1.1.3 which has runtime issues:
/usr/lib32/libogg.so.0.5.3, /usr/lib64/libogg.so.0.5.3


Top
Offline Profile  
 
 Post subject: libvorbisfile
PostPosted: Sat Aug 02, 2008 9:21 pm 
Registered User
Registered  User

Joined: Thu Jul 31, 2008 7:37 pm
Posts: 5
Location: Switzerland
Ok, i narrowed it down to the problematic library. It's libvorbisfile from the libvorbis package.

The libvorbisfile.so.3.1.1 from the libvorbis-1.1.2 archive works fine, while the libvorbisfile.so.3.2.0 from libvorbis-1.2.0 is unable to load the ogg files.
All later libvorbis releases seem problematic too (i tested 1.2.1rc1).

Going back to the initial topic of this thread, what about including those additional build files and minor patches to make it possible for other people to build the source on x86_64?
I updated the Gentoo ebuild locally to fully build and work on both x86 and x86_64, but i guess people building it manually would benefit from the ability to compile the source without modifications and with some predefined Makefiles which work out of the box.


Top
Offline Profile  
 
 Post subject:
PostPosted: Wed Aug 13, 2008 7:37 pm 
DAPHNE Creator
DAPHNE Creator

Joined: Sat Jan 20, 2001 1:00 am
Posts: 2122
Location: Salt Lake City,Utah, USA
Ya, I think it's a good idea to include files to build on x64.


Top
Offline Profile  
 
 Post subject:
PostPosted: Tue Sep 16, 2008 9:09 pm 
DAPHNE Bronze Donator
DAPHNE Bronze Donator

Joined: Tue Sep 16, 2008 4:38 pm
Posts: 13
Location: France
IMHO this bug should be fixed by the patch I've just submited in:

Nasty bung in src/ldp-out/ldp-vldp-audio.cpp (OGG ERROR): https://www.daphne-emu.com/phpBB2/viewtopic.php?t=2623

_________________
Arnaud G. GIBERT


Top
Offline Profile  
 
 Post subject:
PostPosted: Fri Sep 19, 2008 12:54 pm 
Registered User
Registered  User

Joined: Thu Jul 31, 2008 7:37 pm
Posts: 5
Location: Switzerland
Yes, confirmed working on my system as well.

Tested with libvorbisfile from the libvorbis 1.2.0 and 1.2.1rc1 packages.


Top
Offline Profile  
 
 Post subject:
PostPosted: Fri Sep 19, 2008 5:37 pm 
DAPHNE Bronze Donator
DAPHNE Bronze Donator

Joined: Tue Sep 16, 2008 4:38 pm
Posts: 13
Location: France
Good !
:D

_________________
Arnaud G. GIBERT


Top
Offline Profile  
 
 Post subject:
PostPosted: Fri Sep 19, 2008 9:52 pm 
DAPHNE Creator
DAPHNE Creator

Joined: Sat Jan 20, 2001 1:00 am
Posts: 2122
Location: Salt Lake City,Utah, USA
Excellent! I am glad to hear it!


Top
Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net