gap-dev-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gap-dev-discuss] Cynthiune : make ALSA output handle parameter chan


From: Philippe Roussel
Subject: Re: [Gap-dev-discuss] Cynthiune : make ALSA output handle parameter changes between song
Date: Tue, 22 May 2012 09:41:44 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

Le 22/05/2012 00:45, Riccardo Mottola a écrit :
> Hi,
> 
> On 2012-05-22 00:39:18 +0200 Philippe Roussel <address@hidden> wrote:
> 
> 
>> Can you reproduce this every time ? If yes could you try to find the
>> cause or at least send me a backtrace that leads to this error ?
> 
> it is consistent yes. But it does not yield to a crash, just to an
> exception which comes from the Alsa backend.

Could you try the following ? The device handle wasn't protected in all
sites.

Index: Bundles/ALSA/ALSA.m
===================================================================
RCS file: /sources/gap/gap/user-apps/Cynthiune/Bundles/ALSA/ALSA.m,v
retrieving revision 1.3
diff -u -r1.3 ALSA.m
--- Bundles/ALSA/ALSA.m 21 May 2012 21:43:29 -0000      1.3
+++ Bundles/ALSA/ALSA.m 22 May 2012 07:39:55 -0000
@@ -86,6 +86,7 @@
   int err;
   BOOL result = NO;

+  [devLock lock];
   if ((err = snd_pcm_open (&pcm_handle, device,
SND_PCM_STREAM_PLAYBACK, 0))
       < 0)
     NSRunAlertPanel (LOCALIZED (@"Error"),
@@ -104,6 +105,7 @@
                     LOCALIZED (@"OK"), NULL, NULL, snd_strerror (err));
   else
     result = YES;
+  [devLock unlock];

   return result;
 }
@@ -138,8 +140,10 @@
 {
   while (stopRequested)
     [NSThread sleepUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.1]];
+  [devLock lock];
   snd_pcm_close (pcm_handle);
   pcm_handle = NULL;
+  [devLock unlock];
 }

 - (void) threadLoop



reply via email to

[Prev in Thread] Current Thread [Next in Thread]