Merge 0281af7ac0
into 7088804826
This commit is contained in:
commit
798426d5c1
|
@ -390,14 +390,14 @@ void startModem()
|
||||||
}
|
}
|
||||||
|
|
||||||
// int TX audio and modulator
|
// int TX audio and modulator
|
||||||
io_capidx = kmaudio_startCapture(captureDeviceName, caprate);
|
io_capidx = kmaudio_startCapture(captureDeviceName, caprate, "Modem RX");
|
||||||
if (io_capidx == -1)
|
if (io_capidx == -1)
|
||||||
{
|
{
|
||||||
printf("CAP: cannot open device: %s\n", captureDeviceName);
|
printf("CAP: cannot open device: %s\n", captureDeviceName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
io_pbidx = kmaudio_startPlayback(playbackDeviceName, caprate);
|
io_pbidx = kmaudio_startPlayback(playbackDeviceName, caprate, "Modem TX");
|
||||||
if (io_pbidx == -1)
|
if (io_pbidx == -1)
|
||||||
{
|
{
|
||||||
printf("PB: cannot open device: %s\n", playbackDeviceName);
|
printf("PB: cannot open device: %s\n", playbackDeviceName);
|
||||||
|
@ -429,13 +429,13 @@ void initVoice()
|
||||||
if (VoiceAudioMode == VOICEMODE_LISTENAUDIOIN && caprate == 44100)
|
if (VoiceAudioMode == VOICEMODE_LISTENAUDIOIN && caprate == 44100)
|
||||||
srate = 44100;
|
srate = 44100;
|
||||||
|
|
||||||
voice_capidx = kmaudio_startCapture(micDeviceName, srate);
|
voice_capidx = kmaudio_startCapture(micDeviceName, srate, "Voice Input");
|
||||||
if (voice_capidx == -1)
|
if (voice_capidx == -1)
|
||||||
{
|
{
|
||||||
printf("Voice CAP: cannot open device: %s\n", micDeviceName);
|
printf("Voice CAP: cannot open device: %s\n", micDeviceName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
voice_pbidx = kmaudio_startPlayback(lsDeviceName, srate);
|
voice_pbidx = kmaudio_startPlayback(lsDeviceName, srate, "Voice Output");
|
||||||
if (voice_pbidx == -1)
|
if (voice_pbidx == -1)
|
||||||
{
|
{
|
||||||
printf("Voice PB: cannot open device: %s\n", lsDeviceName);
|
printf("Voice PB: cannot open device: %s\n", lsDeviceName);
|
||||||
|
|
|
@ -127,14 +127,14 @@ int kmaudio_getDeviceList();
|
||||||
* starts a capturing stream from devname with samprate
|
* starts a capturing stream from devname with samprate
|
||||||
* returns: id of the capture stream or -1 = error
|
* returns: id of the capture stream or -1 = error
|
||||||
*/
|
*/
|
||||||
int kmaudio_startCapture(char* devname, int samprate);
|
int kmaudio_startCapture(char* devname, int samprate, char* description);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* starts a playback stream to devname with samprate
|
* starts a playback stream to devname with samprate
|
||||||
* returns: id of the playback stream or -1 = error
|
* returns: id of the playback stream or -1 = error
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int kmaudio_startPlayback(char* devname, int samprate);
|
int kmaudio_startPlayback(char* devname, int samprate, char* description);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* plays len samples from psamp to device id
|
* plays len samples from psamp to device id
|
||||||
|
|
|
@ -49,7 +49,7 @@ void close_capture_stream(int idx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int kmaudio_startCapture(char* devname, int samprate)
|
int kmaudio_startCapture(char* devname, int samprate, char* description)
|
||||||
{
|
{
|
||||||
printf("Start request for CAP stream:%s\n", devname);
|
printf("Start request for CAP stream:%s\n", devname);
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@ void close_capture_stream(int idx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int kmaudio_startCapture(char* devname, int samprate)
|
int kmaudio_startCapture(char* devname, int samprate, char* description)
|
||||||
{
|
{
|
||||||
printf("Start request for CAP stream:%s\n", devname);
|
printf("Start request for CAP stream:%s\n", devname);
|
||||||
|
|
||||||
|
@ -193,6 +193,7 @@ int kmaudio_startCapture(char* devname, int samprate)
|
||||||
devlist[idx].instream->read_callback = read_callback;
|
devlist[idx].instream->read_callback = read_callback;
|
||||||
devlist[idx].instream->overflow_callback = overflow_callback;
|
devlist[idx].instream->overflow_callback = overflow_callback;
|
||||||
devlist[idx].instream->userdata = &(devlist[idx].index);
|
devlist[idx].instream->userdata = &(devlist[idx].index);
|
||||||
|
devlist[idx].instream->name = description;
|
||||||
|
|
||||||
int err = 0;
|
int err = 0;
|
||||||
if ((err = soundio_instream_open(devlist[idx].instream))) {
|
if ((err = soundio_instream_open(devlist[idx].instream))) {
|
||||||
|
|
|
@ -45,6 +45,7 @@ int kmaudio_init_linux()
|
||||||
printf("soundio_create: out of memory\n");
|
printf("soundio_create: out of memory\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
soundio->app_name = "AMSAT-DL HS Modem";
|
||||||
|
|
||||||
if ((err = soundio_connect(soundio))) {
|
if ((err = soundio_connect(soundio))) {
|
||||||
printf("soundio_connect: %s\n", soundio_strerror(err));
|
printf("soundio_connect: %s\n", soundio_strerror(err));
|
||||||
|
|
|
@ -51,7 +51,7 @@ void close_playback_stream(int idx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int kmaudio_startPlayback(char* devname, int samprate)
|
int kmaudio_startPlayback(char* devname, int samprate, char* description)
|
||||||
{
|
{
|
||||||
printf("Start request for PB stream:%s\n", devname);
|
printf("Start request for PB stream:%s\n", devname);
|
||||||
|
|
||||||
|
|
|
@ -151,7 +151,7 @@ void close_playback_stream(int idx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int kmaudio_startPlayback(char* devname, int samprate)
|
int kmaudio_startPlayback(char* devname, int samprate, char* description)
|
||||||
{
|
{
|
||||||
printf("Start request for PB stream:%s\n", devname);
|
printf("Start request for PB stream:%s\n", devname);
|
||||||
|
|
||||||
|
@ -223,6 +223,7 @@ int kmaudio_startPlayback(char* devname, int samprate)
|
||||||
devlist[idx].outstream->write_callback = write_callback;
|
devlist[idx].outstream->write_callback = write_callback;
|
||||||
devlist[idx].outstream->underflow_callback = underflow_callback;
|
devlist[idx].outstream->underflow_callback = underflow_callback;
|
||||||
devlist[idx].outstream->userdata = &(devlist[idx].index);
|
devlist[idx].outstream->userdata = &(devlist[idx].index);
|
||||||
|
devlist[idx].outstream->name = description;
|
||||||
|
|
||||||
int err = 0;
|
int err = 0;
|
||||||
if ((err = soundio_outstream_open(devlist[idx].outstream))) {
|
if ((err = soundio_outstream_open(devlist[idx].outstream))) {
|
||||||
|
|
|
@ -456,6 +456,7 @@ int io_init_sound(char *pbname, char *capname)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
soundio->app_name = "AMSAT-DL HS Modem";
|
||||||
|
|
||||||
io_readAudioDevices();
|
io_readAudioDevices();
|
||||||
io_init_pipes();
|
io_init_pipes();
|
||||||
|
|
|
@ -235,6 +235,7 @@ int io_init_voice(char* lsname, char* micname)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
voice_soundio->app_name = "AMSAT-DL HS Modem";
|
||||||
|
|
||||||
if (lsname == NULL || micname == NULL || strlen(lsname) < 3 || strlen(micname) < 3) // no devices defined yet
|
if (lsname == NULL || micname == NULL || strlen(lsname) < 3 || strlen(micname) < 3) // no devices defined yet
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue