Sam,
I've been running software built using ASI_linux_mac_SDK_V0.2.1026.tar for quite some time and have had no problems running an ASI178MC camera connected to a USB 2 port on an x86 laptop, a Raspberry Pi, and an Odroid. All work fine.
Today I decided to try the latest library, ZWO_ASI_linux_mac_SDK_V0.3.0520.tar and ran into this problem when calling ASIOpenCamera():
pthread_mutex_lock.c: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed.
The traceback from gdb looks like this:
// #0 0xb7fdd424 in __kernel_vsyscall ()
// #1 0xb7d061ef in raise () from /lib/i386-linux-gnu/libc.so.6
// #2 0xb7d09835 in abort () from /lib/i386-linux-gnu/libc.so.6
// #3 0xb7cff095 in ?? () from /lib/i386-linux-gnu/libc.so.6
// #4 0xb7cff147 in __assert_fail () from /lib/i386-linux-gnu/libc.so.6
// #5 0xb7cbcd5b in pthread_mutex_lock () from /lib/i386-linux-gnu/libpthread.so.0
// #6 0xb7dd05f4 in pthread_mutex_lock () from /lib/i386-linux-gnu/libc.so.6
// #7 0x080d391d in EnterCriticalSection(pthread_mutex_t*) ()
// #8 0x080d12fe in CCameraFX3:(unsigned char, unsigned short, unsigned short, bool, unsigned char*, long) ()
// #9 0x080d19e2 in CCameraFX3:() ()
// #10 0x080b7df6 in CCameraS178MC:() ()
// #11 0x0804b358 in ASIOpenCamera ()
// #12 0x0804a136 in main () at bug.cc
Here's my program in its entirety, compiled as "g++ -g bug.cc -o bug libASICamera2.a -lusb-1.0"
===
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "./ASICamera2.h"
int
main()
{
int numDevices = ASIGetNumOfConnectedCameras();
if (numDevices <= 0)
{
printf("no camera\n");
exit(1);
}
if (numDevices != 1)
{
printf("unexpected cameras\n");
exit(1);
}
int cameraIndex = 0;
ASI_CAMERA_INFO info;
ASIGetCameraProperty(&info, cameraIndex);
int cameraId = info.CameraID;
if (ASIOpenCamera(cameraId) != ASI_SUCCESS)
{
printf("can't open camera\n");
exit(1);
}
return 0;
}
===
Any idea what's gone wrong? This seems too simple to be a problem on my end. Is it a bug in the SDK ?
--Derek