qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] d1670b: audio: fix parameter dereference befo


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] d1670b: audio: fix parameter dereference before NULL check
Date: Fri, 18 Oct 2019 08:36:27 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: d1670b20dc007c17760b076c0475eedb3d20f270
      
https://github.com/qemu/qemu/commit/d1670b20dc007c17760b076c0475eedb3d20f270
  Author: Kővágó, Zoltán <address@hidden>
  Date:   2019-10-18 (Fri, 18 Oct 2019)

  Changed paths:
    M audio/audio_template.h

  Log Message:
  -----------
  audio: fix parameter dereference before NULL check

This should fix Coverity issues CID 1405305 and 1405301.

Signed-off-by: Kővágó, Zoltán <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 3443ad4ed699b239efb27f2eb00a54083b081346
      
https://github.com/qemu/qemu/commit/3443ad4ed699b239efb27f2eb00a54083b081346
  Author: Kővágó, Zoltán <address@hidden>
  Date:   2019-10-18 (Fri, 18 Oct 2019)

  Changed paths:
    M audio/paaudio.c

  Log Message:
  -----------
  audio: paaudio: fix connection and stream name

Connection name was previously erroneously set to the server socket
path, while connection names were simply "qemu".  After this patch, the
connection name will be the vm name (falling back to "qemu" if not
specified), while stream names will be the audiodev's id.

Signed-off-by: Kővágó, Zoltán <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: f47dffe8d16dcf99566239c273d52511c48e23e3
      
https://github.com/qemu/qemu/commit/f47dffe8d16dcf99566239c273d52511c48e23e3
  Author: Kővágó, Zoltán <address@hidden>
  Date:   2019-10-18 (Fri, 18 Oct 2019)

  Changed paths:
    M audio/paaudio.c
    M qapi/audio.json

  Log Message:
  -----------
  audio: paaudio: ability to specify stream name

This can be used to identify stream in tools like pavucontrol when one
creates multiple -audiodevs or runs multiple qemu instances.

Signed-off-by: Kővágó, Zoltán <address@hidden>
Acked-by: Markus Armbruster <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 8efac073a58ff135b805f895325463166eafdc48
      
https://github.com/qemu/qemu/commit/8efac073a58ff135b805f895325463166eafdc48
  Author: Kővágó, Zoltán <address@hidden>
  Date:   2019-10-18 (Fri, 18 Oct 2019)

  Changed paths:
    M qapi/audio.json
    M qemu-options.hx

  Log Message:
  -----------
  audio: add mixing-engine option (documentation)

This will allow us to disable mixeng when we use a decent backend.

Disabling mixeng have a few advantages:
* we no longer convert the audio output from one format to another, when
  the underlying audio system would just convert it to a third format.
  We no longer convert, only the underlying system, when needed.
* the underlying system probably has better resampling and sample format
  converting methods anyway...
* we may support formats that the mixeng currently does not support (S24
  or float samples, more than two channels)
* when using an audio server (like pulseaudio) different sound card
  outputs will show up as separate streams, even if we use only one
  backend

Disadvantages:
* audio capturing no longer works (wavcapture, and vnc audio extension)
* some backends only support a single playback stream or very picky
  about the audio format.  In this case we can't disable mixeng.

Originally thw two main use cases of the disabled option was: using
unsupported audio formats (5.1 and 7.1 audio) and having different
pulseaudio streams per audio frontend.  Since we can have multiple
-audiodevs, the latter is not that important, so currently you only need
this option if you want to use 5.1 or 7.1 audio (implemented in a later
patch), otherwise it's probably better to stick to the old and tried
mixeng, since it's less picky about the backends.

The ideal solution would be to port as much as possible to gstreamer,
but this is currently out of scope:
https://wiki.qemu.org/Internships/ProjectIdeas/AudioGStreamer

Signed-off-by: Kővágó, Zoltán <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 1930616b98c3669de2df0b271a98a308d6f85083
      
