Project

General

Profile

Actions

Feature #3400

closed

mobile: implement GAPK based audio capture / playback (via ALSA)

Added by fixeria over 5 years ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
OsmocomBB mobile (host)
Start date:
07/17/2018
Due date:
% Done:

100%

Resolution:
Spec Reference:

Description

There is an initial implementation of GAPK based audio back-end in fixeria/audio.

The current implementation is limited, so TODO/FIXME:

  • init both I/O processing chains when CHANNEL MODE MODIFY is received,
  • deinit both I/O chains when a call is finished,
  • take care about PHY specific frame formats (e.g. TI),
  • optimize the application loop in order to improve performance,
  • support other than GSM FR codecs (currently FR is hardcoded),
  • compose codec support in Classmark depending on PHY capabilities and GAPK codec support.

Some points require a possibility to know the PHY features, such as:

  • TCH frame forwarding capability,
  • preferred TCH frame format,
  • full rate / half rate channel support,
  • AMR codec over FR / HR channel support.

Checklist

  • Init both I/O processing chains when CHANNEL MODE MODIFY is received
  • Support other than GSM FR codecs (currently FR is hardcoded)
  • Deinit both I/O chains when a call is finished
  • Take care about PHY specific frame formats (e.g. TI)
  • Optimize the application loop in order to improve performance
  • Investigate the problem with unpleasant audio effects
  • Get patches from fixeria/audio merged to master
  • libosmo-gapk should be optional dependency

Related issues

Related to OsmocomBB - Feature #4422: implement audio loop-back in mobileResolvedneels02/27/2020

Actions
Related to OsmocomBB - Feature #5812: mobile: missing AMR supportNew12/06/2022

Actions
Related to OsmocomBB - Feature #5815: mobile: compose Bearer Capability IE depending on PHY capabilities and GAPK codec supportNew12/06/2022

Actions
Actions #1

Updated by fixeria over 5 years ago

  • Tracker changed from Bug to Feature
Actions #2

Updated by fixeria over 5 years ago

  • Blocked by Feature #1461: include some version information / negotiation in the L1CTL protocol added
Actions #3

Updated by fixeria over 5 years ago

  • Checklist item Init both I/O processing chains when CHANNEL MODE MODIFY is received added
  • Checklist item Support other than GSM FR codecs (currently FR is hardcoded) added
  • Checklist item Deinit both I/O chains when a call is finished added
  • Checklist item Take care about PHY specific frame formats (e.g. TI) added
  • Checklist item Optimize the application loop in order to improve performance added
  • Checklist item Compose codec support in Classmark depending on PHY capabilities and GAPK codec support added
Actions #4

Updated by fixeria over 5 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 50
Actions #5

Updated by fixeria over 5 years ago

  • Checklist item Optimize the application loop in order to improve performance set to Done

The performance problem is actually caused by blocking calls of src/pq_alsa.c/pq_cb_alsa_input()/snd_pcm_readi().
Setting both buffer and period size values seems to solve the issue. A separate issue needs to be created...

Actions #6

Updated by fixeria over 5 years ago

  • Checklist item Investigate the problem with unpleasant audio effects added
Actions #7

Updated by fixeria over 5 years ago

  • Status changed from In Progress to Stalled
Actions #8

Updated by laforge about 4 years ago

  • Related to Feature #4422: implement audio loop-back in mobile added
Actions #9

Updated by fixeria over 1 year ago

  • Status changed from Stalled to In Progress
Actions #10

Updated by fixeria over 1 year ago

After rebasing fixeria/audio on top of the recent master I got the audio working with Mot C1xx.
Still need to test with trxcon. Will update commit messages and submit patches to Gerrit soon.

Actions #11

Updated by fixeria over 1 year ago

  • Checklist item Get patches from @fixeria/audio@ merged to master added

fixeria wrote in #note-10:

After rebasing fixeria/audio on top of the recent master I got the audio working with Mot C1xx.
Still need to test with trxcon. Will update commit messages and submit patches to Gerrit soon.

Commit messages updated, all patches submitted for review:

https://gerrit.osmocom.org/c/osmocom-bb/+/30324 layer23: l1ctl_tx_traffic_req(): cosmetic: drop dead code [NEW]
https://gerrit.osmocom.org/c/osmocom-bb/+/30325 mobile: add MNCC socket path to settings [NEW]
https://gerrit.osmocom.org/c/osmocom-bb/+/30326 mobile: add MNCC handler selection to settings [NEW]
https://gerrit.osmocom.org/c/osmocom-bb/+/30327 mobile: allow enabling/disabling handling of voice in the L1PHY [NEW]
https://gerrit.osmocom.org/c/osmocom-bb/+/30328 mobile: gsm48_rr_set_mode(): print name of channel mode [NEW]
https://gerrit.osmocom.org/c/osmocom-bb/+/30329 mobile: gsm48_rr_set_mode(): check rc of rsl_dec_chan_nr() [NEW]
https://gerrit.osmocom.org/c/osmocom-bb/+/30330 mobile: gsm48_rr_set_mode(): print error if ch_type is not TCH [NEW]
https://gerrit.osmocom.org/c/osmocom-bb/+/30331 mobile: gsm48_rr_set_mode(): fix copy-paste in comment [NEW]
https://gerrit.osmocom.org/c/osmocom-bb/+/30332 mobile: properly handle RR CHANNEL MODE MODIFY message [NEW]
https://gerrit.osmocom.org/c/osmocom-bb/+/30333 mobile: gsm48_rr_tx_voice(): drop TCH/F channel limitation [NEW]
https://gerrit.osmocom.org/c/osmocom-bb/+/30334 mobile: voice.h: use '#pragma once' include guard [NEW]
https://gerrit.osmocom.org/c/osmocom-bb/+/30335 mobile: voice.h: add missing forward declarations [NEW]
https://gerrit.osmocom.org/c/osmocom-bb/+/30336 mobile: split gsm_send_voice() -> gsm_send_voice_{msg,frame}() [NEW]
https://gerrit.osmocom.org/c/osmocom-bb/+/30337 mobile: integrate GAPK based audio (voice) I/O support [NEW]

