Difference between revisions of "FXM FAQ"

From synwaywiki
Jump to: navigation, search
(Created page with "==Why do noises appear while using the FXM-8A/PCI or FXM-16A/PCIe board?=== It may be due to the incomplete downloading of the firmware after Zaptel/Dahdi installation. Please...")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
==Why do noises appear while using the FXM-8A/PCI or FXM-16A/PCIe board?===
+
===How to solve the problem that the system fails to detect the hangup at remote end as the volume of the recorded busy tone is quite low? ===
It may be due to the incomplete downloading of the firmware after Zaptel/Dahdi installation. Please make sure the network is well connected when you execute the command ./Setup install.
+
Modify the file main/dsp.c under the Asterisk directory, changing the previous content ‘#define DEFAULT_THRESHOLD 512’ to ‘#define DEFAULT_THRESHOLD 448’. The value can be reduced again if the problem is not solved yet.  
  
===How to determine the board arrangement when there are more than one AST board?===
+
===How to solve the failure of FXM boards to receive the calling party number? ===
If zaptel is configured automatically, you may check /etc/zaptel.conf or /etc/dahdi/system.conf to see the board arrangement.
+
If you are using a version of zaptel, please uninstall it first. Then install a dahdi version and operate as follows (take the FXM-8A/PCI board for example).<br />
If zaptel is configured manually, you may execute the command #cat /var/log/messages | grep "Launching card" to check the board arrangement.
+
If the board arrangement is determined by their serial number, pay attention to the time when you execute the command.
+
  
===How to install the SynAST driver in a dahdi version for which driver and tools are published separately?===
+
Execute the command ‘echo 32 > /sys/module/fxm8apci/parameters/ringdebounce’. Then test if the board can well receive the calling party number. If the reception still fails, change 32 in this command to 16 or 8 and retest. <br />
Please download the driver and tools of dahdi separately. <br />
+
  
1.By Script
+
Note: If the file /sys/module/fxm8apci/parameters/ringdebounce does not exist, modify the command to ‘echo 32 >/sys/module/fxm8apci/ringdebounce’.
 +
 
 +
===How to use the function of FXM series boards to adjust recording and playback volumes?===
 +
This volume adjustment function is valid to all channels on the same kind of boards. The value range of the parameter x is 1~255 which represents the DB value of 20log(x/10). <br />
 +
 
 +
To adjust the recording volume for FXM-8A-PCI, execute the command: <br />
 +
echo x > /sys/module/fxm8apci/parameters/recvolume; <br />
 +
To adjust the playback volume for FXM-8A-PCI, execute the command: <br />
 +
echo x > /sys/module/fxm8apci/parameters/playvolume; <br />
 +
To adjust the recording volume for FXM-16A-PCIe, execute the command: <br />
 +
echo x > /sys/module/fxm16apcie/parameters/recvolume; <br />
 +
To adjust the playback volume for FXM-16A-PCIe, execute the command: <br />
 +
echo x > /sys/module/fxm16apcie/parameters/playvolume <br />
 +
To adjust the recording volume for FXM-32, execute the command: <br />
 +
echo x > /sys/module/fxm32/parameters/recvolume <br />
 +
To adjust the playback volume for FXM-32, execute the command: <br />
 +
echo x > /sys/module/fxm32/parameters/playvolume<br />
 +
 
 +
===How to adjust recording and playback volumes for a single station or analog trunk channel on FXM-32 boards?===
 +
Operate as follows:<br />
 +
echo n > /sys/module/fxm32/parameters/playvolume (playback volume)<br />
 +
echo n > /sys/module/fxm32/parameters/recvolume (recording volume)<br />
 +
n = Channel Number × 1000 + Gain<br />
 +
When the channel number is 0, modify the gains of all channels simultaneously (the same as the original definition); when the channel number is equal to or greater than 1, modify the gain of Channel n only.<br />
 +
For example:<br />
 +
When n=1007, modify the gain of the first channel (i.e. Channel 0) to 7, not changing the gain of other channels.<br />
 +
When n=3128, modify the gain of the third channel (i.e. Channel 2) to 128, not changing the gain of other channels.<br />
 +
When n=16, modify the gains of all channels to 16.<br />
 +