https://github.com/qemu/qemu/commit/1930616b98c3669de2df0b271a98a308d6f85083
  Author: Kővágó, Zoltán <address@hidden>
  Date:   2019-10-18 (Fri, 18 Oct 2019)

  Changed paths:
    M audio/audio.c
    M audio/audio_template.h

  Log Message:
  -----------
  audio: make mixeng optional

Implementation of the previously added mixing-engine option.

Signed-off-by: Kővágó, Zoltán <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 337e8de6fbaa61b7dd14e6c29836673132891642
      
https://github.com/qemu/qemu/commit/337e8de6fbaa61b7dd14e6c29836673132891642
  Author: Kővágó, Zoltán <address@hidden>
  Date:   2019-10-18 (Fri, 18 Oct 2019)

  Changed paths:
    M audio/paaudio.c

  Log Message:
  -----------
  paaudio: get/put_buffer functions

This lets us avoid some buffer copying when using mixeng.

Signed-off-by: Kővágó, Zoltán <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: cecc1e79bf9ad9a0e2d3ce513d4f71792a0985f6
      
https://github.com/qemu/qemu/commit/cecc1e79bf9ad9a0e2d3ce513d4f71792a0985f6
  Author: Kővágó, Zoltán <address@hidden>
  Date:   2019-10-18 (Fri, 18 Oct 2019)

  Changed paths:
    M audio/audio.c
    M audio/audio.h
    M audio/audio_int.h
    M audio/paaudio.c
    M audio/spiceaudio.c

  Log Message:
  -----------
  audio: support more than two channels in volume setting

Signed-off-by: Kővágó, Zoltán <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 2b9cce8c8c37b95290c48c037e51e001985124d1
      
https://github.com/qemu/qemu/commit/2b9cce8c8c37b95290c48c037e51e001985124d1
  Author: Kővágó, Zoltán <address@hidden>
  Date:   2019-10-18 (Fri, 18 Oct 2019)

  Changed paths:
    M audio/alsaaudio.c
    M audio/audio.c
    M audio/audio_int.h
    M audio/coreaudio.c
    M audio/dsound_template.h
    M audio/dsoundaudio.c
    M audio/noaudio.c
    M audio/ossaudio.c
    M audio/spiceaudio.c
    M audio/wavaudio.c

  Log Message:
  -----------
  audio: replace shift in audio_pcm_info with bytes_per_frame

The bit shifting trick worked because the number of bytes per frame was
always a power-of-two (since QEMU only supports mono, stereo and 8, 16
and 32 bit samples).  But if we want to add support for surround sound,
this no longer holds true.

Signed-off-by: Kővágó, Zoltán <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: b5c7db3eefeba1cb661c86b2e530ea387319db1d
      
https://github.com/qemu/qemu/commit/b5c7db3eefeba1cb661c86b2e530ea387319db1d
  Author: Kővágó, Zoltán <address@hidden>
  Date:   2019-10-18 (Fri, 18 Oct 2019)

  Changed paths:
    M audio/alsaaudio.c
    M audio/audio.c

  Log Message:
  -----------
  audio: basic support for multichannel audio

Which currently only means removing some checks.  Old code won't require
more than two channels, but new code will need it.

Signed-off-by: Kővágó, Zoltán <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 2c6a740f6b0bafc59d7008bf1138c163fb541d6b
      
https://github.com/qemu/qemu/commit/2c6a740f6b0bafc59d7008bf1138c163fb541d6b
  Author: Kővágó, Zoltán <address@hidden>
  Date:   2019-10-18 (Fri, 18 Oct 2019)

  Changed paths:
    M hw/usb/dev-audio.c

  Log Message:
  -----------
  usb-audio: do not count on avail bytes actually available

This assumption is no longer true when mixeng is turned off.

Signed-off-by: Kővágó, Zoltán <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 3e44607e9394ca08f8672bffa045d2462a371bbc
      
