ant-phone/src/session.h

426 lines
15 KiB
C
Raw Normal View History

2007-11-24 13:45:25 +00:00
/*
* definitions for runtime session specific data handling
*
* This file is part of ANT (Ant is Not a Telephone)
*
* Copyright 2002, 2003 Roland Stigge
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
* Copyright 2007 Ivan Schreter
2007-11-24 13:45:25 +00:00
*
* ANT is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* ANT 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ANT; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef _ANT_SESSION_H
#define _ANT_SESSION_H
#include "config.h"
/* regular GNU system includes */
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#endif
#include <time.h>
/* GTK */
#include <gtk/gtk.h>
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
#include <alsa/asoundlib.h>
2007-11-24 13:45:25 +00:00
/* own header files */
#include "recording.h"
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
#include "isdn.h"
#include "thread.h"
2007-11-24 13:45:25 +00:00
#define SESSION_PRESET_SIZE 4
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
/*!
* @brief Session states.
*/
2007-11-24 13:45:25 +00:00
enum state_t {
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
STATE_READY, /*!< completely idle */
STATE_RINGING, /*!< somebody's calling */
STATE_RINGING_QUIET, /*!< same as above, audio off (device blocked) */
STATE_DIALING, /*!< we are dialing out */
STATE_CONVERSATION, /*!< we are talking */
STATE_SERVICE, /*!< special mode (llcheck) */
STATE_PLAYBACK, /*!< sound playback, usually recorded conversation */
STATE_NUMBER /*!< dummy to calculate size */
2007-11-24 13:45:25 +00:00
};
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
/*!
* @brief Known audio effects.
*/
2007-11-24 13:45:25 +00:00
enum effect_t {
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
EFFECT_NONE, /*!< nothing is played currently */
EFFECT_RING, /*!< somebody's calling */
EFFECT_RINGING, /*!< waiting for the other end to pick up the phone */
EFFECT_TEST, /*!< play test sound (e.g. line level check) */
EFFECT_TOUCHTONE,/*!< play a touchtone */
EFFECT_EMPTY, /*!< don't play anything */
EFFECT_SOUNDFILE /*!< play sound from file */
2007-11-24 13:45:25 +00:00
};
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
/*!
* @brief Audio states.
*/
enum audio_t {
AUDIO_DISCONNECTED, /*!< audio is disconnected */
AUDIO_IDLE, /*!< audio is connected, but idle */
AUDIO_EFFECT, /*!< audio is playing an effect */
AUDIO_CONVERSATION /*!< audio is used for conversation */
};
/*!
* @brief Data needed for setting the session state (the state is the index).
2007-11-24 13:45:25 +00:00
*/
struct state_data_t {
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
char *status_bar; /*!< what to display in status bar */
char *pick_up_label; /*!< label for pick-up button */
int pick_up_state; /*!< state for pick-up button */
char *hang_up_label; /*!< label for hang-up button */
int hang_up_state; /*!< state for hang-up button */
2007-11-24 13:45:25 +00:00
};
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
/*!
* @brief GUI state data for various session states.
*/
extern struct state_data_t state_data[STATE_NUMBER];
2007-11-24 13:45:25 +00:00
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
/*!
* @brief Session data.
2007-11-24 13:45:25 +00:00
*/
typedef struct {
/* audio device data */
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
char *audio_device_name_in; /*!< name of input audio device */
char *audio_device_name_out; /*!< name of output audio device */
snd_pcm_t *audio_in; /*!< input audio device PCM handle */
snd_pcm_t *audio_out; /*!< output audio device PCM handle */
enum audio_t audio_state; /*!< current audio state */
unsigned int audio_speed_in; /*!< audio device recording speed */
unsigned int audio_speed_out; /*!< audio device playback speed */
int fragment_size_in; /*!< audio input fragment sizes in bytes */
int fragment_size_out; /*!< audio output fragment sizes in bytes */
int *format_priorities; /*!< 0-terminated sorted list of preferred audio formats (ALSA constants) */
int audio_format_in; /*!< used audio in format */
int audio_format_out; /*!< used audio out format */
int audio_sample_size_in; /*!< number of bytes of an input audio sample */
int audio_sample_size_out; /*!< number of bytes of an output audio sample */
isdn_speed_t audio_out_speed; /*!< actual audio out speed */
isdn_speed_t audio_in_speed; /*!< actual audio in speed */
thread_t thread_audio_input; /*!< audio data input thread */
/* ISDN data */
isdn_t isdn; /*!< ISDN handle */
unsigned int isdn_active; /*!< flag for active CAPI connection */
char *from; /*!< caller's number */
char *to; /*!< callee's number */
char *hangup_reason; /*!< reason for hangup */
2007-11-24 13:45:25 +00:00
/* mediation data */
/* Look-up-tables for audio <-> isdn conversion: */
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
unsigned char *audio_LUT_in; /*!< lookup table ISDN -> audio */
unsigned char *audio_LUT_out; /*!< lookup table audio -> ISDN */
unsigned char *audio_LUT_generate; /*!< lookup table 8 bit unsigned -> ISDN */
unsigned char *audio_LUT_analyze; /*!< lookup table ISDN -> 8 bit unsigned */
short *audio_LUT_alaw2short; /*!< lookup table unsigned char (alaw) -> short */
double ratio_in; /*!< ratio: audio output rate / ISDN input rate */
double ratio_out; /*!< ratio: ISDN output rate / audio input rate */
2007-11-24 13:45:25 +00:00
/* recording data */
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
struct recorder_t *recorder; /*!< recorder internal data */
/* level check data */
double llcheck_in_state; /*!< current input value for level check */
double llcheck_out_state; /*!< current output value for level check */
guint gtk_updater_timer_tag; /*!< GTK timer tag for updating levels */
remote_call_port_t rem_port; /*!< remote call port to call functions in session thread */
2007-11-24 13:45:25 +00:00
/* GUI elements in this session (GTK specific) */
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
GtkWidget *main_window; /*!< the main window (with style ...) */
GtkWidget *pick_up_button; /*!< the pick up button to enable / disable */
GtkWidget *pick_up_label; /*!< the label on the pick up button */
GtkWidget *hang_up_button; /*!< the hang up button to enable / disable */
GtkWidget *hang_up_label; /*!< the label on the hang up button */
GtkWidget *dial_number_box; /*!< the dial number combo box */
GList *dial_number_history; /*!< the last called numbers */
unsigned int dial_number_history_maxlen; /*!< how many numbers to remember */
unsigned int dial_number_history_pointer; /*!< which one to use next if req */
GtkWidget *status_bar; /*!< the status bar */
gint phone_context_id; /*!< a context for the status bar */
GtkWidget *audio_warning; /*!< inside status bar */
gint audio_context_id; /*!< a context for audio_warning */
GtkWidget *llcheck; /*!< line level check widget inside status bar */
GtkWidget *llcheck_in; /*!< input level meter */
GtkWidget *llcheck_out; /*!< output level meter */
GtkWidget *llcheck_check_menu_item; /*!< state of line levels (status bar) */
GtkWidget *controlpad; /*!< key pad etc. */
GtkWidget *controlpad_check_menu_item; /*!< display state of control pad */
GtkWidget *mute_button; /*!< mute toggle button */
GtkWidget *muted_warning; /*!< show in status bar if muted */
gint muted_context_id; /*!< a context for mute in the status bar */
GtkWidget *record_checkbutton; /*!< recording checkbutton */
GtkWidget *record_checkbutton_local; /*!< local recording checkbutton */
GtkWidget *record_checkbutton_remote; /*!< remote recording checkbutton */
2007-11-24 13:45:25 +00:00
/* caller id related */
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
GtkWidget *cid; /*!< the caller id widget itself (to show/hide) */
GtkWidget *cid_check_menu_item; /*!< to handle state of cid monitor (show?) */
GtkWidget *cid_list; /*!< the list to hold the individual call data */
GtkWidget *cid_scrolled_window; /*!< the home of the clist with adjustments */
gint cid_num; /*!< number of rows in list */
gint cid_num_max; /*!< maximum number of rows in list */
time_t vcon_time; /*!< the start of conversation mode (for duration calc.) */
time_t ring_time; /*!< the first sign of the conversation (dial/ring) */
2007-11-24 13:45:25 +00:00
/* the symbols for the CList */
GdkPixmap *symbol_in_pixmap;
GdkBitmap *symbol_in_bitmap;
GdkPixmap *symbol_out_pixmap;
GdkBitmap *symbol_out_bitmap;
GdkPixmap *symbol_record_pixmap;
GdkBitmap *symbol_record_bitmap;
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
GtkWidget *menuitem_settings; /*!< Menu items to select / deselect */
2007-11-24 13:45:25 +00:00
GtkWidget *menuitem_line_check;
/* ringing etc. */
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
thread_t thread_effect; /*!< effect thread, e.g., for ringing */
enum effect_t effect; /*!< which effect is currently been played? */
unsigned int effect_pos; /*!< sample position in effect */
char* effect_filename; /*!< the file to play back */
SNDFILE* effect_sndfile; /*!< sound file handle */
SF_INFO effect_sfinfo; /*!< info struct about effect_sndfile */
time_t effect_playback_start_time; /*!< start time of playback */
int touchtone_countdown_isdn; /*!< number of samples yet to play */
int touchtone_countdown_audio; /*!< number of samples yet to play */
int touchtone_index; /*!< which touchtone */
2007-11-24 13:45:25 +00:00
/* phone specific */
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
enum state_t state; /*!< which state we are currently in */
2007-11-24 13:45:25 +00:00
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
char* msn; /*!< originating msn, allocated memory! */
char* msns; /*!< comma-separated list of msns to listen on, allocated memory!*/
2007-11-24 13:45:25 +00:00
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
int unanswered; /*!< unanswered calls for this session */
2007-11-24 13:45:25 +00:00
/* some options (useful for options file handling) */
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
int option_save_options; /*!< save options on exit */
int option_release_devices; /*!< close sound devices while not needed */
int option_show_llcheck; /*!< show line level checks in main window */
int option_show_callerid; /*!< show callerid part in main window */
int option_show_controlpad; /*!< show control pad (key pad etc.) */
int option_muted; /*!< mute microphone (other party gets zeros) */
int option_record; /*!< record to file */
int option_record_local; /*!< record local channel */
int option_record_remote; /*!< record remote channel */
enum recording_format_t option_recording_format; /*!< recording file format */
int option_calls_merge; /*!< merge isdnlog */
2007-11-24 13:45:25 +00:00
int option_calls_merge_max_days;
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
char *exec_on_incoming; /*!< string with command to execute on incoming call */
int option_popup; /*!< push main window to foreground on incoming call */
char* preset_names[SESSION_PRESET_SIZE]; /*!< names for preset buttons */
char* preset_numbers[SESSION_PRESET_SIZE]; /*!< numbers for preset buttons */
2007-11-24 13:45:25 +00:00
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
int local_sock; /*!< unix domain socket for local server functionality */
guint gtk_local_input_tag; /*!< GTK tag for GTK main loop select */
2007-11-24 13:45:25 +00:00
} session_t;
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
/*!
* @brief Default session.
*/
2007-11-24 13:45:25 +00:00
extern session_t session;
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
/*!
* @brief Sets new state in session and GUI (also handles audio state).
*
* @param session session to use.
* @param state new session state (@see state_t).
* @return 0 on success, -1 otherwise (e.g., can't open audio device).
*/
2007-11-24 13:45:25 +00:00
int session_set_state(session_t *session, enum state_t state);
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
/*!
* @brief Activate/deactivate ISDN connection.
*
* @param session session to use.
* @param activate if nonzero, activate ISDN, otherwise deactivate.
* @return 0 on success, -1 otherwise (e.g., can't open ISDN device).
*/
int session_activate_isdn(session_t *session, unsigned int activate);
/*!
* @brief Set up GTK I/O handlers.
*
* @param session session to use.
*/
2007-11-24 13:45:25 +00:00
void session_io_handlers_start(session_t *session);
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
/*!
* @brief Remove GTK handlers.
*
* @param session session to use.
*/
2007-11-24 13:45:25 +00:00
void session_io_handlers_stop(session_t *session);
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
/*!
* @brief Set audio device state in session.
*
* @param session session.
* @param state requested audio state (@see audio_t).
* @return 0 on success, -1 otherwise.
*/
int session_set_audio_state(session_t *session, enum audio_t state);
/*!
* @brief Resets audio devices by closing and reopening.
*
* @param session session.
* @return 0 on success, -1 otherwise.
*
* @note Stop I/O handlers first!
* Only resets currently used device(s). To use another device,
* use session_set_audio_state() with AUDIO_DISCONNECTED to
* disconnect the old device first.
*/
2007-11-24 13:45:25 +00:00
int session_reset_audio(session_t *session);
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
/*!
* @brief Initialize a session (ISDN and audio devices) and read options file.
*
* @param session session, empty, to be filled.
* @param audio_device_name_in default name of input audio device.
* @param audio_device_name_out default name of output audio device.
* @param msn default MSN to use.
* @param msns default set of MSNs to listen on.
* @return 0 on success, -1 otherwise.
*
* @note The latter 4 parameters are only the defaults. They are normally
* overridden by the options file.
*/
2007-11-24 13:45:25 +00:00
int session_init(session_t *session,
char *audio_device_name_in,
char *audio_device_name_out,
char *msn, char *msns);
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
/*!
* @brief Clean up a session (ISDN and audio devices).
*
* @param session session to clean up.
* @return 0 on success, -1 otherwise.
*/
2007-11-24 13:45:25 +00:00
int session_deinit(session_t *session);
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
/*!
* @brief Start an effect (effect_t) playing on the sound device.
*
* If kind == EFFECT_SOUNDFILE, session->effect_filename should be
* initialized. session_effect_stop() will free() it afterwards.
*
* @param session session.
* @param kind effect kind.
*/
2007-11-24 13:45:25 +00:00
void session_effect_start(session_t *session, enum effect_t kind);
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
/*!
* @brief Stop playing an effect.
*
* @param session session.
*/
2007-11-24 13:45:25 +00:00
void session_effect_stop(session_t *session);
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
/*!
* @brief Start recording on a session.
*
* @param session session on which to record.
* @return 0 on success, -1 otherwise.
*/
int session_start_recording(session_t *session);
/*!
* @brief Initiates dialing to specified number.
*
* Changes contents of dial entry and simulates pick up button.
*
* @param session session.
* @param number number to dial.
*/
2007-11-24 13:45:25 +00:00
void session_make_call(session_t *session, char *number);
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
/*!
* @brief Callback from GTK on pick up button clicked.
*
* @param widget the button.
* @param data session.
*/
2007-11-24 13:45:25 +00:00
void gtk_handle_pick_up_button(GtkWidget *widget, gpointer data);
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
/*!
* @brief Callback from GTK on hang up button clicked.
*
* @note Also called on exit.
*
* @param widget the button, NULL when called directly (on exit).
* @param data session.
*/
2007-11-24 13:45:25 +00:00
void gtk_handle_hang_up_button(GtkWidget *widget, gpointer data);
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
/*!
* @brief Add line to history of dial number combo box as first row.
*
* Also check maximum size of history.
*
* @param session session.
* @param number number to add (will be copied).
*/
2007-11-24 13:45:25 +00:00
void session_history_add(session_t *session, const char *number);
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
/*!
* @brief Add line to history of dial number combo box as last row.
*
* Also check maximum size of history.
*
* @param session session.
* @param number number to add (will be copied).
*/
2007-11-24 13:45:25 +00:00
void session_history_append(session_t *session, char *number);
Version 0.2.0: CAPI 2.0, ALSA, threading, low-latency. Changes in short: * Re-work of session handling to use sound and ISDN threads, which greatly reduces latency and CPU usage * Complete re-work of ISDN subsystem to use CAPI 2.0 * Complete re-work of sound subsystem to use ALSA * Re-work of recording subsystem to produce better results * Re-work of debug and error message handling (centralized) * Added --sleep and --wakeup remote commands to facilitate release and re-acquire of CAPI connection * Code documentation (partial) Reduced latency: ---------------- We are now using separate threads to handle ISDN input (and send it to audio output) and audio input (which again sends it to ISDN). This means, we are not dependent on GTK GUI reaction time. This enables very good sound quality with low latency and low CPU consumption (normally not measurable). Tested with 3x parallel "while true; do true; done" and "find /". No sound problems, even though the threads don't run with real time priority (which can be implemented now relatively easily, though). ISDN system: ------------ We now support CAPI 2.0. This means, any card supported by CAPI 2.0 should work and also ant-phone should be able to coexist with other ISDN applications. New CAPI code was tested with Fritz!Card, both with fcpci driver and with mISDN driver. There are also remote-CAPI implementations which forward local CAPI requests to a remote host (e.g., a Fritz!Box router). They should be also usable with new CAPI subsystem (not tested). Sound system: ------------- Since we are now using ALSA, it's much easier to coexist with other sound applications. However, sound device specification has been changed. You should now type in ALSA names (normally 'default') instead of raw devices. Recording: ---------- Recording subsystem now uses ring buffers and the buffers are flushed in GTK thread on timeout. Although it would be possible to have special thread for this purpose, it doesn't really make sense, since we buffer about 2 seconds. In 2 seconds, the application better responds... Anyway, in the worst case, there will be some samples skipped. Also, recording tries to stitch together incoming samples on local as well as remote channels as it best fits based on time code. Certain jitter is compensated for automatically, bigger jitter may produce some cracks. However, in tests there was no such problem. Debug and error message handling: --------------------------------- All debug and error messages should now go through macros dbgprintf() and errprintf(). This allows for implementing of debug log viewer later. For new/rewritten code, all debug and error messages start with "COMPONENT: " prefix. This allows for easier identification in logs. Additionally, there are further debug levels, up to 4. Debug level 3 and higher prints very noisy information about each audio packet processed. Sleep and wakeup commands: -------------------------- Some ISDN card drivers need to be unloaded before suspending the machine to disk and loaded again after resume. This is not possible, as long as the application is holding the CAPI connection. Therefore, two new command-line commands have been implemented, which allow turning off and on the CAPI connection (--sleep and --wakeup, respectively). They can be integrated into suspend and resume scripts to take care of stopping and resuming CAPI. Code documentation: ------------------- Documentation for new code and for big rewritten parts has been changed to Doxygen format. Instead of plain comments, you'll see comments in form /*! ... */ with tags in form @tag, which allow Doxygen to generate pretty-printed source code reference documentation. Doxygen script file has not been actually produced. The rest of the files should be changed as well to use Doxygen format tags in documentation of functions and structures.
2007-11-24 17:55:27 +00:00
2007-11-24 13:45:25 +00:00
#endif /* session.h */