qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH] audio/sdlaudio: Allow audio playback with S


From: Thomas Huth
Subject: Re: [Qemu-devel] [RFC PATCH] audio/sdlaudio: Allow audio playback with SDL2
Date: Wed, 1 Feb 2017 16:30:24 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0

On 01.02.2017 14:25, Gerd Hoffmann wrote:
> On Di, 2017-01-31 at 09:46 +0100, Thomas Huth wrote:
>> When compiling with SDL2, the semaphore trick used in sdlaudio.c
>> does not work - QEMU locks up completely in this case. To avoid
>> the hang and get at least some audio playback up and running (it's
>> a little bit crackling, but better than nothing), we can use the
>> SDL locking functions SDL_LockAudio() and SDL_UnlockAudio() to sync
>> with the sound playback thread instead.
> 
> Does SDL_LockAudio work with sdl1 too?
> So we can possibly avoid having all those #ifdefs?

It somehow works, too, but sound quality is - at least for me - much
worse here than with the semaphore code. Maybe it can be fixed, too, but
I am really not familiar enough with the QEMU internal audio API to
figure out how to fix this (e.g. I don't understand why the run_out
function is called way more often than the callback function, but its
"live" parameter never reaches the full buffer size).
So maybe we can start with the #ifdefs for now and remove them once
somebody figured out how to improve sound quality for SDL1, too? (or
once we remove support for SDL1 from QEMU completely ... or do we want
to carry that with us forever?).

 Thomas




reply via email to

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