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

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

Re: [Gap-dev-discuss] Cynthiune : add an alsa backend for linux


From: Sebastian Reitenbach
Subject: Re: [Gap-dev-discuss] Cynthiune : add an alsa backend for linux
Date: Thu, 03 May 2012 18:53:33 +0200
User-agent: SOGoMail 1.3.14

On Thursday, May 3, 2012 18:32 CEST, "Sebastian Reitenbach" <address@hidden> 
wrote:

>  Hi Philippe
>
> On Thursday, May 3, 2012 14:49 CEST, Philippe Roussel <address@hidden> wrote:
>
> > Hi,
> >
> > Le 03/05/2012 11:17, Sebastian Reitenbach a écrit :
> > >
> > > On Thursday, May 3, 2012 10:19 CEST, Philippe Roussel <address@hidden> 
> > > wrote:
> > >
> > >> Hi,
> > >>
> > >> Le 03/05/2012 00:40, Riccardo Mottola a écrit :
> > >>> Hi,
> > >>>
> > >>> I commited the ALSA backend. I removed the migration/preferences stuff
> > >>> because I disagree with it, but I changed the defaults and tweaked the
> > >>> makefiles to isntall in the correct place.
> > >>>
> > >>> It appears to work for me! I get an exception and I'll track it down
> > >>> hopefully, but check if what's in the repo works with you.
> > >>
> > >> It does, as expected :o)
> > >>
> > >>> Actually, with ALSA and OSS we are quite "served" as far as backends go.
> > >>
> > >> How about your *BSD systems ?
> > >
> > > I just checked and it compiles still all fine for me on OpenBSD. Still 
> > > need to test
> > > it though. I'm still struggling with the Sndio Output Backend, exploring 
> > > multiple
> > > ways to get around the issue I have.
> > > Do you can send the libao backend you wrote? If the libao backend works
> > > reliably, then I think it would be the preferred way to go for OpenBSD, 
> > > and
> > > maybe other *BSD for the time being. I still can work/experiment with the
> > > Sndio backend, but would have much less pressure to get it done ;)
> >
> > Here's what I sent Riccardo off list.
> >
> > Let me know of this works for you.
>
> I tested on OpenBSD, and it generally works. But it seems, you are facing 
> exactly the same problem
> like I do. I tested playing FLAC and MP3 files, works well. But I have one 
> FLAC file in my playlist
> which has a bit rate of 16000Hz, all the other MP3 files have 44100Hz.
> When the sound output is stopped, and I just double click the FLAC file or 
> any MP3, it starts
> playing that file, with the right bit rate.
> But when the playlist is playing, and it jumps from a 44100Hz MP3 to the 
> 16000 FLAC file,
> then the FLAC file is played too fast. When I start playing music by double 
> clicking the 16000Hz
> FLAC file, and it then jumps to the 44100Hz MP3, the MP3 is played too slow.
> I added a NSLog in the metthod like this:
>
> - (BOOL) prepareDeviceWithChannels: (unsigned int) numberOfChannels
>                            andRate: (unsigned long) sampleRate
> {
> NSLog(@"prepareDevice: Channels: %u rate: %lu", numberOfChannels, sampleRate);
>   format.channels = (int)numberOfChannels;
>   format.rate = (int)sampleRate;
> ...
>
>
> and on the console, I see, when it automatically jumps to the next song, the 
> method is called
> with the right bit rate, but the rate is not changed correctly while the play 
> thread is still running.
>
> I thought about using a lock, so that in the playing thread, so the 
> prepareDeviceWithChannels
> creates a lock to pause the playing thread. Then when this thread is paused 
> playing, it makes the
> changes to the bit rate, and maybe channels, and then the lock will be opened 
> again, and
> then the play thread will start playing again. But I haven't yet figured out, 
> how to get that right,
> since I still run into race conditions between the threads.

I just crosschecked, and the ESound and aRts output bundles don't suffer the 
described problem.

Sebastian

>
> The test FLAC file I use can be found here.
> http://code.google.com/p/cs-4244-mkl/source/browse/trunk/project-4/GSTT/mike-test.flac?r=202
>
> cheers,
> Sebastian
>
> >
> > Thanks,
> > Philippe
>
>
>
>
>







reply via email to

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