Project

General

Profile

Actions

Feature #3400

open

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

Added by fixeria over 4 years ago. Updated 44 minutes ago.

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

80%

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
  • Compose codec support in Classmark depending on PHY capabilities and GAPK codec support
  • Investigate the problem with unpleasant audio effects
  • Get patches from fixeria/audio merged to master
  • libosmo-gapk should be optional dependency
  • AMR (AHS/AFS) support

Related issues

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

Actions
Blocked by OsmocomBB - Feature #1461: include some version information / negotiation in the L1CTL protocolStalledfixeria

Actions
Actions #1

Updated by fixeria over 4 years ago

  • Tracker changed from Bug to Feature
Actions #2

Updated by fixeria over 4 years ago

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

Updated by fixeria over 4 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 4 years ago

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

Updated by fixeria over 4 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 about 4 years ago

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

Updated by fixeria about 4 years ago

  • Status changed from In Progress to Stalled
Actions #8

Updated by laforge almost 3 years ago

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

Updated by fixeria 14 days ago

  • Status changed from Stalled to In Progress
Actions #10

Updated by fixeria 11 days 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 9 days 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 9 days ago

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

Updated by fixeria 3 days 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 about 22 hours 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 44 minutes 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

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)