From kde-multimedia Fri Apr 28 10:11:09 2000 From: Stefan Westerfeld Date: Fri, 28 Apr 2000 10:11:09 +0000 To: kde-multimedia Subject: Re: Problems with aRtsc X-MARC-Message: https://marc.info/?l=kde-multimedia&m=95691666909823 Hi! On Fri, Apr 28, 2000 at 11:30:12AM +0200, Joseph WENNINGER wrote: > I hope it's not offtopic on this list, but I don't know where to ask Its perfect, here ;). > I try to write a plugin for my favorite music-player under X (xmms), but I > have problems with the aRts C-API. > > 1) Is there a >>>>>reliable<<<<<< way to find out how many space is left in > the arts internal buffer ? int bytesLeft = arts_stream_get(stream,ARTS_P_BUFFER_SPACE); should be reliable. At least that is what I used in the quake port, and I saw no problems with that. > 2) When I write data to the stream, the arts-C buffer runs full afer some > writes, but doesn't start playing, instead it segfaults in the write call. I > tried to wait for a certain time between the write calls, but it shows' the > same behaviour, because I first thought I produce too much load to the > server. It is supposed to block anyway, if you write too fast, so you can't produce too much load to the server. > (Does someone know about such a problem ? I can't figure it out, I even > looked at the mpg-123 patch, but it didn't help Probably, that has something to do with the fact that XMMS is threaded. I have been running into weird problems as well, with the combination of artsdsp and xmms (random segfaults, too). The theory is: aRts itself is *not* threadsafe, but if you only access the arts_xxx functions from one thread, or use a pthread_mutex, to ensure that only one thread uses any arts_xxx function at a time, it should work. The reality seems to be different, however. I think there are problems with not-threadsafe libraries, for instance glibc, which could cause these random segfaults. I got a report that the same thing that crashes for me (debian2.1 with glibc-2.0.7) runs fine on a mandrake7 system with glibc-2.1.x installed. I have done experiments with recomiling aRts and libltdl with -D_REENTRANT (just guessing that this could help), but it did not. Cu... Stefan -- -* Stefan Westerfeld, stefan@space.twc.de (PGP!), Hamburg/Germany KDE Developer, project infos at http://space.twc.de/~stefan/kde *-