Opened 16 years ago

Last modified 16 years ago

#504 closed defect

Fixed support for stereo audio all the way in pjmedia — at Version 4

Reported by: nanang Owned by: bennylp
Priority: normal Milestone: release-0.9.0
Component: pjmedia Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported:

Description (last modified by bennylp)

Identified issues:

  1. The PA callbacks implementations contains wrong assertion, because of samples_per_frame misinterpretation (thanks Rodrigo Vega, http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2008-March/001974.html):
    • Soundport's samples_per_frame is total samples number per frame of ALL channels.
    • While PA's frameCount refers to number of samples for EACH channel.
  2. Lack of channel_count multiplication in samples_per_frame calculation in some parts of stream causing silence in stereo audio call.
  3. STEREO_DEMO in pjsua causing crash in PortAudio without call (perhaps because of some pointer to PA buffer get overwritten)
  4. Add channel_count field in pjsua_media_config to configure number of channels for both sound device and conference bridge. Add --stereo option in pjsua to change set this channel_count field to 2.
  5. Create two utility functions to:
    1. convert one mono channel audio frame to N-channel audio frame. Just duplicate the sample to all channels.
    2. convert N-channel audio from to mono audio frame. The function should have an option to either mix sample from all the channels into one channel, or to just take audio samples from one of the channel. To make the implementation simpler, we can just implement these two functions as inline functions in a new header file (e.g., stereo.h) rather than a media port.
  6. Use these channel conversion functions in the conference bridge, to convert audio samples from media ports when the media port has different channel number with the conference bridge.

Change History (6)

Changed 16 years ago by nanang

Fixed assertion param in PortAudio?'s callback implementation

comment:1 Changed 16 years ago by bennylp

Patch ticket504.patch committed in r1848, thanks.

comment:2 Changed 16 years ago by nanang

  • Description modified (diff)
  • Summary changed from Wrong assertion param in portaudio callbacks (thanks Rodrigo Vega) to Problem in multichannel audio

Changed 16 years ago by nanang

Fixed calculation of samples_per_frame in stream port

comment:3 Changed 16 years ago by bennylp

  • Summary changed from Problem in multichannel audio to Fixed support for stereo audio all the way in pjmedia

Committed 'ticket504.2.patch' as is in r1861, thanks.

comment:4 Changed 16 years ago by bennylp

  • Description modified (diff)
  • Owner changed from nanang to bennylp
  • Status changed from new to assigned
Note: See TracTickets for help on using tickets.