[Bug 52008] New: synaescope and tippercanoe don't work with Sparc Solaris - endian problem

aaronw at net.com aaronw at net.com
Tue Dec 17 07:31:10 GMT 2002

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
           Summary: synaescope and tippercanoe don't work with Sparc Solaris
                    - endian problem
           Product: noatun
           Version: unspecified
          Platform: Compiled Sources
        OS/Version: Solaris
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: kde-multimedia at kde.org
        ReportedBy: aaronw at net.com

Version:            (using KDE KDE 3.0.99)
Installed from:    Compiled From Sources
Compiler:          gcc 2.95.3 Ultrasparc, Solaris 2.7
OS:          Solaris

Both synaescope and tippercanoe have problems on big-endian platforms since
the data is little endian.  Also, on Solaris it doesn't seem to detect that the system
is big endian.  The following patches seem to fix the problems in both programs:

in syna.h:

#include <sys/types.h>
#include <endian.h>
+ #elif defined(_BIG_ENDIAN)
+ #define BIG_ENDIAN 1
typedef short sampleType;

in core.cpp:

bool Core::calculate()
	double x[NumSamples], y[NumSamples];
	double a[NumSamples], b[NumSamples];
	int clarity[NumSamples]; //Surround sound
	int i,j,k;
+         register sampleType temp;
+ #endif
	int brightFactor = int(Brightness * brightnessTwiddler /(starSize+0.01));


		x[i] = data[i*2];
		y[i] = data[i*2+1];
+ #else
+                //  Need to convert to big-endian
+                temp = data[i*2];
+                temp = (temp >> 8) | (temp << 8);
+                x[i] = temp;
+                temp = data[i*2+1];
+                temp = (temp << 8) | (temp >> 8);
+                y[i] = temp;

Another problem I see is that the plugins should be run as low priority, especially on slow systems.

The following patch to main.cpp fixes this problem:

in main.cpp:

#include <fcntl.h>
+ #include <sys/resource.h>


int main()
	KInstance in("noatunsynaescope");
+        setpriority(PRIO_PROCESS, getpid(), 17);
	core=new Core;

More information about the kde-multimedia mailing list