I also force-pushed to https://cgit.osmocom.org/osmocom-bb/log/?h=fixeria/audio.

Actions #12

Updated by fixeria over 1 year ago

  • Checklist item libosmo-gapk should be optional dependency added
Actions #13

Updated by fixeria over 1 year ago

  • Checklist item Get patches from @fixeria/audio@ merged to master set to Done
  • Checklist item libosmo-gapk should be optional dependency set to Done
  • % Done changed from 50 to 60

All patches have been merged, so I removed https://cgit.osmocom.org/osmocom-bb/log/?h=fixeria/audio.

Actions #14

Updated by fixeria over 1 year ago

  • Checklist item Deinit both I/O chains when a call is finished set to Done
  • Checklist item Take care about PHY specific frame formats (e.g. TI) set to Done
  • % Done changed from 60 to 80

https://gerrit.osmocom.org/c/osmocom-bb/+/30454 mobile: clean up GAPK I/O state on channel release [NEW]
https://gerrit.osmocom.org/c/osmocom-bb/+/30455 mobile: support RTP and TI specific TCH frame I/O formats [NEW]

Actions #15

Updated by fixeria over 1 year ago

  • Checklist item AMR (AHS/AFS) support added
  • Status changed from In Progress to Stalled

With a few additional patches applied:

https://gerrit.osmocom.org/c/osmocom-bb/+/30483 mobile: do not enforce RTP format for Uplink TCH frames [NEW]
https://gerrit.osmocom.org/c/osmocom-bb/+/30484 firmware: remove TCH/F specific bit re-ordering [NEW]
https://gerrit.osmocom.org/c/gapk/+/30482 libgsmhr/fetch_sources.py: convert to Python 3

I have successfully tested GAPK based audio I/O with both trxcon and a Mot C1xx phone. The non-adaptive codecs (HR, FR, EFR) are all confirmed to work. AMR implementation is currently incomplete in trxcon, and is completely missing in the layer1 firmware (needs DSP patches); adding a checklist item for this. I think at the current state it qualifies as a working voice call functionality, so I am stopping to work on this ticket and setting it to Stalled.

Actions #16

Updated by laforge over 1 year ago

On Mon, Dec 05, 2022 at 10:57:58PM +0000, fixeria wrote:

I have successfully tested GAPK based audio I/O with both trxcon and a Mot C1xx phone. The non-adaptive codecs (HR, FR, EFR) are all confirmed to work. AMR implementation is currently incomplete in trxcon, and is completely missing in the layer1 firmware (needs DSP patches); adding a checklist item for this. I think at the current state it qualifies as a working voice call functionality, so I am stopping to work on this ticket and setting it to Stalled.

IMHO it makes mor sence to resolve this ticket once all patches for non-AMR are merged. Add a new issue for
AMR support, with no assignee and low priority.

Actions #17

Updated by fixeria over 1 year ago

  • Checklist item deleted (AMR (AHS/AFS) support)

laforge wrote in #note-16:

IMHO it makes mor sence to resolve this ticket once all patches for non-AMR are merged. Add a new issue for
AMR support, with no assignee and low priority.

Ack, please see #5812.

Actions #18

Updated by fixeria over 1 year ago

Actions #19

Updated by fixeria over 1 year ago

  • Related to Feature #5815: mobile: compose Bearer Capability IE depending on PHY capabilities and GAPK codec support added
Actions #20

Updated by fixeria over 1 year ago

  • Blocked by deleted (Feature #1461: include some version information / negotiation in the L1CTL protocol)
Actions #21

Updated by fixeria over 1 year ago

  • Checklist item deleted (Compose codec support in Classmark depending on PHY capabilities and GAPK codec support)

See #5815.

Actions #22

Updated by fixeria over 1 year ago

  • Status changed from Stalled to Feedback
Actions #23

Updated by fixeria over 1 year ago

  • Status changed from Feedback to Resolved
  • % Done changed from 80 to 100

All patches have been merged. Voice quality is good, except when using libgsmhr (via libosmo-gapk.so). This can be investigated later.

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)