Re: RFC on sound codec refactoring

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

 



On Mon, Oct 07, 2013 at 07:08:40AM -0500, Jeremy White wrote:
> >>Instead of having to resample, can't we fix qemu (and spice headers) to use 48khz by default?
> >
> >Sure we can switch the default.  spice headers is enougth btw.  Just
> >update the frequency there.  And bumb the minor version so spice-server
> >can figure which frequency is used by qemu.
> >
> >You can still face the case that spice-server has to handle a old
> >(not-yet rebuilt against new spice-headers) qemu binary which operates
> >at 44.1 kHz.  So the 44.1 -> 48 resampling will be needed, even when is
> >used for a (hopefully short) transition period only.
> 
> This is where we last left off, last June.
> 
> My current question is:  can we modify qemu to support a dynamic rate change?
> In theory, it supports other devices that run at different frequencies,
> so it should be theoretically possible.

Depends what you call a 'dynamic rate change'. When using spice, at qemu
startup, this function:

static int line_out_init (HWVoiceOut *hw, struct audsettings *as)
{
    SpiceVoiceOut *out = container_of (hw, SpiceVoiceOut, hw);
    struct audsettings settings;

    settings.freq       = SPICE_INTERFACE_PLAYBACK_FREQ;
    settings.nchannels  = SPICE_INTERFACE_PLAYBACK_CHAN;
    settings.fmt        = AUD_FMT_S16;
    settings.endianness = AUDIO_HOST_ENDIANNESS;

    audio_pcm_init_info (&hw->info, &settings);
    hw->samples = LINE_OUT_SAMPLES;
    out->active = 0;

    out->sin.base.sif = &playback_sif.base;
    qemu_spice_add_interface (&out->sin.base);
    return 0;
}

is called. It's possible to replace the static
SPICE_INTERFACE_PLAYBACK_FREQ by a function returning 44100 or 48000
depending on whether Opus support is enabled or not. Once the audio device
is created, I'm not sure the playback frequency can easily be changed.

Christophe

Attachment: pgpoUyyohWC35.pgp
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]