Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/odaslive/azimut_oma.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ raw:
type = "file";
path = "input_oma.raw";
}

output_dump_file = "";
}

# Mapping
Expand Down
2 changes: 1 addition & 1 deletion config/odaslive/beam.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ raw:
type = "file";
path = "micsBeam.raw";
}

output_dump_file = "";
}

# Mapping
Expand Down
2 changes: 1 addition & 1 deletion config/odaslive/delta1010lt.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ raw:
type = "soundcard_name";
devicename = "multi_capture";
}

output_dump_file = "";
}

# Mapping
Expand Down
2 changes: 1 addition & 1 deletion config/odaslive/matrix_creator.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ raw:
card = 2;
device = 0;
}

output_dump_file = "";
}

# Mapping
Expand Down
2 changes: 1 addition & 1 deletion config/odaslive/matrix_voice.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ raw:
card = 2;
device = 0;
}

output_dump_file = "";
}

# Mapping
Expand Down
2 changes: 1 addition & 1 deletion config/odaslive/minidsp.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ raw:
card = 2;
device = 0;
}

output_dump_file = "";
}

# Mapping
Expand Down
2 changes: 1 addition & 1 deletion config/odaslive/pepper.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ raw:
type = "soundcard_name";
devicename = "AD1989A_inputs";
}

output_dump_file = "";
}

# Mapping
Expand Down
2 changes: 1 addition & 1 deletion config/odaslive/pseye.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ raw:
card = 2;
device = 0;
}

output_dump_file = "";
}

# Mapping
Expand Down
2 changes: 1 addition & 1 deletion config/odaslive/respeaker.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ raw:
card = 3;
device = 0;
}

output_dump_file = "";
}

# Mapping
Expand Down
2 changes: 1 addition & 1 deletion config/odaslive/respeaker_4_mic_array.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ raw:
card = 1;
device = 0;
}

output_dump_file = "";
}

# Mapping
Expand Down
2 changes: 1 addition & 1 deletion config/odaslive/respeaker_6_mic_array.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ raw:
card = 1;
device = 0;
}

output_dump_file = "";
}

# Mapping
Expand Down
2 changes: 1 addition & 1 deletion config/odaslive/respeaker_usb_4_mic_array.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ raw:
card = 1;
device = 0;
}

output_dump_file = "";
}

# Mapping
Expand Down
2 changes: 1 addition & 1 deletion config/odaslive/xmos.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ raw:
type = "file";
path = "meeting_recorded_raw_16.raw";
}

output_dump_file = "";
}

# Mapping
Expand Down
13 changes: 13 additions & 0 deletions demo/odaslive/parameters.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,19 @@
exit(EXIT_FAILURE);
}

// +----------------------------------------------------------+
// | Debug dump |
// +----------------------------------------------------------+

tmpStr1 = parameters_lookup_string(fileConfig, "raw.output_dump_file");

if (strcmp(tmpStr1, "") != 0) {

cfg->output_dump_filename = (char *) malloc(sizeof(char) * (strlen(tmpStr1)+1));
strcpy(cfg->output_dump_filename, tmpStr1);
}


free((void *) tmpStr1);

return cfg;
Expand Down
3 changes: 2 additions & 1 deletion include/odas/source/src_hops.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ typedef struct src_hops_obj {
interface_obj *interface;

FILE * fp;
FILE * output_dump_file;
snd_pcm_t * ch;
pa_simple * pa;
pa_sample_spec ss;
Expand All @@ -78,7 +79,7 @@ typedef struct src_hops_cfg {
format_obj * format;
interface_obj * interface;
pa_channel_map * channel_map;

char* output_dump_filename;
} src_hops_cfg;

src_hops_obj * src_hops_construct(const src_hops_cfg * src_hops_config, const msg_hops_cfg * msg_hops_config);
Expand Down
32 changes: 32 additions & 0 deletions src/source/src_hops.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ src_hops_obj * src_hops_construct(const src_hops_cfg * src_hops_config, const ms

obj->format = format_clone(src_hops_config->format);
obj->interface = interface_clone(src_hops_config->interface);
if (src_hops_config->output_dump_filename!=NULL)
{
obj->output_dump_file = fopen(src_hops_config->output_dump_filename, "wb");

if (obj->output_dump_file == NULL) {
printf("Cannot open raw dump file %s\n", src_hops_config->output_dump_filename);
exit(EXIT_FAILURE);
}
}else
{
obj->output_dump_file = NULL;
}
if (src_hops_config->channel_map != NULL)
{
// Will not be null if in pulseaudio mode
Expand Down Expand Up @@ -99,6 +111,11 @@ void src_hops_destroy(src_hops_obj * obj) {
free((void *) obj->buffer);
format_destroy(obj->format);
interface_destroy(obj->interface);

if (obj->output_dump_file != NULL)
{
fclose(obj->output_dump_file);
}

free((void *) obj);
}
Expand Down Expand Up @@ -354,6 +371,11 @@ void src_hops_close(src_hops_obj * obj) {

break;
}
if (obj->output_dump_file)
{
fclose(obj->output_dump_file);
obj->output_dump_file = NULL;
}
}

void src_hops_close_interface_file(src_hops_obj * obj) {
Expand Down Expand Up @@ -456,6 +478,11 @@ int src_hops_process(src_hops_obj * obj) {
obj->timeStamp++;
obj->out->timeStamp = obj->timeStamp;

if(obj->output_dump_file != NULL)
{
fwrite(obj->buffer, sizeof(char), obj->bufferSize, obj->output_dump_file);
}

return rtnValue;
}

Expand Down Expand Up @@ -659,6 +686,7 @@ src_hops_cfg * src_hops_cfg_construct(void) {

cfg->format = (format_obj *) NULL;
cfg->interface = (interface_obj *) NULL;
cfg->output_dump_filename = NULL;

return cfg;
}
Expand All @@ -676,6 +704,10 @@ void src_hops_cfg_destroy(src_hops_cfg * src_hops_config) {
free((void *) src_hops_config->channel_map);
}

if (src_hops_config->output_dump_filename != NULL) {
free((void *) src_hops_config->output_dump_filename);
}

free((void *) src_hops_config);

}