The value range of gain is 1~255, with that of channel number is 1~max_ch. The ‘max_ch’ mentioned herein refers to the actual maximum number of channels.
 +
 
 +
===How to adjust the gain increase, gain decrease and echo switch for the interface chips on FXM32 series boards?===
 +
1. Load the driver.<br />
 +
2. Execute the command ‘#cat /proc/devices’ to obtain the major device number of fxm320x, e.g. the major device number is 253.<br />
 +
3. Create a device file.
 
<pre>
 
<pre>
#cd /opt # enter the directory to source codes
+
#mknod /dev/fxm320x c 253 0
#tar –zxvf SynAST-2.0.1.0.tar.gz # decompress the SynAST driver
+
Here we assume the major device number is 253. It varies on actual conditions.  
#cd SynAST-2.0.1.0 # enter the directory to the SynAST driver
+
#cd dahdi # enter the directory to the ‘synway ast for dahdi’ driver
+
#./Setup install # install the driver
+
Would you like to install SynAST AST package now? y # enter ‘y’ to install
+
Please enter working dahdi directory [q](exit install) : /opt/dahdi_driver
+
# enter the directory to dahdi_driver source codes
+
Please enter dahdi_tools source directory [q](exit install):
+
                                          # enter the directory to dahdi_tools source codes
+
SELECT TEJ MODE [t, e, j] :e   # select the tej mode, or the driver will be installed in e1 mode
+
SELECT TEJXAPCI [75, 120]ohm      # set the impedance of the TEJ pci board, 75 for coaxial cables, 120 for twisted-pair cables
+
SELECT TEJ201E [75, 120]ohm      # set the impedance of the tej201e board, 75 for coaxial cables, 120 for twisted-pair cables
+
 
</pre>
 
</pre>
2.Manually
+
4. Operate in user applications as follows.<br />
 +
Define the following macros:
 
<pre>
 
<pre>
#cd /opt # enter the directory to the package of SynAST source codes
+
#define SYNWAY_IOC_MAGIC 'S'           
#tar –zxvf SynAST-2.0.1.0.tar.gz # decompress the source codes
+
#define SHFXM_MODIFY_VOICE_TX         _IOW(SYNWAY_IOC_MAGIC, 1, int)   
#cp –rf /opt/SynAST-2.0.1.0/dahdi/srcs/fxm/fxm8apci /opt/dahdi_driver/drivers/dahdi
+
#define SHFXM_MODIFY_IMPEDANCE          _IOW(SYNWAY_IOC_MAGIC, 2, int)
# copy the fxm8apci driver to the dahdi_driver directory.
+
#define SHFXM_MODIFY_VOICE_RX          _IOW(SYNWAY_IOC_MAGIC, 3, int)
#cd /opt/dahdi/linux/drivers/dahdi/fxm8apci
+
#define SHFXM_MODIFY_EC             IOW(SYNWAY_IOC_MAGIC, 4, int)
# enter the directory to SynAST source codes in dahdi
+
#define SHFXM_MODIFY_CODEC_VOICE_TX     _IOW(SYNWAY_IOC_MAGIC, 5, int)
#make # compile the driver
+
#define SHFXM_MODIFY_CODEC_VOICE_RX    _IOW(SYNWAY_IOC_MAGIC, 6, int)
#insmod fxm8apci.ko # load the driver
+
Declare the following struct:
 
+
Struct shfxm_cmd_ops
#cd /opt/dahdi_tools                  # enter the directory to dahdi tools
+
{
#./configure
+
int card;
#make # compile dahdi_tools
+
int channel;
#make install # install dahdi_tools
+
int value;
 +
};
 
</pre>
 
</pre>
 +
The meanings of the parameters in the above struct are:<br />
 +
card: The board number (count from 0);<br />
 +
channel: The channel number on a certain board (count from 0, with the maximum number of 31);<br />
 +
value: The value to be set <br />
 +
