lixinswitchpi / oakr2

5 stars 2 forks source link

Garbled audio on FXS port #3

Open mbof opened 4 years ago

mbof commented 4 years ago

Setup

Observed:

Phone A rings. When Phone A is picked up, the audio is completely garbled in both directions.

Any hints about how to troubleshoot?

mbof commented 4 years ago

Additional information: the timing provided by pitdm seems off by a factor 2x:

With only dahdi loaded:

$ sudo dahdi_test -v
Opened pseudo dahdi interface, measuring accuracy...

8192 samples in 8159.256 system clock sample intervals (99.600%)
8192 samples in 8158.424 system clock sample intervals (99.590%)
8192 samples in 8161.639 system clock sample intervals (99.629%)
...

With dahdi and pidma loaded:

$ sudo dahdi_test -v
Opened pseudo dahdi interface, measuring accuracy...

8192 samples in 8159.248 system clock sample intervals (99.600%)
8192 samples in 8158.144 system clock sample intervals (99.587%)
8192 samples in 8239.151 system clock sample intervals (99.424%)
...

With dahdi, pidma and pitdm loaded:

$ sudo dahdi_test -v
Opened pseudo dahdi interface, measuring accuracy...

8192 samples in 4095.592 system clock sample intervals (49.995%)
8192 samples in 4093.680 system clock sample intervals (49.972%)
8192 samples in 4094.960 system clock sample intervals (49.987%)
...

In other words, once pitdm is loaded, the 8192 samples of the test are being read in about half the expected time. That would explain why the sound is played slowed down in one direction and choppy in the other direction. In case it matters, the FXO port is not connected.