https://github.com/qemu/qemu/commit/3e44607e9394ca08f8672bffa045d2462a371bbc
  Author: Kővágó, Zoltán <address@hidden>
  Date:   2019-10-18 (Fri, 18 Oct 2019)

  Changed paths:
    M hw/usb/dev-audio.c

  Log Message:
  -----------
  usb-audio: support more than two channels of audio

This commit adds support for 5.1 and 7.1 audio playback.  This commit
adds a new property to usb-audio:

* multi=on|off
  Whether to enable the 5.1 and 7.1 audio support.  When off (default)
  it continues to emulate the old stereo-only device.  When on, it
  emulates a slightly different audio device that supports 5.1 and 7.1
  audio.

Signed-off-by: Kővágó, Zoltán <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 670777a91580ec7e34d879c3973927f748be6f47
      
https://github.com/qemu/qemu/commit/670777a91580ec7e34d879c3973927f748be6f47
  Author: Kővágó, Zoltán <address@hidden>
  Date:   2019-10-18 (Fri, 18 Oct 2019)

  Changed paths:
    M hw/usb/dev-audio.c

  Log Message:
  -----------
  usbaudio: change playback counters to 64 bit

With stereo playback, they need about 375 minutes of continuous audio
playback to overflow, which is usually not a problem (as stopping and
later resuming playback resets the counters).  But with 7.1 audio, they
only need about 95 minutes to overflow.

After the overflow, the buf->prod % USBAUDIO_PACKET_SIZE(channels)
assertion no longer holds true, which will result in overflowing the
buffer.  With 64 bit variables, it would take about 762000 years to
overflow.

Signed-off-by: Kővágó, Zoltán <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 0cf13e367a99dd1abefc46ec94b4c1a80c678f61
      
https://github.com/qemu/qemu/commit/0cf13e367a99dd1abefc46ec94b4c1a80c678f61
  Author: Kővágó, Zoltán <address@hidden>
  Date:   2019-10-18 (Fri, 18 Oct 2019)

  Changed paths:
    M audio/paaudio.c

  Log Message:
  -----------
  paaudio: fix channel order for usb-audio 5.1 and 7.1 streams

Signed-off-by: Kővágó, Zoltán <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: e9d42461920f6f40f4d847a5ba18e90d095ed0b9
      
https://github.com/qemu/qemu/commit/e9d42461920f6f40f4d847a5ba18e90d095ed0b9
  Author: Peter Maydell <address@hidden>
  Date:   2019-10-18 (Fri, 18 Oct 2019)

  Changed paths:
    M audio/alsaaudio.c
    M audio/audio.c
    M audio/audio.h
    M audio/audio_int.h
    M audio/audio_template.h
    M audio/coreaudio.c
    M audio/dsound_template.h
    M audio/dsoundaudio.c
    M audio/noaudio.c
    M audio/ossaudio.c
    M audio/paaudio.c
    M audio/spiceaudio.c
    M audio/wavaudio.c
    M hw/usb/dev-audio.c
    M qapi/audio.json
    M qemu-options.hx

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/kraxel/tags/audio-20191018-pull-request' into staging

audio: bugfixes, pa connection and stream naming.
audio: 5.1/7.1 support for alsa, pa and usb-audio.

# gpg: Signature made Fri 18 Oct 2019 08:41:26 BST
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <address@hidden>" [full]
# gpg:                 aka "Gerd Hoffmann <address@hidden>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <address@hidden>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/audio-20191018-pull-request:
  paaudio: fix channel order for usb-audio 5.1 and 7.1 streams
  usbaudio: change playback counters to 64 bit
  usb-audio: support more than two channels of audio
  usb-audio: do not count on avail bytes actually available
  audio: basic support for multichannel audio
  audio: replace shift in audio_pcm_info with bytes_per_frame
  audio: support more than two channels in volume setting
  paaudio: get/put_buffer functions
  audio: make mixeng optional
  audio: add mixing-engine option (documentation)
  audio: paaudio: ability to specify stream name
  audio: paaudio: fix connection and stream name
  audio: fix parameter dereference before NULL check

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/ca32646d4140...e9d42461920f



reply via email to

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