Note: If you want to adjust the gain increase or decrease (IOCTL is set to SHFXM_MODIFY_CODEC_VOICE_TX, SHFXM_MODIFY_CODEC_VOICE_RX), the value mentioned herein indicates the value of register to be set (Attention that the set values of FXS and FXO ports are quite different. As to an FXO port, the registers you need to adjust are Register 38, Register 39, Register 40 and Register 41 of the Si3050 Chip. As to an FXS port, the registers you need to adjust are Indirect Register 13 and Indirect Register 14 of the Si3215 Chip. For more information about these registers refer to the corresponding 'DataSheet'). If you want to adjust the impedance (IOCTL is set to SHFXM_MODIFY_IMPEDANCE), the value mentioned herein indicates the value of the register for impedance adjustment. For more information, see the corresponding 'DATASHEET'. If IOCTL is set to SHFXM_MODIFY_EC, value=1 means the echo cancellation switch of this channel is enabled, and value=0 means the echo cancellation switch of this channel is disabled.<br />
 +
The adjustment range and corresponding values for FXS ports are as follows:<br />
 +
<pre>
 +
Outgoing: The adjustment range is [0x0, 0x7FF].
 +
          If it is set to 0x0, the corresponding value will be -∞.
 +
          If it is set to 0x400, the corresponding value will be 0.
 +
          If it is set to 0x7FF, the corresponding value will be 6dB.
 +
Incoming: The adjustment range is [0x0, 0x7FF].
 +
          If it is set to 0x0, the corresponding value will be -∞.
 +
          If it is set to 0x400, the corresponding value will be 0.
 +
          If it is set to 0x7FF, the corresponding value will be 6dB.
 +
</pre>
 +
The adjustment range and corresponding values for FXO ports are as follows:<br />
 +
The setting format is ‘abbacc’.<br />
 +
a=0 means to adjust gain increase; a=1 means to adjust gain decrease.<br />
 +
To adjust gain increase, the value range of ‘bb’ is [0, 12]; to adjust gain decrease, the value range of ‘bb’ is [0, 15].<br />
 +
To adjust gain increase, the value range of ‘cc’ is [0, 12]; to adjust gain decrease, the value range of ‘cc’ is [0, 15].<br />
 +
Once the value of bb increases 1, the gain increases or decreases by 1dB. Therefore, by adjusting the value of bb, you can get the maximum gain increase of 12dB or gain decrease of 15dB.<br />
 +
Once the value of cc increases 1, the gain increases or decreases by 0.1dB. Therefore, by adjusting the value of cc, you can get the maximum gain increase of 1.2dB or gain decrease of 1.5dB.
  
===How to determine the use of Zaptel or Dahdi for Asterisk?===
+
===How to adjust the value of 'Loop Current' for FXS modules on FXM32 series boards?===
For Asterisk-1.4.21 and versions below, use Zaptel; for Asterisk-1.4.22 and versions above, use Dahdi.
+
<pre>
 
+
#insmod fxm32.ko loopcurrent=val (The unit is mA and the value range of val is 20~41. Once the value is out of this range, it will be reset to the default value of 20mA.)
===How to solve the problem that the system fails to detect the hangup at remote end as the volume of the recorded busy tone is quite low?  ===
+
</pre>
Modify the file main/dsp.c under the Asterisk directory, changing the previous content ‘#define DEFAULT_THRESHOLD 512’ to ‘#define DEFAULT_THRESHOLD 448’. The value can be reduced again if the problem is not solved yet.
+
 
+
===How to solve the problem that the zaptel driver fails to be installed in the system of Ubuntu 8.10, kernel 2.6.27-7-server?===
+
Use the dahdi driver.
+
 
+
===How to solve the problem that the configuration files zaptel.conf and zapata.conf cannot be found under dahdi?===
+
/etc/dahdi/system.conf under dahdi corresponds to /etc/zaptel.conf under zaptel. The configuration files system.conf and zaptel.conf, although differ in name, are the same in content.
+
/etc/asterisk/chan_dahdi.conf under dahdi corresponds to /etc/asterisk/zapata.conf under zaptel. The configuration files chan_dahdi.conf and zapata.conf, although differ in name, are the same in content.
+
 
+
===How to solve the failure of FXM boards to receive the calling party number?  ===
+
If you are using a version of zaptel, please uninstall it first. Then install a dahdi version and operate as follows (take the FXM-8A/PCI board for example).
+
Execute the command ‘echo 32 > /sys/module/fxm8apci/parameters/ringdebounce’. Then test if the board can well receive the calling party number. If the reception still fails, change 32 in this command to 16 or 8 and retest.
+
Note: If the file /sys/module/fxm8apci/parameters/ringdebounce does not exist, modify the command to ‘echo 32 >/sys/module/fxm8apci/ringdebounce’.
+
 
