skypopen: performance improvements in skypopen_protocol.c and alsa/dummy.c . Added pcm*c to alsa/. Let's hope the larger period in dummy.c does not make problems on ubuntu
This commit is contained in:
parent
df52cc0952
commit
4706d3946d
|
@ -18,7 +18,6 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//#include <sound/driver.h> //giova
|
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/err.h>
|
#include <linux/err.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
|
@ -67,7 +66,7 @@ MODULE_SUPPORTED_DEVICE("{{ALSA,Dummy soundcard}}");
|
||||||
#define USE_CHANNELS_MAX 2
|
#define USE_CHANNELS_MAX 2
|
||||||
#endif
|
#endif
|
||||||
#ifndef USE_PERIODS_MIN
|
#ifndef USE_PERIODS_MIN
|
||||||
#define USE_PERIODS_MIN 1
|
#define USE_PERIODS_MIN 10
|
||||||
#endif
|
#endif
|
||||||
#ifndef USE_PERIODS_MAX
|
#ifndef USE_PERIODS_MAX
|
||||||
#define USE_PERIODS_MAX 1024
|
#define USE_PERIODS_MAX 1024
|
||||||
|
@ -98,17 +97,17 @@ module_param_array(pcm_substreams, int, NULL, 0444);
|
||||||
MODULE_PARM_DESC(pcm_substreams, "PCM substreams # (1-64) for dummy driver.");
|
MODULE_PARM_DESC(pcm_substreams, "PCM substreams # (1-64) for dummy driver.");
|
||||||
|
|
||||||
static struct platform_device *devices[SNDRV_CARDS];
|
static struct platform_device *devices[SNDRV_CARDS];
|
||||||
static struct timer_list giovatimer;
|
static struct timer_list dummytimer;
|
||||||
static int giovastarted = 0;
|
static int dummystarted = 0;
|
||||||
static int giovaindex = 0;
|
static int dummyindex = 0;
|
||||||
static spinlock_t giovalock;
|
static spinlock_t dummylock;
|
||||||
struct giovadpcm {
|
struct dummydpcm {
|
||||||
struct snd_pcm_substream *substream;
|
struct snd_pcm_substream *substream;
|
||||||
struct snd_dummy_pcm *dpcm;
|
struct snd_dummy_pcm *dpcm;
|
||||||
int started;
|
int started;
|
||||||
int elapsed;
|
int elapsed;
|
||||||
};
|
};
|
||||||
static struct giovadpcm giovadpcms[MAX_PCM_SUBSTREAMS];
|
static struct dummydpcm dummydpcms[MAX_PCM_SUBSTREAMS];
|
||||||
|
|
||||||
#define MIXER_ADDR_MASTER 0
|
#define MIXER_ADDR_MASTER 0
|
||||||
#define MIXER_ADDR_LINE 1
|
#define MIXER_ADDR_LINE 1
|
||||||
|
@ -145,19 +144,19 @@ static inline void snd_card_dummy_pcm_timer_start(struct snd_dummy_pcm *dpcm)
|
||||||
int i;
|
int i;
|
||||||
int found = 0;
|
int found = 0;
|
||||||
|
|
||||||
for (i = 0; i < giovaindex + 1; i++) {
|
for (i = 0; i < dummyindex + 1; i++) {
|
||||||
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
|
//if (i > MAX_PCM_SUBSTREAMS || dummyindex > MAX_PCM_SUBSTREAMS) {
|
||||||
printk("giova, %s:%d, i=%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, i, giovaindex, dpcm);
|
//printk("dummy, %s:%d, i=%d, dummyindex=%d dpcm=%p\n", __FILE__, __LINE__, i, dummyindex, dpcm);
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (giovadpcms[i].dpcm == dpcm) {
|
if (dummydpcms[i].dpcm == dpcm) {
|
||||||
giovadpcms[i].started = 1;
|
dummydpcms[i].started = 1;
|
||||||
found = 1;
|
found = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found) {
|
//if (!found) {
|
||||||
printk("skypopen: start, NOT found?\n");
|
//printk("skypopen: start, NOT found?\n");
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void snd_card_dummy_pcm_timer_stop(struct snd_dummy_pcm *dpcm)
|
static inline void snd_card_dummy_pcm_timer_stop(struct snd_dummy_pcm *dpcm)
|
||||||
|
@ -165,14 +164,14 @@ static inline void snd_card_dummy_pcm_timer_stop(struct snd_dummy_pcm *dpcm)
|
||||||
int i;
|
int i;
|
||||||
int found = 0;
|
int found = 0;
|
||||||
|
|
||||||
for (i = 0; i < giovaindex + 1; i++) {
|
for (i = 0; i < dummyindex + 1; i++) {
|
||||||
|
|
||||||
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
|
//if (i > MAX_PCM_SUBSTREAMS || dummyindex > MAX_PCM_SUBSTREAMS) {
|
||||||
printk("giova, %s:%d, i=%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, i, giovaindex, dpcm);
|
//printk("dummy, %s:%d, i=%d, dummyindex=%d dpcm=%p\n", __FILE__, __LINE__, i, dummyindex, dpcm);
|
||||||
}
|
//}
|
||||||
if (giovadpcms[i].dpcm == dpcm) {
|
if (dummydpcms[i].dpcm == dpcm) {
|
||||||
giovadpcms[i].started = 0;
|
dummydpcms[i].started = 0;
|
||||||
giovadpcms[i].elapsed = 0;
|
dummydpcms[i].elapsed = 0;
|
||||||
found = 1;
|
found = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -187,7 +186,7 @@ static int snd_card_dummy_pcm_trigger(struct snd_pcm_substream *substream, int c
|
||||||
struct snd_dummy_pcm *dpcm = runtime->private_data;
|
struct snd_dummy_pcm *dpcm = runtime->private_data;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
spin_lock_bh(&giovalock);
|
spin_lock_bh(&dummylock);
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case SNDRV_PCM_TRIGGER_START:
|
case SNDRV_PCM_TRIGGER_START:
|
||||||
case SNDRV_PCM_TRIGGER_RESUME:
|
case SNDRV_PCM_TRIGGER_RESUME:
|
||||||
|
@ -201,7 +200,7 @@ static int snd_card_dummy_pcm_trigger(struct snd_pcm_substream *substream, int c
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
spin_unlock_bh(&giovalock);
|
spin_unlock_bh(&dummylock);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,22 +232,26 @@ static void snd_card_dummy_pcm_timer_function(unsigned long data)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
||||||
giovatimer.expires = 1 + jiffies;
|
dummytimer.expires = 1 + jiffies;
|
||||||
add_timer(&giovatimer);
|
add_timer(&dummytimer);
|
||||||
|
|
||||||
//spin_lock_bh(&giovalock);
|
//spin_lock_bh(&dummylock);
|
||||||
for (i = 0; i < giovaindex + 1; i++) {
|
for (i = 0; i < dummyindex + 1; i++) {
|
||||||
|
|
||||||
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
|
#if 0
|
||||||
printk("giova, %s:%d, i=%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, i, giovaindex, dpcm);
|
if (i > MAX_PCM_SUBSTREAMS || dummyindex > MAX_PCM_SUBSTREAMS) {
|
||||||
|
printk("dummy, %s:%d, i=%d, dummyindex=%d dpcm=%p\n", __FILE__, __LINE__, i, dummyindex, dpcm);
|
||||||
}
|
}
|
||||||
if (giovadpcms[i].started != 1)
|
#endif
|
||||||
|
if (dummydpcms[i].started != 1)
|
||||||
continue;
|
continue;
|
||||||
dpcm = giovadpcms[i].dpcm;
|
dpcm = dummydpcms[i].dpcm;
|
||||||
|
#if 0
|
||||||
if (dpcm == NULL) {
|
if (dpcm == NULL) {
|
||||||
printk("giova: timer_func %d %d NULL: continue\n", __LINE__, i);
|
printk("dummy: timer_func %d %d NULL: continue\n", __LINE__, i);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
//spin_lock_bh(&dpcm->lock);
|
//spin_lock_bh(&dpcm->lock);
|
||||||
dpcm->pcm_irq_pos += dpcm->pcm_bps * 1;
|
dpcm->pcm_irq_pos += dpcm->pcm_bps * 1;
|
||||||
dpcm->pcm_buf_pos += dpcm->pcm_bps * 1;
|
dpcm->pcm_buf_pos += dpcm->pcm_bps * 1;
|
||||||
|
@ -257,27 +260,31 @@ static void snd_card_dummy_pcm_timer_function(unsigned long data)
|
||||||
dpcm->pcm_irq_pos %= dpcm->pcm_period_size * dpcm->pcm_hz;
|
dpcm->pcm_irq_pos %= dpcm->pcm_period_size * dpcm->pcm_hz;
|
||||||
//spin_unlock_bh(&dpcm->lock);
|
//spin_unlock_bh(&dpcm->lock);
|
||||||
//snd_pcm_period_elapsed(dpcm->substream);
|
//snd_pcm_period_elapsed(dpcm->substream);
|
||||||
giovadpcms[i].elapsed = 1;
|
dummydpcms[i].elapsed = 1;
|
||||||
} else {
|
} else {
|
||||||
//spin_unlock_bh(&dpcm->lock);
|
//spin_unlock_bh(&dpcm->lock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//spin_unlock_bh(&giovalock);
|
//spin_unlock_bh(&dummylock);
|
||||||
for (i = 0; i < giovaindex + 1; i++) {
|
for (i = 0; i < dummyindex + 1; i++) {
|
||||||
|
|
||||||
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
|
#if 0
|
||||||
printk("giova, %s:%d, i=%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, i, giovaindex, dpcm);
|
if (i > MAX_PCM_SUBSTREAMS || dummyindex > MAX_PCM_SUBSTREAMS) {
|
||||||
|
printk("dummy, %s:%d, i=%d, dummyindex=%d dpcm=%p\n", __FILE__, __LINE__, i, dummyindex, dpcm);
|
||||||
}
|
}
|
||||||
if (giovadpcms[i].started != 1)
|
#endif
|
||||||
|
if (dummydpcms[i].started != 1)
|
||||||
continue;
|
continue;
|
||||||
dpcm = giovadpcms[i].dpcm;
|
dpcm = dummydpcms[i].dpcm;
|
||||||
|
#if 0
|
||||||
if (dpcm == NULL) {
|
if (dpcm == NULL) {
|
||||||
printk("giova: timer_func %d %d NULL: continue\n", __LINE__, i);
|
printk("dummy: timer_func %d %d NULL: continue\n", __LINE__, i);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (giovadpcms[i].elapsed){
|
#endif
|
||||||
|
if (dummydpcms[i].elapsed){
|
||||||
snd_pcm_period_elapsed(dpcm->substream);
|
snd_pcm_period_elapsed(dpcm->substream);
|
||||||
giovadpcms[i].elapsed = 0;
|
dummydpcms[i].elapsed = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -294,6 +301,7 @@ static snd_pcm_uframes_t snd_card_dummy_pcm_pointer(struct snd_pcm_substream *su
|
||||||
|
|
||||||
static struct snd_pcm_hardware snd_card_dummy_playback = {
|
static struct snd_pcm_hardware snd_card_dummy_playback = {
|
||||||
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_RESUME | SNDRV_PCM_INFO_MMAP_VALID),
|
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_RESUME | SNDRV_PCM_INFO_MMAP_VALID),
|
||||||
|
//.info = (SNDRV_PCM_INFO_INTERLEAVED),
|
||||||
.formats = USE_FORMATS,
|
.formats = USE_FORMATS,
|
||||||
.rates = USE_RATE,
|
.rates = USE_RATE,
|
||||||
.rate_min = USE_RATE_MIN,
|
.rate_min = USE_RATE_MIN,
|
||||||
|
@ -301,7 +309,8 @@ static struct snd_pcm_hardware snd_card_dummy_playback = {
|
||||||
.channels_min = USE_CHANNELS_MIN,
|
.channels_min = USE_CHANNELS_MIN,
|
||||||
.channels_max = USE_CHANNELS_MAX,
|
.channels_max = USE_CHANNELS_MAX,
|
||||||
.buffer_bytes_max = MAX_BUFFER_SIZE,
|
.buffer_bytes_max = MAX_BUFFER_SIZE,
|
||||||
.period_bytes_min = 256,
|
//.period_bytes_min = 256,
|
||||||
|
.period_bytes_min = 2048,
|
||||||
.period_bytes_max = MAX_PERIOD_SIZE,
|
.period_bytes_max = MAX_PERIOD_SIZE,
|
||||||
.periods_min = USE_PERIODS_MIN,
|
.periods_min = USE_PERIODS_MIN,
|
||||||
.periods_max = USE_PERIODS_MAX,
|
.periods_max = USE_PERIODS_MAX,
|
||||||
|
@ -310,6 +319,7 @@ static struct snd_pcm_hardware snd_card_dummy_playback = {
|
||||||
|
|
||||||
static struct snd_pcm_hardware snd_card_dummy_capture = {
|
static struct snd_pcm_hardware snd_card_dummy_capture = {
|
||||||
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_RESUME | SNDRV_PCM_INFO_MMAP_VALID),
|
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_RESUME | SNDRV_PCM_INFO_MMAP_VALID),
|
||||||
|
//.info = (SNDRV_PCM_INFO_INTERLEAVED),
|
||||||
.formats = USE_FORMATS,
|
.formats = USE_FORMATS,
|
||||||
.rates = USE_RATE,
|
.rates = USE_RATE,
|
||||||
.rate_min = USE_RATE_MIN,
|
.rate_min = USE_RATE_MIN,
|
||||||
|
@ -317,7 +327,8 @@ static struct snd_pcm_hardware snd_card_dummy_capture = {
|
||||||
.channels_min = USE_CHANNELS_MIN,
|
.channels_min = USE_CHANNELS_MIN,
|
||||||
.channels_max = USE_CHANNELS_MAX,
|
.channels_max = USE_CHANNELS_MAX,
|
||||||
.buffer_bytes_max = MAX_BUFFER_SIZE,
|
.buffer_bytes_max = MAX_BUFFER_SIZE,
|
||||||
.period_bytes_min = 256,
|
//.period_bytes_min = 256,
|
||||||
|
.period_bytes_min = 2048,
|
||||||
.period_bytes_max = MAX_PERIOD_SIZE,
|
.period_bytes_max = MAX_PERIOD_SIZE,
|
||||||
.periods_min = USE_PERIODS_MIN,
|
.periods_min = USE_PERIODS_MIN,
|
||||||
.periods_max = USE_PERIODS_MAX,
|
.periods_max = USE_PERIODS_MAX,
|
||||||
|
@ -328,21 +339,21 @@ static void snd_card_dummy_runtime_free(struct snd_pcm_runtime *runtime)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
spin_lock_bh(&giovalock);
|
spin_lock_bh(&dummylock);
|
||||||
|
|
||||||
for (i = 0; i < giovaindex; i++) {
|
for (i = 0; i < dummyindex; i++) {
|
||||||
|
|
||||||
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
|
if (i > MAX_PCM_SUBSTREAMS || dummyindex > MAX_PCM_SUBSTREAMS) {
|
||||||
printk("giova, %s:%d, i=%d, giovaindex=%d \n", __FILE__, __LINE__, i, giovaindex);
|
printk("dummy, %s:%d, i=%d, dummyindex=%d \n", __FILE__, __LINE__, i, dummyindex);
|
||||||
}
|
}
|
||||||
if ((giovadpcms[i].dpcm == runtime->private_data)) {
|
if ((dummydpcms[i].dpcm == runtime->private_data)) {
|
||||||
giovadpcms[i].started = 0;
|
dummydpcms[i].started = 0;
|
||||||
giovadpcms[i].elapsed = 0;
|
dummydpcms[i].elapsed = 0;
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_unlock_bh(&giovalock);
|
spin_unlock_bh(&dummylock);
|
||||||
kfree(runtime->private_data);
|
kfree(runtime->private_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -364,20 +375,20 @@ static struct snd_dummy_pcm *new_pcm_stream(struct snd_pcm_substream *substream)
|
||||||
|
|
||||||
dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL);
|
dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL);
|
||||||
if (!dpcm) {
|
if (!dpcm) {
|
||||||
printk("giova, %s:%d, giovaindex=%d NO MEMORY!!!!\n", __FILE__, __LINE__, giovaindex);
|
printk("dummy, %s:%d, dummyindex=%d NO MEMORY!!!!\n", __FILE__, __LINE__, dummyindex);
|
||||||
return dpcm;
|
return dpcm;
|
||||||
}
|
}
|
||||||
//init_timer(&dpcm->timer);
|
//init_timer(&dpcm->timer);
|
||||||
//spin_lock_init(&dpcm->lock);
|
//spin_lock_init(&dpcm->lock);
|
||||||
dpcm->substream = substream;
|
dpcm->substream = substream;
|
||||||
|
|
||||||
spin_lock_bh(&giovalock);
|
spin_lock_bh(&dummylock);
|
||||||
for (i = 0; i < giovaindex; i++) {
|
for (i = 0; i < dummyindex; i++) {
|
||||||
|
|
||||||
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
|
//if (i > MAX_PCM_SUBSTREAMS || dummyindex > MAX_PCM_SUBSTREAMS) {
|
||||||
printk("giova, %s:%d, i=%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, i, giovaindex, dpcm);
|
//printk("dummy, %s:%d, i=%d, dummyindex=%d dpcm=%p\n", __FILE__, __LINE__, i, dummyindex, dpcm);
|
||||||
}
|
//}
|
||||||
if ((giovadpcms[i].substream == substream)) {
|
if ((dummydpcms[i].substream == substream)) {
|
||||||
found = 1;
|
found = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -386,32 +397,32 @@ static struct snd_dummy_pcm *new_pcm_stream(struct snd_pcm_substream *substream)
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
|
|
||||||
giovadpcms[giovaindex].substream = substream;
|
dummydpcms[dummyindex].substream = substream;
|
||||||
giovaindex++;
|
dummyindex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
found = 0;
|
found = 0;
|
||||||
for (i = 0; i < giovaindex; i++) {
|
for (i = 0; i < dummyindex; i++) {
|
||||||
|
|
||||||
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
|
//if (i > MAX_PCM_SUBSTREAMS || dummyindex > MAX_PCM_SUBSTREAMS) {
|
||||||
printk("giova, %s:%d, i=%d, giovaindex=%d dpcm=%p\n", __FILE__, __LINE__, i, giovaindex, dpcm);
|
//printk("dummy, %s:%d, i=%d, dummyindex=%d dpcm=%p\n", __FILE__, __LINE__, i, dummyindex, dpcm);
|
||||||
}
|
//}
|
||||||
if (giovadpcms[i].substream == substream) {
|
if (dummydpcms[i].substream == substream) {
|
||||||
giovadpcms[i].dpcm = dpcm;
|
dummydpcms[i].dpcm = dpcm;
|
||||||
giovadpcms[i].started = 0;
|
dummydpcms[i].started = 0;
|
||||||
giovadpcms[i].elapsed = 0;
|
dummydpcms[i].elapsed = 0;
|
||||||
found = 1;
|
found = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_unlock_bh(&giovalock);
|
spin_unlock_bh(&dummylock);
|
||||||
if (!found) {
|
//if (!found) {
|
||||||
printk("skypopen giovaindex=%d NOT found????\n", giovaindex);
|
//printk("skypopen dummyindex=%d NOT found????\n", dummyindex);
|
||||||
}
|
//}
|
||||||
return dpcm;
|
return dpcm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -542,7 +553,7 @@ static int snd_dummy_volume_get(struct snd_kcontrol *kcontrol, struct snd_ctl_el
|
||||||
int addr = kcontrol->private_value;
|
int addr = kcontrol->private_value;
|
||||||
|
|
||||||
if (in_irq())
|
if (in_irq())
|
||||||
printk("giova: line %d we are in HARDWARE IRQ\n", __LINE__);
|
printk("dummy: line %d we are in HARDWARE IRQ\n", __LINE__);
|
||||||
spin_lock_bh(&dummy->mixer_lock);
|
spin_lock_bh(&dummy->mixer_lock);
|
||||||
ucontrol->value.integer.value[0] = dummy->mixer_volume[addr][0];
|
ucontrol->value.integer.value[0] = dummy->mixer_volume[addr][0];
|
||||||
ucontrol->value.integer.value[1] = dummy->mixer_volume[addr][1];
|
ucontrol->value.integer.value[1] = dummy->mixer_volume[addr][1];
|
||||||
|
@ -557,7 +568,7 @@ static int snd_dummy_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_el
|
||||||
int left, right;
|
int left, right;
|
||||||
|
|
||||||
if (in_irq())
|
if (in_irq())
|
||||||
printk("giova: line %d we are in HARDWARE IRQ\n", __LINE__);
|
printk("dummy: line %d we are in HARDWARE IRQ\n", __LINE__);
|
||||||
left = ucontrol->value.integer.value[0];
|
left = ucontrol->value.integer.value[0];
|
||||||
if (left < -50)
|
if (left < -50)
|
||||||
left = -50;
|
left = -50;
|
||||||
|
@ -592,7 +603,7 @@ static int snd_dummy_capsrc_get(struct snd_kcontrol *kcontrol, struct snd_ctl_el
|
||||||
int addr = kcontrol->private_value;
|
int addr = kcontrol->private_value;
|
||||||
|
|
||||||
if (in_irq())
|
if (in_irq())
|
||||||
printk("giova: line %d we are in HARDWARE IRQ\n", __LINE__);
|
printk("dummy: line %d we are in HARDWARE IRQ\n", __LINE__);
|
||||||
spin_lock_bh(&dummy->mixer_lock);
|
spin_lock_bh(&dummy->mixer_lock);
|
||||||
ucontrol->value.integer.value[0] = dummy->capture_source[addr][0];
|
ucontrol->value.integer.value[0] = dummy->capture_source[addr][0];
|
||||||
ucontrol->value.integer.value[1] = dummy->capture_source[addr][1];
|
ucontrol->value.integer.value[1] = dummy->capture_source[addr][1];
|
||||||
|
@ -607,7 +618,7 @@ static int snd_dummy_capsrc_put(struct snd_kcontrol *kcontrol, struct snd_ctl_el
|
||||||
int left, right;
|
int left, right;
|
||||||
|
|
||||||
if (in_irq())
|
if (in_irq())
|
||||||
printk("giova: line %d we are in HARDWARE IRQ\n", __LINE__);
|
printk("dummy: line %d we are in HARDWARE IRQ\n", __LINE__);
|
||||||
left = ucontrol->value.integer.value[0] & 1;
|
left = ucontrol->value.integer.value[0] & 1;
|
||||||
right = ucontrol->value.integer.value[1] & 1;
|
right = ucontrol->value.integer.value[1] & 1;
|
||||||
spin_lock_bh(&dummy->mixer_lock);
|
spin_lock_bh(&dummy->mixer_lock);
|
||||||
|
@ -637,9 +648,9 @@ static int __devinit snd_card_dummy_new_mixer(struct snd_dummy *dummy)
|
||||||
unsigned int idx;
|
unsigned int idx;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
return 0; //XXX no mixer
|
||||||
spin_lock_init(&dummy->mixer_lock);
|
spin_lock_init(&dummy->mixer_lock);
|
||||||
strcpy(card->mixername, "Dummy Mixer");
|
strcpy(card->mixername, "Dummy Mixer");
|
||||||
return 0; //giova no mixer
|
|
||||||
|
|
||||||
for (idx = 0; idx < ARRAY_SIZE(snd_dummy_controls); idx++) {
|
for (idx = 0; idx < ARRAY_SIZE(snd_dummy_controls); idx++) {
|
||||||
err = snd_ctl_add(card, snd_ctl_new1(&snd_dummy_controls[idx], dummy));
|
err = snd_ctl_add(card, snd_ctl_new1(&snd_dummy_controls[idx], dummy));
|
||||||
|
@ -656,10 +667,6 @@ static int __devinit snd_dummy_probe(struct platform_device *devptr)
|
||||||
int idx, err;
|
int idx, err;
|
||||||
int dev = devptr->id;
|
int dev = devptr->id;
|
||||||
|
|
||||||
//card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(struct snd_dummy)); //giova if this gives you problems, comment it out and remove comment from the 4 lines commented below
|
|
||||||
//if (card == NULL) //giova if this gives you problems, comment it out and remove comment from the 4 lines commented below
|
|
||||||
//return -ENOMEM; //giova if this gives you problems, comment it out and remove comment from the 4 lines commented below
|
|
||||||
|
|
||||||
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
|
||||||
sizeof(struct snd_dummy), &card);
|
sizeof(struct snd_dummy), &card);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
|
@ -676,9 +683,9 @@ static int __devinit snd_dummy_probe(struct platform_device *devptr)
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto __nodev;
|
goto __nodev;
|
||||||
}
|
}
|
||||||
err = snd_card_dummy_new_mixer(dummy);
|
//err = snd_card_dummy_new_mixer(dummy);
|
||||||
if (err < 0)
|
//if (err < 0)
|
||||||
goto __nodev;
|
//goto __nodev;
|
||||||
strcpy(card->driver, "Dummy");
|
strcpy(card->driver, "Dummy");
|
||||||
strcpy(card->shortname, "Dummy");
|
strcpy(card->shortname, "Dummy");
|
||||||
sprintf(card->longname, "Dummy %i", dev + 1);
|
sprintf(card->longname, "Dummy %i", dev + 1);
|
||||||
|
@ -698,7 +705,7 @@ static int __devinit snd_dummy_probe(struct platform_device *devptr)
|
||||||
static int __devexit snd_dummy_remove(struct platform_device *devptr)
|
static int __devexit snd_dummy_remove(struct platform_device *devptr)
|
||||||
{
|
{
|
||||||
|
|
||||||
del_timer(&giovatimer);
|
del_timer(&dummytimer);
|
||||||
snd_card_free(platform_get_drvdata(devptr));
|
snd_card_free(platform_get_drvdata(devptr));
|
||||||
platform_set_drvdata(devptr, NULL);
|
platform_set_drvdata(devptr, NULL);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -754,28 +761,28 @@ static int __init alsa_card_dummy_init(void)
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
if (!giovastarted) {
|
if (!dummystarted) {
|
||||||
giovastarted = 1;
|
dummystarted = 1;
|
||||||
spin_lock_init(&giovalock);
|
spin_lock_init(&dummylock);
|
||||||
|
|
||||||
spin_lock_bh(&giovalock);
|
spin_lock_bh(&dummylock);
|
||||||
for (i = 0; i < MAX_PCM_SUBSTREAMS; i++) {
|
for (i = 0; i < MAX_PCM_SUBSTREAMS; i++) {
|
||||||
|
|
||||||
if (i > MAX_PCM_SUBSTREAMS || giovaindex > MAX_PCM_SUBSTREAMS) {
|
//if (i > MAX_PCM_SUBSTREAMS || dummyindex > MAX_PCM_SUBSTREAMS) {
|
||||||
printk("giova, %s:%d, i=%d, giovaindex=%d \n", __FILE__, __LINE__, i, giovaindex);
|
//printk("dummy, %s:%d, i=%d, dummyindex=%d \n", __FILE__, __LINE__, i, dummyindex);
|
||||||
}
|
//}
|
||||||
giovadpcms[i].substream = NULL;
|
dummydpcms[i].substream = NULL;
|
||||||
giovadpcms[i].dpcm = NULL;
|
dummydpcms[i].dpcm = NULL;
|
||||||
giovadpcms[i].started = 0;
|
dummydpcms[i].started = 0;
|
||||||
giovadpcms[i].elapsed = 0;
|
dummydpcms[i].elapsed = 0;
|
||||||
}
|
}
|
||||||
init_timer(&giovatimer);
|
init_timer(&dummytimer);
|
||||||
giovatimer.data = (unsigned long) &giovadpcms;
|
dummytimer.data = (unsigned long) &dummydpcms;
|
||||||
giovatimer.function = snd_card_dummy_pcm_timer_function;
|
dummytimer.function = snd_card_dummy_pcm_timer_function;
|
||||||
giovatimer.expires = 1 + jiffies;
|
dummytimer.expires = 1 + jiffies;
|
||||||
add_timer(&giovatimer);
|
add_timer(&dummytimer);
|
||||||
printk("snd-dummy skypopen driver version: 6, %s:%d working on a machine with %dHZ kernel\n", __FILE__, __LINE__, HZ);
|
printk("snd-dummy skypopen driver version: 9, %s:%d working on a machine with %dHZ kernel\n", __FILE__, __LINE__, HZ);
|
||||||
spin_unlock_bh(&giovalock);
|
spin_unlock_bh(&dummylock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -806,7 +813,7 @@ static int __init alsa_card_dummy_init(void)
|
||||||
|
|
||||||
static void __exit alsa_card_dummy_exit(void)
|
static void __exit alsa_card_dummy_exit(void)
|
||||||
{
|
{
|
||||||
del_timer(&giovatimer);
|
del_timer(&dummytimer);
|
||||||
snd_dummy_unregister_all();
|
snd_dummy_unregister_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -177,7 +177,7 @@ int skypopen_signaling_read(private_t *tech_pvt)
|
||||||
if (tech_pvt->silent_mode) {
|
if (tech_pvt->silent_mode) {
|
||||||
DEBUGA_SKYPE("Resetting SILENT_MODE on skype_call: %s.\n", SKYPOPEN_P_LOG, id);
|
DEBUGA_SKYPE("Resetting SILENT_MODE on skype_call: %s.\n", SKYPOPEN_P_LOG, id);
|
||||||
skypopen_signaling_write(tech_pvt, "SET SILENT_MODE ON");
|
skypopen_signaling_write(tech_pvt, "SET SILENT_MODE ON");
|
||||||
switch_sleep(1000);
|
//switch_sleep(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!strcasecmp(message, "ERROR 68")) {
|
if (!strcasecmp(message, "ERROR 68")) {
|
||||||
|
@ -403,13 +403,13 @@ int skypopen_signaling_read(private_t *tech_pvt)
|
||||||
tech_pvt->chatmessages[i].type, tech_pvt->chatmessages[i].id);
|
tech_pvt->chatmessages[i].type, tech_pvt->chatmessages[i].id);
|
||||||
sprintf(msg_to_skype, "GET CHATMESSAGE %s CHATNAME", id);
|
sprintf(msg_to_skype, "GET CHATMESSAGE %s CHATNAME", id);
|
||||||
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
||||||
skypopen_sleep(1000);
|
//skypopen_sleep(1000);
|
||||||
sprintf(msg_to_skype, "GET CHATMESSAGE %s FROM_HANDLE", id);
|
sprintf(msg_to_skype, "GET CHATMESSAGE %s FROM_HANDLE", id);
|
||||||
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
||||||
skypopen_sleep(1000);
|
//skypopen_sleep(1000);
|
||||||
sprintf(msg_to_skype, "GET CHATMESSAGE %s FROM_DISPNAME", id);
|
sprintf(msg_to_skype, "GET CHATMESSAGE %s FROM_DISPNAME", id);
|
||||||
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
||||||
skypopen_sleep(1000);
|
//skypopen_sleep(1000);
|
||||||
sprintf(msg_to_skype, "GET CHATMESSAGE %s BODY", id);
|
sprintf(msg_to_skype, "GET CHATMESSAGE %s BODY", id);
|
||||||
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
||||||
}
|
}
|
||||||
|
@ -576,7 +576,7 @@ int skypopen_signaling_read(private_t *tech_pvt)
|
||||||
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
||||||
sprintf(msg_to_skype, "ALTER CALL %s HANGUP", id);
|
sprintf(msg_to_skype, "ALTER CALL %s HANGUP", id);
|
||||||
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
||||||
skypopen_sleep(10000);
|
//skypopen_sleep(10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcasecmp(prop, "STATUS")) {
|
if (!strcasecmp(prop, "STATUS")) {
|
||||||
|
@ -592,10 +592,10 @@ int skypopen_signaling_read(private_t *tech_pvt)
|
||||||
SKYPOPEN_P_LOG, id);
|
SKYPOPEN_P_LOG, id);
|
||||||
sprintf(msg_to_skype, "GET CALL %s PARTNER_DISPNAME", id);
|
sprintf(msg_to_skype, "GET CALL %s PARTNER_DISPNAME", id);
|
||||||
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
||||||
skypopen_sleep(100);
|
//skypopen_sleep(100);
|
||||||
sprintf(msg_to_skype, "GET CALL %s PARTNER_HANDLE", id);
|
sprintf(msg_to_skype, "GET CALL %s PARTNER_HANDLE", id);
|
||||||
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
||||||
skypopen_sleep(10000);
|
//skypopen_sleep(10000);
|
||||||
} else {
|
} else {
|
||||||
/* we are inside an active call */
|
/* we are inside an active call */
|
||||||
if (!strcasecmp(tech_pvt->skype_call_id, id)) {
|
if (!strcasecmp(tech_pvt->skype_call_id, id)) {
|
||||||
|
@ -630,7 +630,7 @@ int skypopen_signaling_read(private_t *tech_pvt)
|
||||||
SKYPOPEN_P_LOG, id);
|
SKYPOPEN_P_LOG, id);
|
||||||
sprintf(msg_to_skype, "GET CALL %s PARTNER_HANDLE", id);
|
sprintf(msg_to_skype, "GET CALL %s PARTNER_HANDLE", id);
|
||||||
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
||||||
skypopen_sleep(10000);
|
//skypopen_sleep(10000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (!strcasecmp(value, "EARLYMEDIA")) {
|
} else if (!strcasecmp(value, "EARLYMEDIA")) {
|
||||||
|
@ -645,10 +645,10 @@ int skypopen_signaling_read(private_t *tech_pvt)
|
||||||
return CALLFLOW_INCOMING_HANGUP;
|
return CALLFLOW_INCOMING_HANGUP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
skypopen_sleep(1000);
|
//skypopen_sleep(1000);
|
||||||
sprintf(msg_to_skype, "ALTER CALL %s SET_INPUT PORT=\"%d\"", id, tech_pvt->tcp_cli_port);
|
sprintf(msg_to_skype, "ALTER CALL %s SET_INPUT PORT=\"%d\"", id, tech_pvt->tcp_cli_port);
|
||||||
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
||||||
skypopen_sleep(1000);
|
//skypopen_sleep(1000);
|
||||||
sprintf(msg_to_skype, "#output ALTER CALL %s SET_OUTPUT PORT=\"%d\"", id, tech_pvt->tcp_srv_port);
|
sprintf(msg_to_skype, "#output ALTER CALL %s SET_OUTPUT PORT=\"%d\"", id, tech_pvt->tcp_srv_port);
|
||||||
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
||||||
|
|
||||||
|
@ -732,10 +732,10 @@ int skypopen_signaling_read(private_t *tech_pvt)
|
||||||
return CALLFLOW_INCOMING_HANGUP;
|
return CALLFLOW_INCOMING_HANGUP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
skypopen_sleep(1000);
|
//skypopen_sleep(1000);
|
||||||
sprintf(msg_to_skype, "ALTER CALL %s SET_INPUT PORT=\"%d\"", id, tech_pvt->tcp_cli_port);
|
sprintf(msg_to_skype, "ALTER CALL %s SET_INPUT PORT=\"%d\"", id, tech_pvt->tcp_cli_port);
|
||||||
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
||||||
skypopen_sleep(1000);
|
//skypopen_sleep(1000);
|
||||||
sprintf(msg_to_skype, "#output ALTER CALL %s SET_OUTPUT PORT=\"%d\"", id, tech_pvt->tcp_srv_port);
|
sprintf(msg_to_skype, "#output ALTER CALL %s SET_OUTPUT PORT=\"%d\"", id, tech_pvt->tcp_srv_port);
|
||||||
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
||||||
}
|
}
|
||||||
|
@ -769,7 +769,7 @@ int skypopen_signaling_read(private_t *tech_pvt)
|
||||||
skypopen_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
|
skypopen_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
|
||||||
tech_pvt->interface_state = SKYPOPEN_STATE_DOWN;
|
tech_pvt->interface_state = SKYPOPEN_STATE_DOWN;
|
||||||
tech_pvt->skype_call_id[0] = '\0';
|
tech_pvt->skype_call_id[0] = '\0';
|
||||||
skypopen_sleep(1000);
|
//skypopen_sleep(1000);
|
||||||
return CALLFLOW_INCOMING_HANGUP;
|
return CALLFLOW_INCOMING_HANGUP;
|
||||||
} else if (!strcasecmp(value, "WAITING_REDIAL_COMMAND")) {
|
} else if (!strcasecmp(value, "WAITING_REDIAL_COMMAND")) {
|
||||||
tech_pvt->skype_callflow = CALLFLOW_STATUS_FAILED;
|
tech_pvt->skype_callflow = CALLFLOW_STATUS_FAILED;
|
||||||
|
@ -779,7 +779,7 @@ int skypopen_signaling_read(private_t *tech_pvt)
|
||||||
skypopen_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
|
skypopen_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
|
||||||
tech_pvt->interface_state = SKYPOPEN_STATE_DOWN;
|
tech_pvt->interface_state = SKYPOPEN_STATE_DOWN;
|
||||||
tech_pvt->skype_call_id[0] = '\0';
|
tech_pvt->skype_call_id[0] = '\0';
|
||||||
skypopen_sleep(1000);
|
//skypopen_sleep(1000);
|
||||||
return CALLFLOW_INCOMING_HANGUP;
|
return CALLFLOW_INCOMING_HANGUP;
|
||||||
} else {
|
} else {
|
||||||
WARNINGA("skype_call: %s, STATUS: %s is not recognized\n", SKYPOPEN_P_LOG, id, value);
|
WARNINGA("skype_call: %s, STATUS: %s is not recognized\n", SKYPOPEN_P_LOG, id, value);
|
||||||
|
@ -1566,8 +1566,8 @@ int skypopen_send_message(private_t *tech_pvt, const char *message_P)
|
||||||
unsigned int len = strlen(message_P);
|
unsigned int len = strlen(message_P);
|
||||||
XEvent e;
|
XEvent e;
|
||||||
|
|
||||||
skypopen_sleep(1000);
|
//skypopen_sleep(1000);
|
||||||
XFlush(disp);
|
//XFlush(disp);
|
||||||
|
|
||||||
memset(&e, 0, sizeof(e));
|
memset(&e, 0, sizeof(e));
|
||||||
e.xclient.type = ClientMessage;
|
e.xclient.type = ClientMessage;
|
||||||
|
@ -1868,7 +1868,7 @@ void *skypopen_do_skypeapi_thread_func(void *obj)
|
||||||
case ClientMessage:
|
case ClientMessage:
|
||||||
|
|
||||||
if (an_event.xclient.format != 8) {
|
if (an_event.xclient.format != 8) {
|
||||||
skypopen_sleep(1000); //0.1 msec
|
//skypopen_sleep(1000); //0.1 msec
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1924,17 +1924,18 @@ void *skypopen_do_skypeapi_thread_func(void *obj)
|
||||||
howmany = strlen(b) + 1;
|
howmany = strlen(b) + 1;
|
||||||
howmany = write(SkypopenHandles->fdesc[1], b, howmany);
|
howmany = write(SkypopenHandles->fdesc[1], b, howmany);
|
||||||
memset(buffer, '\0', 17000);
|
memset(buffer, '\0', 17000);
|
||||||
XFlush(disp);
|
//XFlush(disp);
|
||||||
there_were_continues = 0;
|
there_were_continues = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
skypopen_sleep(1000); //0.1 msec
|
//skypopen_sleep(1000); //0.1 msec
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
skypopen_sleep(1000); //0.1 msec
|
//skypopen_sleep(1000); //0.1 msec
|
||||||
break;
|
break;
|
||||||
} //switch event.type
|
} //switch event.type
|
||||||
} //while XPending
|
} //while XPending
|
||||||
|
XFlush(disp);
|
||||||
|
|
||||||
} // if select
|
} // if select
|
||||||
} //while running
|
} //while running
|
||||||
|
|
Loading…
Reference in New Issue