DVSwitch / Analog_Bridge

Bridge AMBE / IMBE to PCM
23 stars 30 forks source link

Add support for DVMega AMBE 3000 #2

Open marrold opened 6 years ago

marrold commented 6 years ago

Copied from Previous Repo

Hi All,

I have recently been experimenting with the DVMega AMBE 3000 and Analog Bridge.

By default the DVMega AMBE 3000 defaults to CODEC mode with Comfort Noise and Voice Activity Detection enabled, causing it to to spit out AMBE packets unprompted.

Overriding this hardware setting is fairly simple, it's just a case of sending a 'PKT_RESETSOFTCFG' packet in the following format-

61 00 07 00 34 05 00 00 0F 00 00

and waiting for the corresponding 'PKT_READY' response-

61 00 01 00 39

If possible could we get this merged into Analog_Bridge? I attempted to create a 'proxy' to sit in between Analog_Bridge and the AMBE Chip, but I can't get the code running fast enough.

Analog_Bridge would need to send the PKT_RESETSOFTCFG when it first connects to the AMBE 3000, and if it subsequently looses connection or resets.

Thanks!

marrold commented 6 years ago

Copied from previous Repo

Hi,

I have been playing with the AMBE chip again, and discovered its recommended that before sending the PKT_RESETSOFTCFG command, that you send 350 bits of zeros to clear out any buffers on the AMBE chip. This is as per the DVSI sample code.

Anyway, please don't consider this a 'bump', I just thought I'd append it to the Github issue before I forget.

Thanks

marrold commented 6 years ago

With this latest version of Analog_Bridge from the DVSwitch repo, I can see some changes to the control packets used to initialise the AMBE chip:

D: 2018-06-04 20:48:42,194 I/O: Sending to DSP: 0x61 0x00 0x01 0x00 0x30
D: 2018-06-04 20:48:42,214 I/O: Received Frame from DSP- 0x61 0x00 0x0b 0x00 0x30 0x41 0x4d 0x42 0x45 0x33 0x30 0x30 0x30 0x52 0x00
D: 2018-06-04 20:48:42,221 I/O: Sending to DSP: 0x61 0x00 0x07 0x00 0x34 0x05 0x00 0x00 0x0f 0x00 0x00
D: 2018-06-04 20:48:42,245 I/O: Received Frame from DSP- 0x61 0x00 0x01 0x00 0x39
D: 2018-06-04 20:48:42,252 I/O: Sending to DSP: 0x61 0x00 0x0d 0x00 0x0a 0x04 0x31 0x07 0x54 0x24 0x00 0x00 0x00 0x00 0x00 0x6f 0x48
D: 2018-06-04 20:48:42,261 I/O: Received Frame from DSP- 0x61 0x00 0x02 0x00 0x0a 0x00

But it fails, presumably because Analog_Bridge receives an unexpected response to the PKT_PRODID request:

D: 2018-06-04 20:53:04.965 Attempt to  init DV3000 in DMR mode
M: 2018-06-04 20:53:04.965 Connecting to DV3000 hardware......
W: 2018-06-04 20:53:09.977 Serial: response header not fully read
W: 2018-06-04 20:53:09.982 Serial port open succeeded but no response from dv3000.  Wrong baud rate?
W: 2018-06-04 20:53:09.983 DV3000 not found at /dev/ttyUSB0:230400

I have a couple of suggestions when someone has time:

  1. Send the after PKT_PRODID request after the PKT_RESETSOFTCFG request and subsequent PKT_READY response
  2. Pad the PKT_RESETSOFTCFG request with 350 bits of zeros, as per DVSI sample code.

So it should go something like:

Tx PKT_RESETSOFTCFG: 
0x00 0x00 .... 0x00 0x00 0x61 0x00 0x07 0x00 0x34 0x05 0x00 0x00 0x0f 0x00 0x00 

Rx PKT_READY: 
0x61 0x00 0x01 0x00 0x39

Tx PKT_PRODID : 
0x61 0x00 0x01 0x00 0x30

Rx PKT_PRODID  Response: 
0x61 0x00 0x0b 0x00 0x30 0x41 0x4d 0x42 0x45 0x33 0x30 0x30 0x30 0x52 0x00

Tx PKT_RATEP: 
0x61 0x00 0x0d 0x00 0x0a 0x04 0x31 0x07 0x54 0x24 0x00 0x00 0x00 0x00 0x00 0x6f 0x48

Rx PKT_RATEP Response: 
0x61 0x00 0x02 0x00 0x0a 0x00

I've got my DVMega AMBE 3000 working via alternative means, so this isn't urgent. Just thought I'd report the issue as Analog_Bridge is being actively worked on.

Thanks again!

P.S: If you guys need access to a host with a DVMega AMBE 3000, let me know.