+
===How to use the function of FXM series boards to adjust recording and playback volumes?===
+
This volume adjustment function is valid to all channels on the same kind of boards. The value range of the parameter x is 1~255 which represents the DB value of 20log(x/10).
+
To adjust the recording volume for FXM-8A-PCI, execute the command:
+
echo x > /sys/module/fxm8apci/parameters/recvolume;
+
To adjust the playback volume for FXM-8A-PCI, execute the command:
+
echo x > /sys/module/fxm8apci/parameters/playvolume;
+
To adjust the recording volume for FXM-16A-PCIe, execute the command:
+
echo x > /sys/module/fxm16apcie/parameters/recvolume;
+
To adjust the playback volume for FXM-16A-PCIe, execute the command:
+
echo x > /sys/module/fxm16apcie/parameters/playvolume
+
To adjust the recording volume for FXM-32, execute the command:
+
echo x > /sys/module/fxm32/parameters/recvolume
+
To adjust the playback volume for FXM-32, execute the command:
+
echo x > /sys/module/fxm32/parameters/playvolume
+

Latest revision as of 09:38, 14 May 2015

How to solve the problem that the system fails to detect the hangup at remote end as the volume of the recorded busy tone is quite low?

Modify the file main/dsp.c under the Asterisk directory, changing the previous content ‘#define DEFAULT_THRESHOLD 512’ to ‘#define DEFAULT_THRESHOLD 448’. The value can be reduced again if the problem is not solved yet.

How to solve the failure of FXM boards to receive the calling party number?

If you are using a version of zaptel, please uninstall it first. Then install a dahdi version and operate as follows (take the FXM-8A/PCI board for example).

Execute the command ‘echo 32 > /sys/module/fxm8apci/parameters/ringdebounce’. Then test if the board can well receive the calling party number. If the reception still fails, change 32 in this command to 16 or 8 and retest.

Note: If the file /sys/module/fxm8apci/parameters/ringdebounce does not exist, modify the command to ‘echo 32 >/sys/module/fxm8apci/ringdebounce’.

How to use the function of FXM series boards to adjust recording and playback volumes?

This volume adjustment function is valid to all channels on the same kind of boards. The value range of the parameter x is 1~255 which represents the DB value of 20log(x/10).

To adjust the recording volume for FXM-8A-PCI, execute the command:
echo x > /sys/module/fxm8apci/parameters/recvolume;
To adjust the playback volume for FXM-8A-PCI, execute the command:
echo x > /sys/module/fxm8apci/parameters/playvolume;
To adjust the recording volume for FXM-16A-PCIe, execute the command:
echo x > /sys/module/fxm16apcie/parameters/recvolume;
To adjust the playback volume for FXM-16A-PCIe, execute the command:
echo x > /sys/module/fxm16apcie/parameters/playvolume
To adjust the recording volume for FXM-32, execute the command:
echo x > /sys/module/fxm32/parameters/recvolume
To adjust the playback volume for FXM-32, execute the command:
echo x > /sys/module/fxm32/parameters/playvolume

How to adjust recording and playback volumes for a single station or analog trunk channel on FXM-32 boards?

Operate as follows:
echo n > /sys/module/fxm32/parameters/playvolume (playback volume)
echo n > /sys/module/fxm32/parameters/recvolume (recording volume)
n = Channel Number × 1000 + Gain
When the channel number is 0, modify the gains of all channels simultaneously (the same as the original definition); when the channel number is equal to or greater than 1, modify the gain of Channel n only.
For example:
When n=1007, modify the gain of the first channel (i.e. Channel 0) to 7, not changing the gain of other channels.
When n=3128, modify the gain of the third channel (i.e. Channel 2) to 128, not changing the gain of other channels.
When n=16, modify the gains of all channels to 16.
The value range of gain is 1~255, with that of channel number is 1~max_ch. The ‘max_ch’ mentioned herein refers to the actual maximum number of channels.

