[Spice-devel] [spice-gtk sound rework 3/3] Use the new snd_codec interface to process encoded audio.

Christophe Fergeau cfergeau at redhat.com
Thu Oct 31 15:36:46 CET 2013


On Wed, Oct 30, 2013 at 03:49:37PM -0500, Jeremy White wrote:
> The next set of patches change that warning.  You mentioned on irc
> that you encountered a crash in qemu with these patches.
> 
> Do you have any more details?

Yup, finally could look at it, it happens when I disable celt support in
spice-common configure.ac, we should fallback to raw audio, but this
crashes:
#0  0x00007ffff267ad36 in snd_codec_frame_size (codec=0x0) at snd_codec.c:225
#1  0x00007ffff25d8a6f in spice_server_playback_get_buffer (sin=0x5555566d06a8, frame=0x5555566d06d0, num_samples=0x5555566d06e0)
    at snd_worker.c:1078
#2  0x00005555555e30b7 in line_out_run (hw=0x5555566d0620, live=1023) at audio/spiceaudio.c:155
#3  0x00005555555db274 in audio_run_out (s=0x555555d68420 <glob_audio_state>) at audio/audio.c:1406
#4  0x00005555555db846 in audio_run (msg=0x55555595a080 "timer") at audio/audio.c:1547
#5  0x00005555555da827 in audio_timer (opaque=0x555555d68420 <glob_audio_state>) at audio/audio.c:1136
#6  0x00005555557ac6f5 in qemu_run_timers (clock=0x55555660e740) at qemu-timer.c:394
#7  0x00005555557ac942 in qemu_run_all_timers () at qemu-timer.c:452
#8  0x000055555577ce70 in main_loop_wait (nonblocking=0) at main-loop.c:422
#9  0x00005555558065d5 in main_loop () at vl.c:2001
#10 0x000055555580da57 in main (argc=16, argv=0x7fffffffdc28, envp=0x7fffffffdcb0) at vl.c:4326

What happens is that we only create a codec in non-raw mode:

snd_set_playback_peer():

if (desired_mode != SPICE_AUDIO_DATA_MODE_RAW)
    {
        if (snd_codec_create(&playback_channel->codec, desired_mode, SPICE_INTERFACE_PLAYBACK_FREQ, TRUE, FALSE) == SND_CODEC_OK) {
            playback_channel->mode = desired_mode;
        } else {
            spice_printerr("create encoder failed");
        }
    }

but we unconditionnally try to use it in spice_server_playback_get_buffer:

*num_samples = snd_codec_frame_size(playback_channel->codec);

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20131031/da142b6f/attachment.pgp>


More information about the Spice-devel mailing list