Musepack Forums  

Go Back   Musepack Forums > Main > MPC for UNIX

Thread Tools Search this Thread Display Modes
Old 27 March 2005, 11:58 pm   #1
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 but the xmms plugin in the ports tree is REALLY old 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/ to /usr/X11R6/lib/xmms/Input

--- 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



+#ifdef __FreeBSD__

+#define FORCED_THREAD_STACKSIZE 1024*1024



 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);


     return buf;


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

 static void

 mpc_play(char *filename)


+#ifdef __FreeBSD__

+    pthread_attr_t ptattr;



     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);


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



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

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

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 02:20 pm.

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