LaiNES icon indicating copy to clipboard operation
LaiNES copied to clipboard

Audio on Linux has some problem. Also, SDL2 audio APIs are deprecated.

Open AndreaOrru opened this issue 9 years ago • 9 comments

AndreaOrru avatar Dec 07 '15 04:12 AndreaOrru

Is the problem "Extreme choppyness?" if so, I am experiencing this and will investigate.

kraln avatar Nov 29 '16 01:11 kraln

It is. I just switched back to Linux actually, so I can have a look too. I have plans to rewrite the APU core to be independent from blargg's libraries anyway.

AndreaOrru avatar Nov 29 '16 02:11 AndreaOrru

621aa65858ec6eaae33f051cd0041e4d95df9354 should solve this. Hopefully it doesn't break on Mac.

AndreaOrru avatar Dec 01 '16 14:12 AndreaOrru

Issue still present on my machine: Linux galium 4.8.3-1-ARCH #1 SMP PREEMPT Thu Oct 20 19:53:59 CEST 2016 x86_64 GNU/Linux

Compiler: clang version 3.8.1 (tags/RELEASE_381/final)

Computer: Thinkpad L460

Here's a .FLAC -- you can see the audio output is really choppy. test.zip

kraln avatar Dec 02 '16 10:12 kraln

Ok. It solved it on mine. I'll borrow another Linux machine and experiment more.

I started sketching the new APU core anyway. If this is a quick fix then it's great, otherwise I'd rather focus on the rewrite. :)

AndreaOrru avatar Dec 02 '16 18:12 AndreaOrru

I started to poke around a bit. When I run the APU for twice as many cycles, it seems to be better. When I run it at a lower sample rate (= lowpass filter), it seems to be much better.

https://github.com/kraln/LaiNES/tree/investigating_audio

kraln avatar Dec 05 '16 09:12 kraln

Thanks.

What I find weird is that it works flawlessly on Mac OS X. Could that be because of a better sampling engine or something like that?

I won't have a lot of time to work on this till at least the 21st of December. Your contributions are super appreciated. :)

AndreaOrru avatar Dec 05 '16 14:12 AndreaOrru

In Ubuntu, entering export SDL_AUDIODRIVER=ALSA before running improves the audio by a lot.

RyanPattison avatar Jan 16 '17 19:01 RyanPattison

Thanks, that's good to know! I'll write that in the README.

AndreaOrru avatar Feb 06 '17 21:02 AndreaOrru