c++,multithreading,osx,audio,fmodRelated issues-Collection of common programming errors


  • user3280097
    java c++ jni
    I’m a newbie to JNI. I’m trying to execute native methods from a c++ shared library. However initially for executing the methods in C++ I need to pass variables of datatype jdouble to C++ as input for the methods. But for some unknown reason garbage values are passed for jdouble/jfloat datatypes. Interestingly only values of variables with datatype jint works without issues. I did check the jni header file and I did see the jdouble datatype defined. I will list out a simple program for demonstra

  • eskimo9
    android c++ sockets udp sendto
    I don’t know if this is in the way I’m handling Android, or a problem with my native code, or both.I am setting up a udp socket in C++ (wrappers generated by swig):udpSocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);if (udpSocket < 0){pthread_mutex_unlock(&csOpenCloseUdp);throw IOException(“Failed to open socket”);}char bAllowMultiple = true;setsockopt(udpSocket, SOL_SOCKET, SO_REUSEADDR, &bAllowMultiple, sizeof(bAllowMultiple));setsockopt(udpSocket, IPPROTO_IP, IP_MULTICAST_TTL, (ch

  • Boppity Bop
    c++ windows winapi timer driver
    I want to set a machine timer resolution to 0.5ms. Sysinternal utility reports that the min clock resolution is 0.5ms so it can be done.P.S. I know how to set it to 1ms.P.P.S. I changed it from C# to more general question (thanks to Hans)System timer resolution

  • John
    c++ debugging visual-studio-2012 linker
    We’re using VS 2012 for a native C++ project. The project is cmake-based, and some of its dependencies (some libraries and headers) are on a network. The problem that we’re facing is that with VS 2012, sometimes (1 out of 5 maybe), the linking process takes 10 minutes or more, while the same code-base links fine (in about 2 min) with VS 2010. Also, many times the code seems to be in an inconsistent state, since no break-points are hit, and some functions are not called at all (which should be).

  • Andy Johnson
    c++ sql-server sql-server-2005 odbc
    Summary: I’m trying to write a text string to a column of type varchar(max) using ODBC and SQL Server 2005. It fails if the length of the string is greater than 8000. Help!I have some C++ code that uses ODBC (SQL Native Client) to write a text string to a table. If I change the column from, say, varchar(100) to varchar(max) and try to write a string with length greater than 8000, the write fails with the following error[Microsoft][ODBC SQL ServerDriver]String data, right truncationSo, can anyone

  • Haywire Spark
    java android c++ jni sdl
    I am getting an UnsatisfiedLinkError, I know this means that my native method cannot find the c method to link to, but I can’t see why. I am doing it the same way as in the hello-jni sample.Here is the Java code I’m trying to call:static {System.loadLibrary(“main”);}private static DisplayMetrics metrics; public static native void callMetricDensity(); public static float getMetricDensity() { return metrics.density; } public static native void callMetricDPIX(); public static float getMetricDPIX()

  • Bo Persson
    c++ hadoop cluster-computing word-count
    I am trying to run the example of wordcount in C++ like this link describes the way to do : Running the WordCount program in C++. The compilation works fine, but when I tried to run my program, an error appeared :bin/hadoop pipes -conf ../dev/word.xml -input testtile.txt -output wordcount-out 11/06/06 14:23:40 WARN mapred.JobClient: No job jar file set. User classes may not be found. See JobConf(Class) or JobConf#setJar(String).11/06/06 14:23:40 INFO mapred.FileInputFormat: Total input paths to

  • BBai
    android c++ android-ndk
    I am trying to use android jni to call some other native opengl functions from another shared library of mine. I could compile both of the myegl_jni.so and myegl_impl.so successfully. But When I tries to include the myegl_impl.so for myegl_jni.so, I got this error12-05 09:54:18.802 D/houdini (18259): [18259] Loading library(version: 3.3.1.43195 RELEASE)… successfully. 12-05 09:54:18.802 D/houdini (18259): [18259] Open Native Library /data/app-lib/com.example.nativeegldynamicjni-1/libmyegl_jni.

  • MastAvalons
    android c++ eclipse android-ndk
    My Android – project contents more than 20 C++ and C libraries. While I compile my project I compile all this libraries. But I don’t change C-code – I change only java – code. Maybe there is a way to avoid libraries compiling for each time? I use eclipse (Java and NDK) and ant. Thanks in advance! Edit1:Android.mkLOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE := DeflatingDecompressor-v3 LOCAL_SRC_FILES := DeflatingDecompressor/DeflatingDecompressor

  • Mordachai
    c++ mfc odbc
    Where can I obtain high quality information about ODBC & Access Databases?I have worked on various projects over the years using ODBC from MFC/C++/Java.Currently, I have a project in C++/MFC that uses a customized MFC layer to interface dynamically to an ODBC DSN connected to an Access 2000 dbm file.This generally works.However, I commonly get warnings such as:DBMS: ACCESS Version: 04.00.0000 ODBC Driver Manager Version:03.80.0000 Optional feature not implemented State:S1C00,Native:106,Orig

  • skirsch
    java multithreading log4j deadlock apache-commons-logging
    I think I found a situation where mixed usage of log4j a) directly and b) via commons-logging causes some kind of class-loading deadlock. I’m not sure if such a situation is possible at all (shouldn’t the JVM detect that?) and what to do about it.The problemIn our build system, we currently are running our unit tests sequentially – to make the build faster, we obviously can change that to run our unit tests in parallel. However, if we do so, some builds run into an execution timeout. When analys

  • Alex Lockwood
    java android multithreading sqlite android-loadermanager
    I am writing a android application using sqlite. There are many activities and one service. I use the DB from more than one thread. It works perfectly in Android 2.X, but once I run it in Android 3.X it always throws this error and Force Close:05-04 22:17:04.815: I/SqliteDatabaseCpp(8774): sqlite returned: error code = 5, msg = database is locked, db=/data/data/xxx/databases/im 05-04 22:17:04.815: E/SqliteDatabaseCpp(8774): sqlite3_open_v2(“/data/data/xxx/databases/im”, &handle, 6, NULL) fai

  • prettyCode
    c# multithreading
    I would like to calculate how many bytes my function fills so that I can inject it into another process using CreateRemoteThread(). Once I know the number of bytes, I can write them into the remote process using the function’s pointer. I have found an article online (see http://www.codeproject.com/KB/threads/winspy.aspx#section_3, chapter III) where they do the following in C++ : // ThreadFunc // Notice: – the code being injected; //Return value: password length static DWORD WINAPI ThreadFunc (

  • Konrad Garus
    java multithreading
    I have an object responsible for persisting JTable state to disk. It saves/loads visible columns, their size, position etc. A few interesting bits from its class definition are below.class TableSaver {Timer timer = new Timer(true);TableSaver() {timer.schedule(new TableSaverTimerTask(), 15000, SAVE_STATE_PERIOD);}synchronized TableColumns load(PersistentTable table) {String xml = loadFile(table.getTableKey());// parse XML, return}synchronized void save(String key, TableColumns value) {try {// Som

  • mackenir
    com clr c++-cli multithreading sta
    Is there a way for me to hook the exit of managed threads (i.e. run some code on a thread, just before it exits?)I’ve developed a mechanism for hooking thread exit that works for some threads. Step 1: develop a ‘hook’ STA COM class that takes a callback function and calls it in its destructor. Step 2: create a ThreadStatic instance of this object on the thread I want to hook, and pass the object a managed delegate converted to an unmanaged function pointer. The delegate then gets called on threa

  • user2989698
    java android multithreading
    I want to check my MySQL database every second and get the data from it This is what I tried I made the connection in a separate thread and make it sleepThread:class Updater extends Thread { ArrayList<chatData> list = new ArrayList<chatData>(); Boolean thereIsNewData = false; SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); String yourID = prefs.getString(“KEY_USERNAME”, “No login info available”);void getData(){chatServiceHandler json

  • Chris J
    multithreading com vb6 apartments
    Come across what looks at first sight like an MT-issue, but I’m trying to understand in detail the STA model used by COM+.Effectively, I have a legacy COM+ component, written in VB6, that calls into a native (i.e., not-COM) Win32 DLL written in C++.Having some intermittant (and impossible to reproduce in testing) problems with it, I added some debugging code to find out what was going on and found that when the problems occur, I had log messages interleaved in the file – so it implied that the D

  • ThinkFloyd
    java linux multithreading shell monitoring
    We had some issues of thread pile ups with production tomcat server so I wanted to setup some cron to to periodically check thread dumps and send alert email if something is wrong. To do this we need to take thread dumps in file from shell script but I am unable to do that. From shell I can issue KILL -3 <PID> at periodic intervals but the problem is that dump goes to catalina.out which contains GBs of data because of which pulling out only thread dump is painful process. Some discussion t

  • mrz
    android multithreading locking
    I am using a thread to handle a wallpaper and using surface view. I am getting the following error and unable to solve it. There is an answer in which they told that there is problem in the sequence of lock surfaceHolder.lockcanvas() and surfaceHolder.unlockCanvasAndPost(canvas). But i check and it is right. plese help someone..the LogCat is below:07-06 12:58:24.459: E/SurfaceTextureClient(719): queueBuffer: error queuing buffer to SurfaceTexture, -19 07-06 12:58:24.459: E/SurfaceTextureClient(7

  • Stephane Grenier
    java multithreading swing
    Somewhere in my code a call to paint is being called but the stacktrace gives absolutely no idea as to what and where. It’s also intermittent so I know it’s a threading issue, and if I put a breakpoint then the code never fails. So how do I tell where or how the event thread is called to repaint the component?Here is the stacktrace:Exception in thread “AWT-EventQueue-0” java.lang.ArrayIndexOutOfBoundsException: 4at javax.swing.plaf.basic.BasicTabbedPaneUI.paintTabArea(BasicTabbedPaneUI.java:834)

  • Dan Rosenthal
    ruby osx command-line installation jekyll
    I am new to Ruby, and relatively new to the command line. I am trying to install Jekyll to build a static site, and am having some issues. I have Ruby v. 1.8.7 and Ruby Gems v. 1.8.25 installed, but I get this error when I run:$ sudo gem install jekyllI get this:Building native extensions. This could take a while… ERROR: Error installing jekyll: ERROR: Failed to build gem native extension./System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb mkmf.rb can’t find header

  • notrab
    osx postgresql gem bundle pg
    I’ve tried bundling my Rails app on my Mac at work. At home it works fine and I’ve managed it solve it myself previously but this time no matter what I try nothing appears to be working to resolve it.The error I receive when running bundle/bundle install is the following:Installing pg (0.17.0)Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension./Users/notrab/.rbenv/versions/2.0.0-p0/bin/ruby extconf.rbchecking for pg_config… noNo pg_config… trying anyway. If build

  • Holger Just
    ruby-on-rails osx heroku
    This question already has an answer here:Errors of pushing rails app to Heroku error occurred while installing sqlite3, and Bundler cannot continue2 answersI am getting this error when I use the command git push heroku master.$ git push heroku master Counting objects: 126, done. Delta compression using up to 8 threads. Compressing objects: 100% (110/110), done. Writing objects: 100% (126/126), 36.61 KiB, done. Total 126 (delta 19), reused 0 (delta 0)—–> Removing .DS_Store files —–> R

  • Nicolás
    ruby-on-rails ruby osx sqlite3
    I’m new to Mac and Ruby on Rails and I’m trying to set up my environment. I’ve been working through this tutorial and am stuck trying to get the sqlite3 gem installed on Mac OS X Lion.Xcode 4.2.1 git version 1.7.5.4 Ruby 1.9.3p0 gem -v results in 1.8.11 sqlite version 3.7.5When I try to run gem install sqlite3 or gem install sqlite3 — –with-sqlite3-dir=/usr/bin I get the error text below, does anyone have any suggestions?Building native extensions. This could take a while… ERROR: Error in

  • Marcin
    ruby osx rubygems
    I can’t install mysql gem on my 10.8 (mac osx) machine. I installed mysql with homebrew by$brew install mysqlthen I do:$sudo gem install mysql Building native extensions. This could take a while… ERROR: Error installing mysql:ERROR: Failed to build gem native extension./Users/marcinkrzyzanowski/.rvm/rubies/ruby-1.9.3-head/bin/ruby extconf.rb checking for mysql_ssl_set()… *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or head

  • Geuis
    php osx gd2 freetype2
    I’m compiling PHP5.2.9 on Mac OS X 10.5.6. Need some help to figure this out.I have PHP compiling and working with a basic config, and now I’m trying to compile with GD2. The problem I’m running into is that if I add the argument to build with Freetype, I get build errors. This is my minimum config to demo the problem. Also, I know that there are other requirements for libjpeg/libpng, etc. I’m not including those right now to make this simpler.sudo ./configure –prefix=/usr/local/php –with-conf

  • Jonas Karlsson
    java osx tomcat ant
    I’m using Tomcat version 6.0.29 with JVM version 1.6.0_51-b11-456-11M4508 from Apple Inc. running on Mac OS X version 10.8.4 with x86_64 OS architecture. This is because we are using an old customer environment. I’m using IDEA together with Ant to build the web application and the build script is running fine, except for the first time I ran the script because I then got build errors. But running the script again makes the project compile without any issues.But the web application won’t start. W

  • depa
    ruby osx rubygems operating-system rmagick
    I understand that this question has been asked a lot earlier, but none of the solutions worked for me and I’m really desperate right now.I’m trying to get rMagick to install using gem for an installation of diaspora. I already installed imagick via homebrew and when trying to run gem install rmagick I receive this error:ERROR: Error installing rmagick:ERROR: Failed to build gem native extension./Users/tobischweiger/.rvm/rubies/ruby-1.9.3-p385/bin/ruby extconf.rb checking for Ruby version >=

  • George Astonishing
    ruby-on-rails ruby-on-rails-3 osx gcc osx-mavericks
    I am trying to create my first application on ruby rails. I am on Mac OsX (Mavericks) I have the latest xCode installed (5 i believe) + command line tools I have installed the bitnami bundle ruby stack I have added rails (sudo gem install rails -V)All steps until creating my own project work —- see hereIn the ruby console I type: sudo rails new helloworld .. then it does some creational stuff till it hits the following lines:run bundle install Fetching gem metadata from https://rubygems.org/.

  • user1684696
    osx hadoop
    I have set something up on my mac for installing hadoop. But there is an error message like this:13/02/18 04:05:52 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 0 time(s). 13/02/18 04:05:53 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 1 time(s). 13/02/18 04:05:54 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 2 time(s). 13/02/18 04:05:55 INFO ipc.Client: Retrying connect to server

  • Jonik
    android audio audio-recording android-mediarecorder
    I’m trying to make a simple application that will record an audio file and store it in local storage but for some reason my code isn’t working! I’m wondering there might be some problem with my code! Please help to find the mistake!public class demo extends Activity implements OnClickListener {private static final String LOG_TAG = “AudioRecordTest”;private static String mFileName = null;private MediaRecorder mRecorder = null;private MediaPlayer mPlayer = null;boolean mStartPlaying, mStartRecordi

  • omar
    ios c audio mfcc
    I am trying to extract some features from audio files, MFCC to be accurate. Then I found a C library LibXtract, that would do the job for me.I am trying to use LibXtract in iOS project, I have followed this tutorial http://inote.apptrek.net/2011/10/howto-compile-native-c-codes-to-a-library-for-ios-development-in-xcode-take-mosquitto-for-an-example/but I got some problems in process, first I got this warning ld: warning: ignoring file ……./libLibXtract.a, missing required architecture i386 in

  • Habba
    android audio opensl
    I’m using OpenSL ES and my android app has need for multiple channels, so I create multiple player-objects (plus one player-object for each of mp3-files I need to play). This works fine for one application, but when I ran another app I’ve created, it will fail to play any sound and log files say E/AudioFlinger( 119): no more track names available E/AudioTrack( 6884): AudioFlinger could not create track, status: -12 E/libOpenSLES( 6884): AudioTrack::initCheck status 4294967284 W/libOpenSLES( 688

  • JMartini
    android audio file-read datainputstream
    I am working on a simple AudioTrack example which reads in a PCM file then plays it back. It works great on the android emulator, but on my test phone it fails when reading in the data with the readShort() function. Here is where the code is failing://! Read in the raw audio fileaudioData= new short[0];try {InputStream is= this.getAssets().open(“Vocals.pcm”);BufferedInputStream bis = new BufferedInputStream(is);DataInputStream audioFileStream = new DataInputStream(bis);audioData= new shorthttp://www.gravatar.com/avatar/aabf5606f445320b580498a027ec289f?s=32&d=identicon&r=PG sounds; … sounds = new Clip[3]; sounds[0] = getClip(“gun.wav”); sounds[1] = getClip(“click.wav

  • Andro Selva
    android audio streaming media-player wav
    We are streaming audio via http from ffserver/ffmpeg on Angstrom Linux. The ffmpeg audio codec is PCM signed 16-bit little endian “pcm_s16le”. The ffmpeg stream format is “wav”. Both of these are claimed to be supported on Android here: http://developer.android.com/guide/appendix/media-formats.html#coreVLC finds and plays the stream without any problems. Under VLC “Codec Details”, it says: Type: Audio, Codec: PCM S16 LE (araw) Channels: Stereo Sample rate: 48000 Hz Bits per sample: 16 We

  • Gilles
    debian audio jack
    I’m trying to play with ardour. When I started it up, it complained that jackd isn’t running, so I ran jackd -d alsa, which displayed:jackdmp 1.9.6 Copyright 2001-2005 Paul Davis and others. Copyright 2004-2010 Grame. jackdmp comes with ABSOLUTELY NO WARRANTY This is free software, and you are welcome to redistribute it under certain conditions; see the file COPYING for details no message buffer overruns no message buffer overruns JACK server starting in realtime mode with priority 10 audio_rese

  • Michael Petrotta
    visual-studio debugging fmod
    This is a follow up to this post, but it’s a little different so I felt it warranted a new question. Basically, Visual Studio has stopped outputting both printfs and memory leak info (I’m working on a DirectX app). After some digging, I’ve found fmod seems to be preventing VS from printing memory leak information. Specifically, if I comment out:ERRCHECK(mSystem->init(32, FMOD_INIT_NORMAL, 0));all my output returns. Has anybody seen this before? Any ideas?

  • rideronthestorm
    c# loops sequence fmod
    I started using FMOD library, because I need to play sounds without gaps in C# application (both one sound in a loop and many sounds in a sequence). Can anyone show me the correct way to do it? I tried make something based on examples, but it’s not working as I would like it to work. Firstly, when I try to set if the sound is looped, while it’s playing, if (value) sound1.setMode(FMOD.MODE.LOOP_NORMAL); else sound1.setMode(FMOD.MODE.LOOP_OFF);nothing is going on. It only works fine, when I set

  • Sean Herman
    iphone objective-c ios if-statement fmod
    I have a simple set of FMOD actions that each play various sounds separately. The problem comes in that I have a button that stops all the sounds. FMOD crashes my program if we try to stop a sound that isn’t playing. Makes sense. But I’ve decided that there has to be a way to call a simple if statement to find out “if” and only “if” somethings playing, then stop it.- (IBAction)myButton:(id)sender {if “FMOD CHANNEL IS PLAYING” {result = fmodChannel->stop();}}Any help would be appreciated.

  • 2am
    c++ multithreading osx audio fmod
    I am working on a game which uses FMOD library to recognise mic input, now the mic input with built in macbook mic is fine, but when I use a USB mic [like we have in webcams] the application gives following error:[com.apple.audio.IOThread.client] AUHAL.cpp:2470: AUIOProc: AUHAL::AUIOProc: mono buffer too small (1024 > 512)The application doesn’t actually crash on this error, but I see this error on console, what does it mean? [ does it mean that the buffer apple core audio uses is of 512 but

  • Ryuu
    c++ runtime-error fmod
    I’m using FMOD in my c++ project. There are no errors or warning when building, however when debugging; I get the following runtime error from the FMOD_System_CreateSound function:Unhandled exception at 0x008e3f56 in Audio_Demo.exe: 0xC0000005: Access violation reading location 0xfdfdfdfd.Here is the function call:FMOD_System_CreateSound(system, filename.c_str(), FMOD_DEFAULT, NULL, &sample->sample);Where, system is a pointer to an FMOD_SYSTEM object, sample is a helper class and sample->

  • ???
    gcc compiler linker mingw fmod
    I have the following example from the fmod api docs./*===============================================================================================PlaySound ExampleCopyright (c), Firelight Technologies Pty, Ltd 2004-2011.This example shows how to simply load and play multiple sounds. This is about the simplestuse of FMOD.This makes FMOD decode the into memory when it loads. If the sounds are big and possibly takeup a lot of ram, then it would be better to use the FMOD_CREATESTREAM flag so th

  • James
    c++ codeblocks undefined-reference fmod
    After looking around for various sound API libraries, I have decided to use FMOD for the time being.Problem is that whenever I try to compile one of the code examples, I get the following errors:obj\Release\main.o:main.cpp|| undefined reference to `FMOD::System::getVersion(unsigned int*)@8’|obj\Release\main.o:main.cpp|| undefined reference to `FMOD::System::init(int, unsigned int, void*)@16’|obj\Release\main.o:main.cpp|| undefined reference to `FMOD::System::createSound(char const*, unsigned int

Web site is in building