How to adjust the gain increase, gain decrease and echo switch for the interface chips on FXM32 series boards?

1. Load the driver.
2. Execute the command ‘#cat /proc/devices’ to obtain the major device number of fxm320x, e.g. the major device number is 253.
3. Create a device file.

#mknod /dev/fxm320x c 253 0
Here we assume the major device number is 253. It varies on actual conditions. 

4. Operate in user applications as follows.
Define the following macros:

#define SYNWAY_IOC_MAGIC 'S'            
#define SHFXM_MODIFY_VOICE_TX		        _IOW(SYNWAY_IOC_MAGIC, 1, int)    
#define SHFXM_MODIFY_IMPEDANCE          	_IOW(SYNWAY_IOC_MAGIC, 2, int)
#define SHFXM_MODIFY_VOICE_RX       	    _IOW(SYNWAY_IOC_MAGIC, 3, int)
#define SHFXM_MODIFY_EC			             IOW(SYNWAY_IOC_MAGIC, 4, int)
#define SHFXM_MODIFY_CODEC_VOICE_TX	    _IOW(SYNWAY_IOC_MAGIC, 5, int)
#define SHFXM_MODIFY_CODEC_VOICE_RX     _IOW(SYNWAY_IOC_MAGIC, 6, int)
Declare the following struct:
Struct shfxm_cmd_ops 
{
				int card;
				int channel;
				int value;
};

The meanings of the parameters in the above struct are:
card: The board number (count from 0);
channel: The channel number on a certain board (count from 0, with the maximum number of 31);
value: The value to be set
Note: If you want to adjust the gain increase or decrease (IOCTL is set to SHFXM_MODIFY_CODEC_VOICE_TX, SHFXM_MODIFY_CODEC_VOICE_RX), the value mentioned herein indicates the value of register to be set (Attention that the set values of FXS and FXO ports are quite different. As to an FXO port, the registers you need to adjust are Register 38, Register 39, Register 40 and Register 41 of the Si3050 Chip. As to an FXS port, the registers you need to adjust are Indirect Register 13 and Indirect Register 14 of the Si3215 Chip. For more information about these registers refer to the corresponding 'DataSheet'). If you want to adjust the impedance (IOCTL is set to SHFXM_MODIFY_IMPEDANCE), the value mentioned herein indicates the value of the register for impedance adjustment. For more information, see the corresponding 'DATASHEET'. If IOCTL is set to SHFXM_MODIFY_EC, value=1 means the echo cancellation switch of this channel is enabled, and value=0 means the echo cancellation switch of this channel is disabled.
The adjustment range and corresponding values for FXS ports are as follows:

Outgoing: The adjustment range is [0x0, 0x7FF].
          If it is set to 0x0, the corresponding value will be -∞.
          If it is set to 0x400, the corresponding value will be 0.
          If it is set to 0x7FF, the corresponding value will be 6dB.
Incoming: The adjustment range is [0x0, 0x7FF].
          If it is set to 0x0, the corresponding value will be -∞.
          If it is set to 0x400, the corresponding value will be 0.
          If it is set to 0x7FF, the corresponding value will be 6dB.

The adjustment range and corresponding values for FXO ports are as follows:
The setting format is ‘abbacc’.
a=0 means to adjust gain increase; a=1 means to adjust gain decrease.
To adjust gain increase, the value range of ‘bb’ is [0, 12]; to adjust gain decrease, the value range of ‘bb’ is [0, 15].
To adjust gain increase, the value range of ‘cc’ is [0, 12]; to adjust gain decrease, the value range of ‘cc’ is [0, 15].
Once the value of bb increases 1, the gain increases or decreases by 1dB. Therefore, by adjusting the value of bb, you can get the maximum gain increase of 12dB or gain decrease of 15dB.
Once the value of cc increases 1, the gain increases or decreases by 0.1dB. Therefore, by adjusting the value of cc, you can get the maximum gain increase of 1.2dB or gain decrease of 1.5dB.

How to adjust the value of 'Loop Current' for FXS modules on FXM32 series boards?

#insmod fxm32.ko loopcurrent=val (The unit is mA and the value range of val is 20~41. Once the value is out of this range, it will be reset to the default value of 20mA.)