<commit_before>/**
 * \file pcm/pcm_dmix.c
 * \ingroup PCM_Plugins
 * \brief PCM Direct Stream Mixing (dmix) Plugin Interface
 * \author <NAME> <<EMAIL>>
 * \date 2002
 */
/*
 *  PCM - Direct Stream Mixing
 *  Copyright (c) 2000 by <NAME> <<EMAIL>>
 *
 *
 *   This library is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Lesser General Public License as
 *   published by the Free Software Foundation; either version 2.1 of
 *   the License, or (at your option) any later version.
 *
 *   This program 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 Lesser General Public License for more details.
 *
 *   You should have received a copy of the GNU Lesser 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
 *
 */
  
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/shm.h>
#include <sys/sem.h>
#include <sys/wait.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/mman.h>
#include "pcm_local.h"
#include "../control/control_local.h"

#ifndef PIC
/* entry for static linking */
const char *_snd_module_pcm_dmix = "";
#endif

/*
 *
 */
 
 
/*
 * FIXME:
 *  add possibility to use futexes here
 */
#define DMIX_IPC_SEMS		1
#define DMIX_IPC_SEM_CLIENT	0

/*
 *
 */
 
int snd_timer_async(snd_timer_t *timer, int sig, pid_t pid);
struct timespec snd_pcm_hw_fast_tstamp(snd_pcm_t *pcm);

typedef void (mix_areas1_t)(unsigned int size,
			volatile signed short *dst, signed short *src,
			volatile signed int *sum, unsigned int dst_step,
			unsigned int src_step, unsigned int sum_step);

typedef void (mix_areas2_t)(unsigned int size,
			volatile signed int *dst, signed int *src,
			volatile signed int *sum, unsigned int dst_step,
			unsigned int src_step, unsigned int sum_step);

/*
 *
 */

struct slave_params {
	snd_pcm_format_t format;
	int rate;
	int channels;
	int period_time;
	int buffer_time;
	snd_pcm_sframes_t period_size;
	snd_pcm_sframes_t buffer_size;
	int periods;
};

typedef struct {
	int owners;		/* count of all owners */
	char socket_name[256];	/* name of communication socket */
	snd_pcm_type_t type;	/* PCM type (currently only hw) */
	snd_pcm_hw_params_t hw_params;
	snd_pcm_sw_params_t sw_params;
	struct {
		snd_pcm_uframes_t buffer_size;
		snd_pcm_uframes_t boundary;
		snd_pcm_uframes_t channels;
		unsigned int sample_bits;
		unsigned int rate;
		snd_pcm_format_t format;
	} s;
} snd_pcm_dmix_share_t;

typedef struct {
	key_t ipc_key;	/* IPC key for semaphore and memory */
	int semid;	/* IPC global semaphore identification */
	int shmid;	/* IPC global shared memory identification */
	int shmid_sum;	/* IPC global sum ring buffer memory identification */<commit_msg>Removed unused variable<commit_after>/**
 * \file pcm/pcm_dmix.c
 * \ingroup PCM_Plugins
 * \brief PCM Direct Stream Mixing (dmix) Plugin Interface
 * \author <NAME> <<EMAIL>>
 * \date 2003
 */
/*
 *  PCM - Direct Stream Mixing
 *  Copyright (c) 2003 by <NAME> <<EMAIL>>
 *
 *
 *   This library is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Lesser General Public License as
 *   published by the Free Software Foundation; either version 2.1 of
 *   the License, or (at your option) any later version.
 *
 *   This program 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 Lesser General Public License for more details.
 *
 *   You should have received a copy of the GNU Lesser 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
 *
 */
  
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/shm.h>
#include <sys/sem.h>
#include <sys/wait.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/mman.h>
#include "pcm_local.h"
#include "../control/control_local.h"

#ifndef PIC
/* entry for static linking */
const char *_snd_module_pcm_dmix = "";
#endif

/*
 *
 */
 
 
/*
 * FIXME:
 *  add possibility to use futexes here
 */
#define DMIX_IPC_SEMS		1
#define DMIX_IPC_SEM_CLIENT	0

/*
 *
 */
 
int snd_timer_async(snd_timer_t *timer, int sig, pid_t pid);
struct timespec snd_pcm_hw_fast_tstamp(snd_pcm_t *pcm);

typedef void (mix_areas1_t)(unsigned int size,
			volatile signed short *dst, signed short *src,
			volatile signed int *sum, unsigned int dst_step,
			unsigned int src_step, unsigned int sum_step);

typedef void (mix_areas2_t)(unsigned int size,
			volatile signed int *dst, signed int *src,
			volatile signed int *sum, unsigned int dst_step,
			unsigned int src_step, unsigned int sum_step);

/*
 *
 */

struct slave_params {
	snd_pcm_format_t format;
	int rate;
	int channels;
	int period_time;
	int buffer_time;
	snd_pcm_sframes_t period_size;
	snd_pcm_sframes_t buffer_size;
	int periods;
};

typedef struct {
	char socket_name[256];	/* name of communication socket */
	snd_pcm_type_t type;	/* PCM type (currently only hw) */
	snd_pcm_hw_params_t hw_params;
	snd_pcm_sw_params_t sw_params;
	struct {
		snd_pcm_uframes_t buffer_size;
		snd_pcm_uframes_t boundary;
		snd_pcm_uframes_t channels;
		unsigned int sample_bits;
		unsigned int rate;
		snd_pcm_format_t format;
	} s;
} snd_pcm_dmix_share_t;

typedef struct {
	key_t ipc_key;	/* IPC key for semaphore and memory */
	int semid;	/* IPC global semaphore identification */
	int shmid;	/* IPC global shared memory identification */
	int shmid_sum;	/* IPC global sum ring buffer memory identification */
{'fraction_non_alphanumeric': 0.09717198290036172, 'fraction_numerical': 0.010194015126603092, 'mean_word_length': 3.941510966693745, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1412836', 'n_tokens_mistral': 2199, 'n_tokens_neox': 2074, 'n_words': 704}