--- /dev/null
+build_log
+*.log
+*.pyc
+usr
+opt
+*.o
+*.os
+*.exe
+packages
+binaries
+*.ipk
+*~
#ifdef HAVE_WAVE
{ "wave", alc_wave_init, alc_wave_deinit, alc_wave_probe, EmptyFuncs },
#endif
-#ifdef HAVE_AVSYSTEM
- { "avsystem", alc_avsystem_init, alc_avsystem_deinit, alc_avsystem_probe, EmptyFuncs },
-#endif
-
{ NULL, NULL, NULL, NULL, EmptyFuncs }
};
#undef EmptyFuncs
}
str[sizeof(str)-1] = 0;
#if defined(USE_DLOG)
- SLOG(LOG_WARN, "MMFW_OPENAL", "%s", str);
+ SLOG(LOG_WARN, "MM_OPENAL", "%s", str);
#else
fprintf(LogFile, "%s", str);
#endif
+++ /dev/null
-/**
- * OpenAL cross platform audio library
- * Copyright (C) 1999-2007 by authors.
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- * Or go to http://www.gnu.org/copyleft/lgpl.html
- */
-
-#include "config.h"
-
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <memory.h>
-#include <unistd.h>
-#include <errno.h>
-#include <math.h>
-#include "alMain.h"
-#include "AL/al.h"
-#include "AL/alc.h"
-
-#include <avsystem.h>
-#include <avsys-audio.h>
-#include <audio-session-manager.h>
-#include <mm_session.h>
-#include <mm_session_private.h>
-
-#ifndef SOUND_MIXER_READ
-#define SOUND_MIXER_READ MIXER_READ
-#endif
-#ifndef SOUND_MIXER_WRITE
-#define SOUND_MIXER_WRITE MIXER_WRITE
-#endif
-
-//for debug
-#define LOG_LEVEL_2
-#if defined(LOG_LEVEL_0)
-#define func_in()
-#define func_out()
-#elif defined(LOG_LEVEL_1)
-#define func_in() fprintf(stderr,"<< %s\n", __FUNCTION__)
-#define func_out() fprintf(stderr, ">> %s\n", __FUNCTION__)
-#elif defined(LOG_LEVEL_2)
-#include <dlog.h>
-#define LOG_TAG "MMFW_OPENAL"
-#define func_in() SLOG(LOG_VERBOSE, LOG_TAG, "<< %s\n", __FUNCTION__)
-#define func_out() SLOG(LOG_VERBOSE, LOG_TAG, ">> %s\n", __FUNCTION__)
-#endif
-
-static const ALCchar avsystem_Device[] = "avsystem";
-
-typedef struct {
- avsys_audio_param_t param;
- avsys_handle_t handle;
- int data_size;
- ALubyte *mix_data;
- volatile int killNow;
- ALboolean doCapture;
- ALvoid *thread;
- int asm_handle;
- ASM_sound_events_t asm_event;
-} avsys_data;
-
-
-ASM_cb_result_t
-asm_callback(int handle, ASM_event_sources_t event_src, ASM_sound_commands_t command, unsigned int sound_status, void* cb_data)
-{
- avsys_data *data = (avsys_data*) cb_data;
- ASM_cb_result_t cb_res = ASM_CB_RES_IGNORE;
- if(!data)
- {
- AL_PRINT("asm_callback data is null\n");
- return cb_res;
- }
-
- switch(command)
- {
- case ASM_COMMAND_STOP:
- case ASM_COMMAND_PAUSE:
- if(AVSYS_FAIL(avsys_audio_set_mute(data->handle, AVSYS_AUDIO_MUTE)))
- {
- AL_PRINT("set handle mute failed\n");
- }
- cb_res = ASM_CB_RES_PAUSE;
- break;
- case ASM_COMMAND_PLAY:
- case ASM_COMMAND_RESUME:
- if(AVSYS_FAIL(avsys_audio_set_mute(data->handle, AVSYS_AUDIO_UNMUTE)))
- {
- AL_PRINT("set handle unmute failed\n");
- }
- cb_res = ASM_CB_RES_PLAYING;
- break;
- }
-}
-
-static ALuint AvsysProc(ALvoid *ptr)
-{
- ALCdevice *pDevice = (ALCdevice*)ptr;
- avsys_data *data = (avsys_data*)pDevice->ExtraData;
- ALint remaining = 0;
- ALint wrote;
- ALint lenByte, lenSample;
-
- ALvoid* WritePtr = NULL;
-
- func_in();
- if((ptr == NULL) || (data == NULL))
- {
- AL_PRINT("__thread_input_parameter_is_null\n");
- return 1;
- }
-
- if(data->mix_data == NULL)
- {
- AL_PRINT("____mix_data is null\n");
- return 1;
- }
-
- while(!data->killNow && pDevice->Connected)
- {
- lenByte = data->data_size;
- lenSample = lenByte /FrameSizeFromDevFmt(pDevice->FmtChans, pDevice->FmtType);
- WritePtr = data->mix_data;
-
- aluMixData(pDevice, data->mix_data, lenSample);
-
- while(lenByte > 0 && !data->killNow)
- {
- wrote = avsys_audio_write(data->handle, WritePtr, lenByte);
- if(wrote < 0)
- {
- lenByte =0;
- aluHandleDisconnect(pDevice);
- }
- lenByte -= wrote;
- WritePtr += wrote;
- }
- }
-
- func_out();
- return 0;
-}
-
-static ALuint AvsysCaptureProc(ALvoid *ptr)
-{
- (void)ptr;
- return 0;
-}
-
-static ALCboolean avsystem_open_playback(ALCdevice *device, const ALCchar *deviceName)
-{
- avsys_data *data = NULL;
- int BufferSize =0;
- int result = ALC_TRUE;
-
- func_in();
-
- if(deviceName)
- {
- if(strcmp(deviceName, avsystem_Device) != 0)
- return ALC_FALSE;
- device->szDeviceName = strdup(avsystem_Device);
- }
- else
- device->szDeviceName = strdup(avsystem_Device);
-
-
- data = (avsys_data*)calloc(1, sizeof(avsys_data));
- if(data == NULL)
- goto error;
-
- data->param.mode = AVSYS_AUDIO_MODE_OUTPUT_LOW_LATENCY;
- data->param.priority = AVSYS_AUDIO_PRIORITY_0;
- data->param.channels = ChannelsFromDevFmt(device->FmtChans);;
- data->param.samplerate = device->Frequency;
- data->param.handle_route = 0;
- data->param.vol_type = AVSYS_AUDIO_VOLUME_TYPE_MEDIA;
-
- switch(device->FmtType)
- {
- case DevFmtByte:
- case DevFmtUByte:
- data->param.format = AVSYS_AUDIO_FORMAT_8BIT;
- break;
- case DevFmtUShort:
- device->FmtType = DevFmtShort;
- /* fall-through */
- case DevFmtShort:
- data->param.format = AVSYS_AUDIO_FORMAT_16BIT;
- break;
-#if defined(FORMAT_32)
- case DevFmtFloat:
- data->param.format = AVSYS_AUDIO_FORMAT_32BIT;
- break;
-#endif
- default :
- AL_PRINT("Not supported format\n");
- break;
- }
-
- if(AVSYS_STATE_SUCCESS !=
- avsys_audio_open(&data->param, &data->handle, &BufferSize))
- {
- AL_PRINT("avsys_audio_open() failed\n");
- goto error;
- }
- data->data_size = BufferSize;
- device->ExtraData = data;
-
- func_out();
- return ALC_TRUE;
-
-error:
- if(data != NULL)
- {
- if(data->handle)
- {
- avsys_audio_close(data->handle);
- }
- free(data);
- data = NULL;
- }
-
- return ALC_FALSE;
-
-}
-
-static ALCboolean avsystem_reset_playback(ALCdevice *device)
-{
- avsys_data *data = NULL;
- avsys_audio_volume_t avsys_volume;
- int loaded_volume = 9;
- int sessionType = MM_SESSION_TYPE_SHARE;
- ASM_sound_events_t asm_event = ASM_EVENT_NONE;
- int errorcode = 0;
- func_in();
- if(device == NULL)
- {
- AL_PRINT("input parameter is null [%d][%s]\n", __LINE__,__func__);
- return ALC_FALSE;
- }
- if(device->ExtraData == NULL)
- {
- AL_PRINT("input parameter is null [%d][%s]\n", __LINE__,__func__);
- return ALC_FALSE;
- }
- data = (avsys_data*)device->ExtraData;
-
- // read session type
- if(_mm_session_util_read_type(-1, &sessionType) < 0)
- {
- AL_PRINT("Read Session Type failed. Set default \"Share\" type\n");
- sessionType = MM_SESSION_TYPE_SHARE;
- if(mm_session_init(sessionType) < 0)
- {
- AL_PRINT("mm_session_init() failed\n");
- return ALC_FALSE;
- }
- }
-
- // convert MM_SESSION_TYPE to ASM_EVENT_TYPE
- if(sessionType != MM_SESSION_TYPE_CALL)
- {
- switch(sessionType)
- {
- case MM_SESSION_TYPE_SHARE:
- asm_event = ASM_EVENT_SHARE_OPENAL;
- break;
- case MM_SESSION_TYPE_EXCLUSIVE:
- asm_event = ASM_EVENT_EXCLUSIVE_OPENAL;
- break;
- case MM_SESSION_TYPE_NOTIFY:
- asm_event = ASM_EVENT_NOTIFY;
- break;
- case MM_SESSION_TYPE_ALARM:
- asm_event = ASM_EVENT_ALARM;
- break;
- default:
- AL_PRINT("Unexpected %d\n", sessionType);
- return ALC_FALSE;
- }
- }
-
- data->asm_event = asm_event;
-
-
- data->mix_data = calloc(1, data->data_size);
- if(data->mix_data == NULL)
- {
- AL_PRINT("Memory Allocation failed\n");
- return ALC_FALSE;
- }
- device->UpdateSize = data->data_size /FrameSizeFromDevFmt(device->FmtChans, device->FmtType);
- SetDefaultChannelOrder(device);
-
- // register asm handle
- if(!ASM_register_sound(-1, &data->asm_handle, asm_event, ASM_STATE_PLAYING, asm_callback, data, ASM_RESOURCE_NONE, &errorcode))
- {
- AL_PRINT("ASM_register_sound() failed 0x%x\n", errorcode);
- return ALC_FALSE;
- }
-
- data->thread = StartThread(AvsysProc, device);
- if(data->thread == NULL)
- {
- AL_PRINT("Could not create playback thread\n");
- if(!ASM_unregister_sound(data->asm_handle, asm_event, &errorcode))
- {
- AL_PRINT("ASM_unregister_sound() failed 0x%x\n", errorcode);
- return ALC_FALSE;
- }
- return ALC_FALSE;
- }
- func_out();
- return ALC_TRUE;
-}
-
-static void avsystem_stop_playback(ALCdevice *device)
-{
- int errorcode = 0;
- avsys_data *data = (avsys_data*)device->ExtraData;
- func_in();
- if(data->thread)
- {
- data->killNow = 1;
- StopThread(data->thread);
- AL_PRINT("Thread Stopped\n");
- data->thread = NULL;
- }
-
- free(data->mix_data);
- data->mix_data = NULL;
-
- if(data->asm_event != ASM_EVENT_CALL)
- {
- if(!ASM_unregister_sound(data->asm_handle, data->asm_event, &errorcode))
- {
- AL_PRINT("ASM_unregister failed in avsystem_stop_playback with 0x%x\n", errorcode);
- }
- }
-
- func_out();
-}
-
-static void avsystem_close_playback(ALCdevice *device)
-{
- avsys_data *data = (avsys_data*)device->ExtraData;
-
- func_in();
-
- avsys_audio_close(data->handle);
-
- free(data);
- device->ExtraData = NULL;
-
- func_out();
-}
-
-static ALCboolean avsystem_open_capture(ALCdevice *device, const ALCchar *deviceName, ALCuint frequency, ALCenum format, ALCsizei SampleSize)
-{
- func_in();
- (void)device;
- (void)deviceName;
- func_out();
- return ALC_FALSE;
-}
-
-static void avsystem_close_capture(ALCdevice *device)
-{
- func_in();
- (void)device;
- func_out();
-}
-
-static void avsystem_start_capture(ALCdevice *pDevice)
-{
- func_in();
- (void)pDevice;
- func_out();
-}
-
-static void avsystem_stop_capture(ALCdevice *pDevice)
-{
- func_in();
- (void)pDevice;
- func_out();
-}
-
-static void avsystem_capture_samples(ALCdevice *pDevice, ALCvoid *pBuffer, ALCuint lSamples)
-{
- func_in();
- (void)pDevice;
- (void)pBuffer;
- (void)lSamples;
- func_out();
-}
-
-static ALCuint avsystem_available_samples(ALCdevice *pDevice)
-{
- func_in();
- (void)pDevice;
- return 0;
- func_out();
-}
-
-BackendFuncs avsys_funcs = {
- avsystem_open_playback,
- avsystem_close_playback,
- avsystem_reset_playback,
- avsystem_stop_playback,
- avsystem_open_capture,
- avsystem_close_capture,
- avsystem_start_capture,
- avsystem_stop_capture,
- avsystem_capture_samples,
- avsystem_available_samples,
-};
-
-void alc_avsystem_init(BackendFuncs *func_list)
-{
- func_in();
- *func_list = avsys_funcs;
- func_out();
-}
-
-void alc_avsystem_deinit(void)
-{
- func_in();
- func_out();
-}
-
-void alc_avsystem_probe(int type)
-{
- if(type == DEVICE_PROBE)
- AppendDeviceList(avsystem_Device);
- else if(type == ALL_DEVICE_PROBE)
- AppendAllDeviceList(avsystem_Device);
- else if(type == CAPTURE_DEVICE_PROBE)
- AppendCaptureDeviceList(avsystem_Device);
-
-}
#include <pulse/pulseaudio.h>
+#ifdef USE_ASM_IN_PULSEAUDIO
+#include <audio-session-manager.h>
+#include <mm_session.h>
+#include <mm_error.h>
+
+#endif
+
#if PA_API_VERSION == 11
#define PA_STREAM_ADJUST_LATENCY 0x2000U
#define PA_STREAM_EARLY_REQUESTS 0x4000U
pa_stream *stream;
pa_context *context;
+#ifdef USE_ASM_IN_PULSEAUDIO
+ int asm_handle;
+ ASM_sound_events_t asm_event;
+ int is_mute;
+#endif
} pulse_data;
typedef struct {
continue;
}
- while(len > 0)
+ while(len > 0 && !data->is_mute)
{
size_t newlen = len;
void *buf;
ppa_threaded_mainloop_unlock(data->loop);
aluMixData(Device, buf, newlen/data->frame_size);
-
ppa_threaded_mainloop_lock(data->loop);
ppa_stream_write(data->stream, buf, newlen, free_func, 0, PA_SEEK_RELATIVE);
len -= newlen;
}
} while(Device->Connected && !data->killNow);
ppa_threaded_mainloop_unlock(data->loop);
-
return 0;
}
//}}}
// OpenAL {{{
+
+ASM_cb_result_t asm_callback(int handle, ASM_event_sources_t event_src, ASM_sound_commands_t command, unsigned int sound_status, void* cb_data)
+{
+ ASM_cb_result_t result = ASM_CB_RES_NONE;
+ pulse_data *data = (pulse_data *)cb_data;
+
+ AL_PRINT("eventsrc[%d], command[%d], sound_status[%d], cb_data[%x]", event_src, command, sound_status, cb_data);
+
+ switch(command) {
+ case ASM_COMMAND_RESUME:
+ result = ASM_CB_RES_PLAYING;
+ /* unmute */
+ data->is_mute = 0;
+ AL_PRINT("do un-mute due to event_src[%d]", event_src);
+ break;
+ case ASM_COMMAND_PAUSE:
+ case ASM_COMMAND_STOP:
+ /* mute */
+ data->is_mute = 1;
+ AL_PRINT("do mute due to event_src[%d]", event_src);
+ result = ASM_CB_RES_PAUSE;
+ break;
+ default:
+ break;
+ }
+
+ return result;
+}
+
+static int _get_asm_information(ASM_sound_events_t *type, int *options)
+{
+ int cur_session = MM_SESSION_TYPE_MEDIA;
+ int session_options = 0;
+ int ret = MM_ERROR_NONE;
+ ASM_sound_events_t asm_event;
+
+ if(type == NULL)
+ return MM_ERROR_SOUND_INVALID_POINTER;
+
+ /* read session information */
+ if(_mm_session_util_read_information(-1, &cur_session, &session_options) < 0) {
+ AL_PRINT("Read Session Information failed. Set default \"Media\" type\n");
+ cur_session = MM_SESSION_TYPE_MEDIA;
+ ret = _mm_session_util_write_type(-1, cur_session);
+ if (ret) {
+ AL_PRINT("_mm_session_util_write_type() failed\n");
+ return MM_ERROR_SOUND_INTERNAL;
+ }
+ }
+ /* convert MM_SESSION_TYPE to ASM_EVENT_TYPE */
+ switch (cur_session) {
+ case MM_SESSION_TYPE_MEDIA:
+ case MM_SESSION_TYPE_MEDIA_RECORD:
+ asm_event = ASM_EVENT_MEDIA_OPENAL;
+ AL_PRINT("covert MM_SESSION_TYPE to ASM_EVENT_TYPE success!! %d\n", asm_event);
+ break;
+ default:
+ AL_PRINT("Unexpected %d\n", cur_session);
+ return MM_ERROR_POLICY_RESTRICTED;
+ }
+
+ *type = asm_event;
+ *options = session_options;
+ return MM_ERROR_NONE;
+}
+
static ALCboolean pulse_open_playback(ALCdevice *device, const ALCchar *device_name) //{{{
{
char *pulse_name = NULL;
pa_sample_spec spec;
- pulse_data *data;
+ pulse_data *data = NULL;
+ int session_options = 0;
+ int errorcode = MM_ERROR_NONE;
+
+ if(pulse_open(device, device_name) == ALC_FALSE)
+ return ALC_FALSE;
+
+ data = device->ExtraData;
if(!pulse_load())
return ALC_FALSE;
return ALC_FALSE;
}
- if(pulse_open(device, device_name) == ALC_FALSE)
- return ALC_FALSE;
+#ifdef USE_ASM_IN_PULSEAUDIO
+ /* read session information */
+ errorcode = _get_asm_information(&data->asm_event, &session_options);
+ if (errorcode) {
+ AL_PRINT("_get_asm_information fail");
+ goto fail;
+ }
+ AL_PRINT("get asm info success!!");
+ if(!ASM_register_sound(-1, &data->asm_handle, data->asm_event, ASM_STATE_NONE, asm_callback, data, ASM_RESOURCE_NONE, &errorcode)) {
+ AL_PRINT("failed to ASM_register_sound(), ASM_event(%d), error(%x)\n", data->asm_event, errorcode);
+ goto fail;
+ }
+ AL_PRINT("ASM register sound success!!");
+ if (session_options) {
+ if( !ASM_set_session_option(data->asm_handle, session_options, &errorcode)) {
+ AL_PRINT("ASM_set_session_options() failed, error(%x)\n", errorcode);
+ goto fail;
+ }
+ }
+#endif
- data = device->ExtraData;
ppa_threaded_mainloop_lock(data->loop);
static void pulse_close_playback(ALCdevice *device) //{{{
{
+ int errorcode = MM_ERROR_NONE;
+ pulse_data *data = device->ExtraData;
+
+
+#ifdef USE_ASM_IN_PULSEAUDIO
+ if (data->asm_handle != -1) {
+ if(!ASM_unregister_sound(data->asm_handle, data->asm_event, &errorcode)) {
+ AL_PRINT("failed to ASM_unregister_sound(), asm_handle(%d), asm_event(%d), error(%x)\n", data->asm_handle, data->asm_event, errorcode);
+ }
+ }
+#endif
+
pulse_close(device);
+
} //}}}
static ALCboolean pulse_reset_playback(ALCdevice *device) //{{{
pulse_data *data = device->ExtraData;
pa_stream_flags_t flags = 0;
pa_channel_map chanmap;
+ int errorcode = MM_ERROR_NONE;
ppa_threaded_mainloop_lock(data->loop);
}
SetDefaultWFXChannelOrder(device);
+#ifdef USE_ASM_IN_PULSEAUDIO
+ /* ASM set state to PLAYING */
+ if(!ASM_set_sound_state(data->asm_handle, data->asm_event, ASM_STATE_PLAYING, ASM_RESOURCE_NONE, &errorcode)) {
+ AL_PRINT("failed to ASM_set_sound_state(ASM_STATE_PLAYING), ASM_handle(%d), ASM_event(%d), Error(0x%x)", data->asm_handle, data->asm_event, errorcode);
+ return ALC_FALSE;
+ }
+#endif
+
data->stream = connect_playback_stream(device, flags, &data->attr, &data->spec, &chanmap);
if(!data->stream)
{
static void pulse_stop_playback(ALCdevice *device) //{{{
{
pulse_data *data = device->ExtraData;
+ int errorcode = MM_ERROR_NONE;
if(!data->stream)
return;
ppa_stream_unref(data->stream);
data->stream = NULL;
+#ifdef USE_ASM_IN_PULSEAUDIO
+ if(!ASM_set_sound_state(data->asm_handle, data->asm_event, ASM_STATE_STOP, ASM_RESOURCE_NONE, &errorcode)) {
+ AL_PRINT("failed to ASM_set_sound_state(ASM_STATE_STOP), ASM_handle(%d), ASM_event(%d), Error(0x%x)", data->asm_handle, data->asm_event, errorcode);
+ }
+#endif
+
ppa_threaded_mainloop_unlock(data->loop);
} //}}}
OPTION(PORTAUDIO "Check for PortAudio backend" ON)
OPTION(PULSEAUDIO "Check for PulseAudio backend" ON)
OPTION(WAVE "Enable Wave Writer backend" ON)
-OPTION(AVSYSTEM "Check for Avsystem backend" ON)
OPTION(DLOPEN "Check for the dlopen API for loading optional libs" ON)
SET(HAVE_DSOUND 0)
SET(HAVE_WINMM 0)
SET(HAVE_PORTAUDIO 0)
-SET(HAVE_PULSEAUDIO 0)
+SET(HAVE_PULSEAUDIO 1)
SET(HAVE_WAVE 0)
-SET(HAVE_AVSYSTEM 0)
# Check ALSA backend
IF(ALSA)
ENDIF()
ENDIF()
-# Check PortAudio backend
-IF(PULSEAUDIO)
- CHECK_INCLUDE_FILE(pulse/pulseaudio.h HAVE_PULSE_PULSEAUDIO_H)
- IF(HAVE_PULSE_PULSEAUDIO_H)
- CHECK_SHARED_LIBRARY_EXISTS(pulse pa_context_new 2 "" HAVE_LIBPULSE)
- IF(HAVE_LIBPULSE OR HAVE_DLFCN_H OR WIN32)
- SET(HAVE_PULSEAUDIO 1)
- SET(ALC_OBJS ${ALC_OBJS} Alc/pulseaudio.c)
- IF(HAVE_DLFCN_H OR WIN32)
- SET(BACKENDS "${BACKENDS} PulseAudio,")
- ELSE()
- SET(BACKENDS "${BACKENDS} PulseAudio \(linked\),")
- SET(EXTRA_LIBS pulse ${EXTRA_LIBS})
- ENDIF()
- ENDIF()
- ENDIF()
-ENDIF()
-
# Optionally enable the Wave Writer backend
IF(WAVE)
SET(HAVE_WAVE 1)
SET(BACKENDS "${BACKENDS} WaveFile,")
ENDIF()
-# Check AVSYSTEM backend
-IF(AVSYSTEM)
- CHECK_INCLUDE_FILE(avsystem/avsys-audio.h HAVE_AVSYSTEM_H)
- IF(HAVE_AVSYSTEM_H)
- SET(HAVE_AVSYSTEM 1)
+# Check PULSEAUDIO backend
+IF(PULSEAUDIO)
+ CHECK_INCLUDE_FILE(pulse/pulseaudio.h HAVE_PULSE_PULSEAUDIO_H)
+ IF(HAVE_PULSE_PULSEAUDIO_H)
+ CHECK_SHARED_LIBRARY_EXISTS(pulse pa_context_new 2 "" HAVE_LIBPULSE)
+ SET(HAVE_PULSEAUDIO 1)
INCLUDE(FindPkgConfig)
- pkg_check_modules(REQ_PKGS REQUIRED avsysaudio mm-session audio-session-mgr)
+ pkg_check_modules(REQ_PKGS REQUIRED libpulse mm-session audio-session-mgr)
FOREACH(flag ${REQ_PKGS_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
FOREACH(flag ${REQ_PKGS_LDFLAGS})
SET(EXTRA_LIBS "${EXTRA_LIBS} ${flag}")
ENDFOREACH(flag)
- SET(EXTRA_LIBS avsysaudio mmfsession audio-session-mgr vconf ${EXTRA_LIBS})
- SET(ALC_OBJS ${ALC_OBJS} Alc/avsystem.c)
- SET(BACKENDS "${BACKENDS} AVSYSTEM,")
+ SET(ALC_OBJS ${ALC_OBJS} Alc/pulseaudio.c)
+ SET(BACKENDS "${BACKENDS} PulseAudio,")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
ENDIF()
ENDIF()
MESSAGE(STATUS "")
ENDIF()
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -pie")
+
IF(UTILS)
ADD_EXECUTABLE(openal-info utils/openal-info.c)
TARGET_LINK_LIBRARIES(openal-info ${LIBNAME})
void alc_null_deinit(void);
void alc_null_probe(int type);
-/*- * avsystem porting- */
-void alc_avsystem_init(BackendFuncs *func_list);
-void alc_avsystem_deinit(void);
-void alc_avsystem_probe(int type);
-
-
typedef struct UIntMap {
struct {
ALuint key;
#include "alu.h"
#include "AL/al.h"
+
#ifdef __cplusplus
extern "C" {
#endif
// Index to itself
ALuint source;
+
} ALsource;
#define ALsource_Update(s,a) ((s)->Update(s,a))
#define LookupFilter(m, k) ((ALfilter*)LookupUIntMapKey(&(m), (k)))
#define LookupEffectSlot(m, k) ((ALeffectslot*)LookupUIntMapKey(&(m), (k)))
+
+
+
AL_API ALvoid AL_APIENTRY alGenSources(ALsizei n,ALuint *sources)
{
ALCcontext *Context;
# followed by all other available backends, while 'oss' will list OSS only).
# An empty list means the default.
#drivers = pulse,alsa,oss,solaris,dsound,winmm,port,wave
-drivers = avsystem
+drivers = pulse
## excludefx:
# Sets which effects to exclude, preventing apps from using them. This can
# backend from opening, even when explicitly requested.
# THIS WILL OVERWRITE EXISTING FILES WITHOUT QUESTION!
#file =
-
-[avsystem]
-device = avsystem_playback
/* Define if we have the Wave Writer backend */
#cmakedefine HAVE_WAVE
-/* Define if we have the AVSYSTEM backend */
-#cmakedefine HAVE_AVSYSTEM
-
/* Define if we have dlfcn.h */
#cmakedefine HAVE_DLFCN_H
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_" />
+ </request>
+ <define>
+ <domain name="openal-soft" />
+ </define>
+ <assign>
+ <filesystem path="/usr/bin/openal-info" exec_label="none"/>
+ </assign>
+</manifest>
Name: openal-soft
Summary: OpenAL library software implementation
Version: 1.13
-Release: 5
+Release: 16
Group: Multimedia/openal-soft
-License: LGPLv2+
+License: LGPL-2.0+
Source0: %{name}-%{version}.tar.gz
BuildRequires: cmake
-BuildRequires: pkgconfig(avsysaudio)
BuildRequires: pkgconfig(mm-session)
+BuildRequires: pkgconfig(libpulse)
BuildRequires: pkgconfig(audio-session-mgr)
BuildRequires: pkgconfig(vconf)
Requires(post): /sbin/ldconfig
%build
%ifarch %arm
-export CFLAGS+=" -DARM_ARCH -O3 -ftree-vectorize -ffast-math -fsingle-precision-constant -DUSE_DLOG "
+export CFLAGS+=" -DARM_ARCH -O3 -ftree-vectorize -ffast-math -fsingle-precision-constant -DUSE_ASM_IN_PULSEAUDIO -DUSE_DLOG "
%else
-export CFLAGS+=" -DI386_ARCH "
+export CFLAGS+=" -DI386_ARCH -DUSE_ASM_IN_PULSEAUDIO "
%endif
cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
%install
rm -rf %{buildroot}
+mkdir -p %{buildroot}/usr/share/license
+cp COPYING %{buildroot}/usr/share/license/%{name}
%make_install
%files
+%manifest openal-soft.manifest
%{_libdir}/*.so*
%{_bindir}/*
/etc/openal/alsoft.conf
+/usr/share/license/%{name}
%files devel
%{_includedir}/*