Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/kraxel/tags/audio-20200526-pull…
Browse files Browse the repository at this point in the history
…-request' into staging

audio: add JACK client audiodev.
audio: bugfixes and cleanups.

# gpg: Signature made Tue 26 May 2020 08:56:21 BST
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <[email protected]>" [full]
# gpg:                 aka "Gerd Hoffmann <[email protected]>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <[email protected]>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/audio-20200526-pull-request:
  hw/mips/mips_fulong2e: Remove unused 'audio/audio.h' include
  audio: Let capture_callback handler use const buffer argument
  audio: Let audio_sample_to_uint64() use const samples argument
  audio: fix wavcapture segfault
  audio/mixeng: fix clang 10+ warning
  audio/jack: add JACK client audiodev
  hw/audio/gus: Use AUDIO_HOST_ENDIANNESS definition from 'audio/audio.h'
  es1370: check total frame count against current frame

Signed-off-by: Peter Maydell <[email protected]>
  • Loading branch information
pm215 committed May 26, 2020
2 parents fea8f3e + b3b8a1f commit 8f72c75
Show file tree
Hide file tree
Showing 13 changed files with 763 additions and 22 deletions.
5 changes: 5 additions & 0 deletions audio/Makefile.objs
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,8 @@ common-obj-$(CONFIG_AUDIO_SDL) += sdl.mo
sdl.mo-objs = sdlaudio.o
sdl.mo-cflags := $(SDL_CFLAGS)
sdl.mo-libs := $(SDL_LIBS)

# jack module
common-obj-$(CONFIG_AUDIO_JACK) += jack.mo
jack.mo-objs = jackaudio.o
jack.mo-libs := $(JACK_LIBS)
5 changes: 3 additions & 2 deletions audio/audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ static size_t audio_pcm_sw_read(SWVoiceIn *sw, void *buf, size_t size)
total += isamp;
}

if (!hw->pcm_ops->volume_in) {
if (hw->pcm_ops && !hw->pcm_ops->volume_in) {
mixeng_volume (sw->buf, ret, &sw->vol);
}

Expand Down Expand Up @@ -736,7 +736,7 @@ static size_t audio_pcm_sw_write(SWVoiceOut *sw, void *buf, size_t size)
if (swlim) {
sw->conv (sw->buf, buf, swlim);

if (!sw->hw->pcm_ops->volume_out) {
if (sw->hw->pcm_ops && !sw->hw->pcm_ops->volume_out) {
mixeng_volume (sw->buf, swlim, &sw->vol);
}
}
Expand Down Expand Up @@ -1969,6 +1969,7 @@ void audio_create_pdos(Audiodev *dev)
CASE(ALSA, alsa, Alsa);
CASE(COREAUDIO, coreaudio, Coreaudio);
CASE(DSOUND, dsound, );
CASE(JACK, jack, Jack);
CASE(OSS, oss, Oss);
CASE(PA, pa, Pa);
CASE(SDL, sdl, );
Expand Down
4 changes: 2 additions & 2 deletions audio/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ typedef enum {

struct audio_capture_ops {
void (*notify) (void *opaque, audcnotification_e cmd);
void (*capture) (void *opaque, void *buf, int size);
void (*capture) (void *opaque, const void *buf, int size);
void (*destroy) (void *opaque);
};

Expand Down Expand Up @@ -163,7 +163,7 @@ int wav_start_capture(AudioState *state, CaptureState *s, const char *path,
bool audio_is_cleaning_up(void);
void audio_cleanup(void);

void audio_sample_to_uint64(void *samples, int pos,
void audio_sample_to_uint64(const void *samples, int pos,
uint64_t *left, uint64_t *right);
void audio_sample_from_uint64(void *samples, int pos,
uint64_t left, uint64_t right);
Expand Down
2 changes: 2 additions & 0 deletions audio/audio_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ AudiodevPerDirectionOptions *glue(audio_get_pdo_, TYPE)(Audiodev *dev)
dev->u.coreaudio.TYPE);
case AUDIODEV_DRIVER_DSOUND:
return dev->u.dsound.TYPE;
case AUDIODEV_DRIVER_JACK:
return qapi_AudiodevJackPerDirectionOptions_base(dev->u.jack.TYPE);
case AUDIODEV_DRIVER_OSS:
return qapi_AudiodevOssPerDirectionOptions_base(dev->u.oss.TYPE);
case AUDIODEV_DRIVER_PA:
Expand Down
Loading

0 comments on commit 8f72c75

Please sign in to comment.