Musepack Forums  

Go Back   Musepack Forums > Main > MPC for UNIX

Reply
 
Thread Tools Search this Thread Display Modes
Old 27 March 2005, 11:58 pm   #1
Olev
Member
 
Join Date: Mar 2005
Location: Tallinn, Estonia
Posts: 1
Default XMMS 1.1.2 plugin on FreeBSD

libmusepack 0.9.6 and xmms plugin 1.1.1 had no problems workin on FreeBSD 5.3 but then came libmusepack 1.1 and a new xmms plugin version 1.1.2.

There is a port for libmusepack that is the latest 1.1 (more information http://www.freshports.org/audio/libmusepack/) but the xmms plugin in the ports tree is REALLY old http://www.freshports.org/audio/xmms-musepack/. Well I had used xmms plugin with libmusepack 0.9.6 and xmms plugin 1.1 and now that there was a new libmusepack I was off to test xmms plugin 1.1.2 and it did not work. After some debugging it was clear that the problem was threading related, so off I was chatting with my friend who has experiance with FreeBSD and threading issues. So long story short, this patch will enable xmms plugin 1.1.2 be used on Freebsd 5.3 (tested). It fixes iconv problems with bad type casting and increased the stack size (the FORCED_THREAD_STACKSIZE number is not based on any scientific methods, it just works with this ... I bet it will work with a smaller stack size but I did not test when the size gets too small).

To get this to work just install libmusepack from the ports tree and then extract the source for xmms plugin 1.1.2, go to xmms-musepack-1.1.2/src/ copy this patch with some filename there, patch it with "patch <filename" and do a "./configure CFLAGS=-I/usr/local/include" in xmms-musepack-1.1.2/ then "make" and copy xmms-musepack-1.1.2/src/.libs/libmpc.so to /usr/X11R6/lib/xmms/Input

Code:
--- libmpc.cpp.orig	Wed Dec 29 23:20:14 2004

+++ libmpc.cpp	Mon Mar 28 00:40:28 2005

@@ -20,6 +20,10 @@

 #define M_LN10   2.3025850929940456840179914546843642

 #endif

 

+#ifdef __FreeBSD__

+#define FORCED_THREAD_STACKSIZE 1024*1024

+#endif

+

 extern "C" InputPlugin * get_iplugin_info(void);

 static void mpc_load_config();

 static void mpc_configure();

@@ -126,7 +130,7 @@

     char *out = buf;

 

     memset(buf, 0, out_left);

-    size_t err = iconv(idesc, &in, &in_left, &out, &out_left);

+    size_t err = iconv(idesc, (const char **)&in, &in_left, &out, &out_left);

     iconv_close(idesc);

     return buf;

 }

@@ -332,11 +336,21 @@

 static void

 mpc_play(char *filename)

 {

+#ifdef __FreeBSD__

+    pthread_attr_t ptattr;

+#endif

+

     paused = 0;

     isSeek = -1;

     killDecodeThread = false;

     AudioError = false;

+#ifdef __FreeBSD__

+    pthread_attr_init(&ptattr);

+    pthread_attr_setstacksize(&ptattr, FORCED_THREAD_STACKSIZE);

+    pthread_create(&thread_handle, &ptattr, DecodeThread, (void *) filename);

+#else

     pthread_create(&thread_handle, NULL, DecodeThread, (void *) filename);

+#endif

     return;

 }
Credits go to hadara and dh (thank you guys).
Olev is offline   Reply With Quote
Old 28 March 2005, 05:13 pm   #2
Lefungus
Procrastinator
 
Lefungus's Avatar
 
Join Date: Jul 2004
Posts: 131
Default

Thanks for the patch.
I thought this bug was fixed though
Lefungus is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
downloaded decoder and plugin not functioning @_@ ringhelediel MPC for Windows 1 17 July 2005 03:46 am
Xmms / Beep plugins for musepack Lefungus MPC for UNIX 22 25 February 2005 05:41 pm
Can't install XMMS plugin mix32 MPC for UNIX 3 09 February 2005 01:17 am
Can't install XMMS plugin man1 MPC for UNIX 2 18 January 2005 10:55 am
Does xmms' equalizer works with musepack plugin? qrt666 MPC for UNIX 4 27 September 2004 05:42 pm


All times are GMT. The time now is 11:08 pm.


Powered by vBulletin® Version 3.8.11 Beta 2
Copyright ©2000 - 2019, vBulletin Solutions Inc.