Trying to stream a file is more or less a lottery. At times it loads up and plays properly, other times it loads about a sec or two and then repeats itself (skipping?).
FSOUND_SetBufferSize(n) doesn’t seem to be doing much. FSOUND_Stream_SetBufferSize(n) helps, the more buffer i allocate the more lenght of the song it streams, but will still stop and repeat from start.
This happens with my app, as well as the sample applications provided with FMOD.
Application is time based, frame locked in at 60fps. Sound card is a Sound blaster Audigy2ZS, with no appropriate driver from Creative, but using ALSA emu10k1. Linux kernel = 2.6.18
Any help would be greatly appreciated.
- Norbi asked 12 years ago
Sorry to dig up an old post, but my situation is exactly as described.
The problem happens on the FC6 system I use for development at work. It works on my colleague’s FC4 laptop so I suspect the problem only manifests itself on newer, NPTL only systems.
Anyway, I studied the FMOD code and found one questionable use of getpid() to identify threads. Under NPTL, getpid() always return the same PID for all threads spawned by the same process. I can’t get into specifics here (as I’m probably not allowed to) but the end result is that locking is effectively, for the most part, non-existent. FMOD streaming breaks with all the usual problems associated when data access is not properly synchronized.
The problem immediately goes away when you replace the call to getpid() with pthread_self().
For those who don’t have source code access, maybe you could avoid threads altogether by passing FSOUND_INIT_STREAM_FROM_MAIN_THREAD to FSOUND_Init() and then repeatedly calling FSOUND_Update() later to process and play streams.
- Wvel answered 11 years ago
Upon dealing with this problem as per Wvel’s suggestion, I have run into [i:s6sgi09f]a different[/i:s6sgi09f] problem: the Stuttering Sound Problem (TM). I have looked the FAQ section on this, and have found its suggestions unsatisfactory: I did the highest suggested values for FSOUND_SetBufferSize(…) and FSOUND_Stream_SetBufferSize(…) (and yes, I put FSOUND_SetBufferSize(…) prior to FSOUND_Init(…)), but to no avail. Needless to say, I am pretty frustrated (I wouldn’t have even come to this forum had it not been a sufficiently aggravating problem).
I just got my computer a few weeks (maybe a month) ago, so out-of-date sound drivers I don’t think should be an issue.
FMod has always worked fine on my old computer (and I think it may have worked on the Windows partition of my current computer), but it is NOT working in Linux…
Suggestions would be [i:s6sgi09f]greatly[/i:s6sgi09f] appreciated.
- Aardwolf answered 11 years ago
Please login first to submit.