aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2017-12-31Add an 'osmo_gapk' prefix to the exposed symbolsVadim Yanitskiy26-129/+133
To avoid a naming conflict between libosmogapk and other projects during linkage, all the exposed symbols should have an unique prefix. Let's use 'osmo_gapk' for that.
2017-12-31procqueue: expose the processing queue struct definitionVadim Yanitskiy1-10/+0
To be able to use processing queues from outside, the pq struct should be shared in the corresponding header file.
2017-12-31Install GAPK headers to '${includedir}/osmocom/gapk/'Vadim Yanitskiy26-63/+63
To be able to use the library, external applications need to know, which symbols are exposed. This information is provided by header files, which are being installed to a system's ${includedir} since this change.
2017-12-31Add an 'osmo' prefix to the 'gapk' binaryVadim Yanitskiy1-4/+4
This is a common practice of all Osmocom executables to have an 'osmo' prefix. Let's follow this here too.
2017-12-31Introduce a shared 'libosmogapk' libraryVadim Yanitskiy1-15/+85
The previous GAPK implementation was represented as a single executable. So, all audio transcoding operations were available only by calling the 'gapk' binary. This approach didn't allow external applications to benefit from using GAPK API directly. Since there are some projects (such as GR-GSM and OsmocomBB), which are potential users of GAPK code base, it would be better to have all transcoding functions within a shared library. So, this change separates the common code into a shared library, named 'libosmogapk', and links the 'gapk' binary against one. Currently there are no shared headers, pkg-config manifest and the export map, but they will be done latter.
2017-09-02pq_alsa.c: print error message if device init failsVadim Yanitskiy1-3/+9
2017-09-02pq_alsa.c: handle output buffer underrunVadim Yanitskiy1-0/+8
On some systems the ALSA output buffer is pretty big, and if the audio samples are not being passed into the buffer quickly enough, it becomes starved for data, resulting in an error called underrun. Previously, when it happenned, GAPK used to stop processing with the following message (where X is a random number): [+] PQ: Adding ALSA output (dev='default', blk_len=320) [!] pq_execute(): abort, item returned -1 [+] Processed X frames According to the ALSA documentation, the pcm_handle changes its state when the problem happens, and should be recovered using the snd_pcm_prepare() call. This change actually does that.
2017-05-29fmt_gsm: document that this format is also used for RTPv0.4Harald Welte1-1/+1
2017-05-28fmt_rtp_hr_ietf.c: Fix error encoding this formatHarald Welte1-1/+1
We used the wrong length constant during encoding of RTP-HR IETF style.
2017-05-28EFR codec fixup.Harald Welte1-2/+2
While EFR has a canonical format of 31 bytes, the codec_efr.c *does not* use that canonical format as input. Rather, it uses the format of .amr files with a 0x3C header as first byte. So the resulting encode/decode functions should not assume 31 bytes, but 32 bytes.
2017-05-28alsa/file input: return -1 on eof (short read)Harald Welte2-4/+4
This will permit for a more graceful error than the next element in the processing chain complaining that there's a 0-length input.
2017-05-28procqueue.c: Logging unficiation (always use the [x] prefix)Harald Welte1-3/+3
2017-05-28codac_amr: Remove printf() left from debugging/testingHarald Welte1-2/+0
2017-05-28direct all log statements to stderr to avoid breaking stdout data outHarald Welte5-18/+21
The tool has the capability to be used in a pipe, so stdout should recevie nothing else but actual codec/pcm data.
2017-05-28fmt_ti: fix lsb/msb mix-up in ti_hr_from_canon()Harald Welte1-1/+1
I noticed that ti-hr format doesn't pass an encode-decode-playback test, and discussion with tnt resulted in the following conclusion: 19:29 <@tnt> looking at fr and efr, it's always msb_xxx 19:30 <@tnt> and if I ever used it, then most likely it was for decoding meaning ti_hr_to_canon would have been used and not the other way around.
2017-05-28print_help(): Fix formatting of help textHarald Welte1-4/+2
2017-05-28Add support for RTP with GSM-HR payload according to RFC5993Harald Welte3-1/+83
This is incompatible with the ETSI TS 101 318 format!
2017-05-28Add support for RTP with GSM-HR payload according to ETSI TS 101 318Harald Welte3-1/+65
2017-05-28Add "rtp-efr" format support for RTP payload according to RFC3551 4.5.9Harald Welte3-1/+76
The RTP EFR payload is a bit like the FR payload: one nibble magic marker, then followed by the actual codec bits. So we need to add/remove that magic marker and shift the remainder by one nibble.
2017-05-28Fix HR codec block sizesHarald Welte2-5/+2
The ETSI reference codec actually uses an array of 20/22 16bit values rather than a "canonical" format. The conversion is what fmt_hr_ref.c is doing. However, codec_hr.c must then subsequently not check for the canonical input/output sizes, but those specific to it.
2017-05-28Print some useful information while putting together the procqueueHarald Welte5-0/+13
2017-05-28print meaningful error messages if something goes wrong in main/pqHarald Welte3-10/+34
2017-05-28Add AMR codec supportHarald Welte6-2/+240
After merging this change, there is support for the AMR codec (by means of libopencore-amr, which is already used for EFR). In terms of gapk formats, we introdude * the "amr-opencore" format, which serves both as the canonical format, and as the input format to opencore-amrnb itself. * the "rtp-amr" format, which is the payload of RFC4867 octet-aligned mode You can use the following command for a real-time RTP playback for AMR frames: ./gapk -I 0.0.0.0/30000 -f rtp-amr -A default -g rawpcm-s16le
2017-05-28prepare gapk for dealing with variable-length framesHarald Welte14-96/+188
The existing architecture was modelled around fixed-length codec frame sizes, which of course fails with multi-rate codecs such as AMR.
2017-05-28introduce #defines for canonical length + use themHarald Welte5-5/+5
2017-05-28Add ALSA input/output support to GAPKHarald Welte3-6/+210
The ALSA source/sink uses the pcm-s16le format.
2017-05-28RTP: give meaningful error messages if something failsHarald Welte1-8/+24
In fact, it should probably be better to silently ignore all those errors as opposed to aborting the entire processing queue? But that's for another patch...
2017-05-27add some more comments throughout the codeHarald Welte7-1/+53
2015-12-30main: Fixup the help screenSylvain Munaut1-1/+1
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-12-30benchmark: Make sure to print to stderrSylvain Munaut1-2/+4
stdout can be used for data output ... Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-05-08Add cycle benchmarking supportHarald Welte6-4/+83
This enables benchmarking of the codec. It will print the amount of CPU cycles needed for encoding/decoding a single 20ms frame on average.
2013-06-17build: Use AM_CPPFLAGS in Makefile.amSylvain Munaut1-1/+1
Since automake 1.13 INCLUDES is depricates and causes a warning Inspired from similar patches by Alexander Huemer for other osmocom projects Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-02-11gapk: make sure the output file is closed/flushed on ctrl+cHarald Welte1-1/+21
This is useful particularly in case you are reading from RTP and writing to a file, and don't want truncated codec frames in your file.
2013-02-11gapk: Add support for RTP input/output streamsHarald Welte3-13/+343
Instead of having only file-based I/O, this enables gapk to receive and send RTP streams, e.g. from live GSM network equipment like sysmoBTS/nanoBTS. Support is currently simplistic. On transmit, there is hard-coded codec type of full-rate GSM. On receive-side, we should auto-detect the format based on frame size and/or payload type, but we don't do that yet at all.
2013-02-11gapk main: move fh_in and fh_out to sub-structures in a unionHarald Welte1-16/+31
this is done in preparation to provide something else but file input/output.
2012-12-08codec: Fix opencore nb include pathSylvain Munaut1-2/+2
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-02-25format/fmt_ti: Add support for EFR variantSylvain Munaut2-0/+90
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-02-25format/fmt_ti: Add support for HR variantSylvain Munaut2-0/+58
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-02-25format: Add support for the TI calypso/locosto dumped buffer formatSylvain Munaut3-1/+81
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-12codec: Fix EFR codec encoder function. Return value is #bytesSylvain Munaut1-1/+1
32 is the normal value Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-12[4/4] HR support: Add hooks in gapk to use libgsmhr for encoding/decodingSylvain Munaut2-0/+49
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-11Add a real main method to does the jobSylvain Munaut1-1/+405
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-11format: Add support for Raw PCM Signed 16 bits Little EndianSylvain Munaut3-0/+63
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-11procqueue: Add Codec tasksSylvain Munaut2-1/+70
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-11procqueue: Add format conversion tasksSylvain Munaut2-1/+62
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-11procqueue: Add file related tasksSylvain Munaut2-1/+100
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-11procqueue: Add some mechanism to queue 'processing items' on the framesSylvain Munaut2-0/+133
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-11codec/efr: Add support for encoding/decoding using OpenCore AMR NBSylvain Munaut2-2/+88
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-11codec/fr: Add support for encoding/decoding using libgsmSylvain Munaut2-1/+60
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-11-11format: Add function to get format by nameSylvain Munaut1-0/+15
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>