View Single Post
Old 07-14-2012, 08:29 PM   #181
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
Quote:
Originally Posted by geekmaster View Post
One thing about tiny little code with no error messages is that you get to rely on the general all-purpose error message called "segfault".

And then there are those darned built-in libraries that spoil the party by injecting their own error messages before aborting.

Of course, in "real" code (especially all the motion-control / robotics / factory automation stuff I did over the years), you need to recover gracefully from just about anything that can happen, logging it silently while not annoying the machine operator, and self-calibrating WHILE in operation. You cannot shut down operations just because the machine is failing, if your software can compensate for the progressive failure. But you also cannot just hit the reset button to restart after a large part of your machine goes through a brick wall and out into the parking lot because of a software glitch.

Now, the reason I brought this up, is that I am getting segfaults with your latest code. PEBKAC errors no doubt.
unsure which version I sent.
I call the current incarnation like ./Balsamic plughw 8k8bmono.wav 8000

but I think I added the argv[3] for alternate speed playback - extra testing options.

I removed all error handling more or less - aside from the obvious alsa bits that were already hanging around.

It may segfault when it gets to the end of the file. My current one does because I don't check for %WaveSize correctly (I'm monitoring the wave stream as video info)

I've abandoned all attempts to sync vid pending your next revelation.

My code is not hardy nor well programmed. But I've got the seggies down to expected ones my end. let me know approx where it segges and ill have a think - the strace of it should be utterly straightforward.

: ) It's possibly the polling failing but I dont think so.


as an aside I got a huge performance increase by simply

Code:
void gmplay4(void) {

	while (1)
	{
		if (frameCount %2==0)
		{
BLAH
                 }
	else
		{
			usleep(5);  // or 10 
		}
as opposed to the sync waiting. the minuscule difference in frame rate (seemingly like 5 or 6 solid ones rather than 6 or 7 sketchy ones) was not that worse. perhaps a tiny sleep could be worked in if we are using threads - they seem to like it

Last edited by twobob; 07-14-2012 at 08:31 PM. Reason: tightened loop
twobob is offline   Reply With Quote