From 5babf61cddbd02100e5a4017deec09eb55fc1d32 Mon Sep 17 00:00:00 2001 From: tomoki hanzawa Date: Tue, 15 Sep 2015 14:24:08 +0900 Subject: [PATCH 1/3] Support GB specific supervisory tone Modified gb's SupervisoryTone when the following ToneType is selected to cover GB market/operators requirement. - TONE_SUP_DIAL - TONE_SUP_BUSY - TONE_SUP_CONGESTION Bug: 63121347 Test: Build and Test ringback tone for UK. Change-Id: I248b1b27f4156de37fd07bc878be719e3f6d6b95 --- media/libaudioclient/ToneGenerator.cpp | 18 +++++++++++++++--- .../include/media/ToneGenerator.h | 2 ++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/media/libaudioclient/ToneGenerator.cpp b/media/libaudioclient/ToneGenerator.cpp index 9bc2594bfb..38a6514452 100644 --- a/media/libaudioclient/ToneGenerator.cpp +++ b/media/libaudioclient/ToneGenerator.cpp @@ -740,6 +740,18 @@ const ToneGenerator::ToneDescriptor ToneGenerator::sToneDescriptors[] = { { .duration = 0 , .waveFreq = { 0 }, 0, 0}}, .repeatCnt = ToneGenerator::TONEGEN_INF, .repeatSegment = 0 }, // TONE_JAPAN_RADIO_ACK + { .segments = { { .duration = 375, .waveFreq = { 400, 0 }, 0, 0 }, + { .duration = 375, .waveFreq = { 0 }, 0, 0 }, + { .duration = 0 , .waveFreq = { 0 }, 0, 0}}, + .repeatCnt = ToneGenerator::TONEGEN_INF, + .repeatSegment = 0 }, // TONE_GB_BUSY + { .segments = { { .duration = 400, .waveFreq = { 400, 0 }, 0, 0 }, + { .duration = 350, .waveFreq = { 0 }, 0, 0 }, + { .duration = 225, .waveFreq = { 400, 0 }, 0, 0 }, + { .duration = 525, .waveFreq = { 0 }, 0, 0 }, + { .duration = 0 , .waveFreq = { 0 }, 0, 0}}, + .repeatCnt = ToneGenerator::TONEGEN_INF, + .repeatSegment = 0 }, // TONE_GB_CONGESTION { .segments = { { .duration = 400, .waveFreq = { 400, 450, 0 }, 0, 0 }, { .duration = 200, .waveFreq = { 0 }, 0, 0 }, { .duration = 400, .waveFreq = { 400, 450, 0 }, 0, 0 }, @@ -797,9 +809,9 @@ const unsigned char /*tone_type*/ ToneGenerator::sToneMappingTable[NUM_REGIONS-1 TONE_SUP_RINGTONE // TONE_SUP_RINGTONE }, { // GB - TONE_SUP_DIAL, // TONE_SUP_DIAL - TONE_SUP_BUSY, // TONE_SUP_BUSY - TONE_SUP_CONGESTION, // TONE_SUP_CONGESTION + TONE_ANSI_DIAL, // TONE_SUP_DIAL + TONE_GB_BUSY, // TONE_SUP_BUSY + TONE_GB_CONGESTION, // TONE_SUP_CONGESTION TONE_SUP_RADIO_ACK, // TONE_SUP_RADIO_ACK TONE_SUP_RADIO_NOTAVAIL, // TONE_SUP_RADIO_NOTAVAIL TONE_SUP_ERROR, // TONE_SUP_ERROR diff --git a/media/libaudioclient/include/media/ToneGenerator.h b/media/libaudioclient/include/media/ToneGenerator.h index fc3d3eeefe..b702447f20 100644 --- a/media/libaudioclient/include/media/ToneGenerator.h +++ b/media/libaudioclient/include/media/ToneGenerator.h @@ -194,6 +194,8 @@ private: TONE_JAPAN_BUSY, // Busy tone: 400Hz, 500ms ON, 500ms OFF... TONE_JAPAN_RADIO_ACK, // Radio path acknowlegment: 400Hz, 1s ON, 2s OFF... // GB Supervisory tones + TONE_GB_BUSY, // Busy tone: 400 Hz, 375ms ON, 375ms OFF... + TONE_GB_CONGESTION, // Congestion Tone: 400 Hz, 400ms ON, 350ms OFF, 225ms ON, 525ms OFF... TONE_GB_RINGTONE, // Ring Tone: A 400Hz + 450Hz tone repeated in a 0.4s on, 0.2s off, 0.4s on, 2.0s off pattern. // AUSTRALIA Supervisory tones TONE_AUSTRALIA_RINGTONE, // Ring tone: A 400Hz + 450Hz tone repeated in a 0.4s on, 0.2s off, 0.4s on, 2.0s off pattern. From 879996a5f7419819cf9318917d6c82068950a034 Mon Sep 17 00:00:00 2001 From: Toshikazu Saito Date: Fri, 3 Mar 2017 18:04:14 +0900 Subject: [PATCH 2/3] Support Australia specific supervisory tone The change in "Australia Supervisory DIAL tone" seems not following ITU-T specification. This patch implements TONE_AUSTRALIA_DIAL as per ITU-T specification. Bug: 63120712 Test: Build and test ringback tone for Australia Change-Id: I7409732e57cf8d39ac2248e7e3e10217e30a118e --- media/libaudioclient/ToneGenerator.cpp | 6 +++++- media/libaudioclient/include/media/ToneGenerator.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/media/libaudioclient/ToneGenerator.cpp b/media/libaudioclient/ToneGenerator.cpp index 38a6514452..ea856af2ea 100644 --- a/media/libaudioclient/ToneGenerator.cpp +++ b/media/libaudioclient/ToneGenerator.cpp @@ -759,6 +759,10 @@ const ToneGenerator::ToneDescriptor ToneGenerator::sToneDescriptors[] = { { .duration = 0, .waveFreq = { 0 }, 0, 0}}, .repeatCnt = ToneGenerator::TONEGEN_INF, .repeatSegment = 0 }, // TONE_GB_RINGTONE + { .segments = { { .duration = ToneGenerator::TONEGEN_INF, .waveFreq = { 400, 425, 450, 0 }, 0, 0 }, + { .duration = 0 , .waveFreq = { 0 }, 0, 0}}, + .repeatCnt = ToneGenerator::TONEGEN_INF, + .repeatSegment = 0 }, // TONE_AUSTRALIA_DIAL { .segments = { { .duration = 400, .waveFreq = { 400, 450, 0 }, 0, 0 }, { .duration = 200, .waveFreq = { 0 }, 0, 0 }, { .duration = 400, .waveFreq = { 400, 450, 0 }, 0, 0 }, @@ -819,7 +823,7 @@ const unsigned char /*tone_type*/ ToneGenerator::sToneMappingTable[NUM_REGIONS-1 TONE_GB_RINGTONE // TONE_SUP_RINGTONE }, { // AUSTRALIA - TONE_ANSI_DIAL, // TONE_SUP_DIAL + TONE_AUSTRALIA_DIAL, // TONE_SUP_DIAL TONE_AUSTRALIA_BUSY, // TONE_SUP_BUSY TONE_AUSTRALIA_CONGESTION, // TONE_SUP_CONGESTION TONE_SUP_RADIO_ACK, // TONE_SUP_RADIO_ACK diff --git a/media/libaudioclient/include/media/ToneGenerator.h b/media/libaudioclient/include/media/ToneGenerator.h index b702447f20..3112edb337 100644 --- a/media/libaudioclient/include/media/ToneGenerator.h +++ b/media/libaudioclient/include/media/ToneGenerator.h @@ -198,6 +198,7 @@ private: TONE_GB_CONGESTION, // Congestion Tone: 400 Hz, 400ms ON, 350ms OFF, 225ms ON, 525ms OFF... TONE_GB_RINGTONE, // Ring Tone: A 400Hz + 450Hz tone repeated in a 0.4s on, 0.2s off, 0.4s on, 2.0s off pattern. // AUSTRALIA Supervisory tones + TONE_AUSTRALIA_DIAL, // Dial tone: 425 Hz tone modulated with 25 Hz, continuous TONE_AUSTRALIA_RINGTONE, // Ring tone: A 400Hz + 450Hz tone repeated in a 0.4s on, 0.2s off, 0.4s on, 2.0s off pattern. TONE_AUSTRALIA_BUSY, // Busy tone: 425 Hz repeated in a 0.375s on, 0.375s off pattern. TONE_AUSTRALIA_CALL_WAITING,// Call waiting tone: 425Hz tone repeated in a 0.2s on, 0.2s off, 0.2s on, 4.4s off pattern. From 0f6500b61b7aaf3299eef8309c67ba2e86d2d065 Mon Sep 17 00:00:00 2001 From: Johan Gustavsson Date: Tue, 18 Mar 2014 18:21:29 +0100 Subject: [PATCH 3/3] Support Singapore specific supervisory tone Singapore use CEPT standard supervisory tones except for busy and ringtone. The Singapore mapping will be used if gsm.operator.iso-country == "sg". Bug: 63120560 Test: Build and test ring back tone for Singapore Change-Id: I86076b0799a741ad8c54968799e400622d223ccd --- media/libaudioclient/ToneGenerator.cpp | 24 +++++++++++++++++++ .../include/media/ToneGenerator.h | 6 ++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/media/libaudioclient/ToneGenerator.cpp b/media/libaudioclient/ToneGenerator.cpp index ea856af2ea..435cfa265f 100644 --- a/media/libaudioclient/ToneGenerator.cpp +++ b/media/libaudioclient/ToneGenerator.cpp @@ -787,6 +787,18 @@ const ToneGenerator::ToneDescriptor ToneGenerator::sToneDescriptors[] = { { .duration = 0 , .waveFreq = { 0 }, 0, 0}}, .repeatCnt = ToneGenerator::TONEGEN_INF, .repeatSegment = 0 }, // TONE_AUSTRALIA_CONGESTION + { .segments = { { .duration = 750, .waveFreq = { 425, 0 }, 0, 0 }, + { .duration = 750, .waveFreq = { 0 }, 0, 0 }, + { .duration = 0 , .waveFreq = { 0 }, 0, 0}}, + .repeatCnt = ToneGenerator::TONEGEN_INF, + .repeatSegment = 0 }, // TONE_SG_BUSY + { .segments = { { .duration = 400, .waveFreq = { 401, 425, 449, 0 }, 0, 0 }, + { .duration = 200, .waveFreq = { 0 }, 0, 0 }, + { .duration = 400, .waveFreq = { 401, 425, 449, 0 }, 0, 0 }, + { .duration = 2000, .waveFreq = { 0 }, 0, 0 }, + { .duration = 0 , .waveFreq = { 0 }, 0, 0}}, + .repeatCnt = ToneGenerator::TONEGEN_INF, + .repeatSegment = 0 }, // TONE_SG_RINGTONE }; // Used by ToneGenerator::getToneForRegion() to convert user specified supervisory tone type @@ -831,6 +843,16 @@ const unsigned char /*tone_type*/ ToneGenerator::sToneMappingTable[NUM_REGIONS-1 TONE_SUP_ERROR, // TONE_SUP_ERROR TONE_AUSTRALIA_CALL_WAITING,// TONE_SUP_CALL_WAITING TONE_AUSTRALIA_RINGTONE // TONE_SUP_RINGTONE + }, + { // SINGAPORE + TONE_SUP_DIAL, // TONE_SUP_DIAL + TONE_SG_BUSY, // TONE_SUP_BUSY + TONE_SUP_CONGESTION, // TONE_SUP_CONGESTION + TONE_SUP_RADIO_ACK, // TONE_SUP_RADIO_ACK + TONE_SUP_RADIO_NOTAVAIL, // TONE_SUP_RADIO_NOTAVAIL + TONE_SUP_ERROR, // TONE_SUP_ERROR + TONE_SUP_CALL_WAITING, // TONE_SUP_CALL_WAITING + TONE_SG_RINGTONE // TONE_SUP_RINGTONE } }; @@ -889,6 +911,8 @@ ToneGenerator::ToneGenerator(audio_stream_type_t streamType, float volume, bool mRegion = GB; } else if (strstr(value, "au") != NULL) { mRegion = AUSTRALIA; + } else if (strstr(value, "sg") != NULL) { + mRegion = SINGAPORE; } else { mRegion = CEPT; } diff --git a/media/libaudioclient/include/media/ToneGenerator.h b/media/libaudioclient/include/media/ToneGenerator.h index 3112edb337..d362c6862c 100644 --- a/media/libaudioclient/include/media/ToneGenerator.h +++ b/media/libaudioclient/include/media/ToneGenerator.h @@ -177,7 +177,7 @@ private: // Region specific tones. - // These supervisory tones are different depending on the region (USA/CANADA, JAPAN, rest of the world). + // These supervisory tones are different depending on the region (USA/CANADA, JAPAN, Singapore, rest of the world). // When a tone in the range [FIRST_SUP_TONE, LAST_SUP_TONE] is requested, the region is determined // from system property gsm.operator.iso-country and the proper tone descriptor is selected with the // help of sToneMappingTable[] @@ -203,6 +203,9 @@ private: TONE_AUSTRALIA_BUSY, // Busy tone: 425 Hz repeated in a 0.375s on, 0.375s off pattern. TONE_AUSTRALIA_CALL_WAITING,// Call waiting tone: 425Hz tone repeated in a 0.2s on, 0.2s off, 0.2s on, 4.4s off pattern. TONE_AUSTRALIA_CONGESTION, // Congestion tone: 425Hz tone repeated in a 0.375s on, 0.375s off pattern + // SINGAPORE Supervisory tones + TONE_SG_BUSY, // Busy tone: 425 Hz, 750ms ON, 750ms OFF... + TONE_SG_RINGTONE, // Ring Tone: 425 Hz tone modulated with 24 Hz, 400ms ON, 200ms OFF, 400ms ON, 2s OFF... NUM_ALTERNATE_TONES }; @@ -211,6 +214,7 @@ private: JAPAN, GB, AUSTRALIA, + SINGAPORE, CEPT, NUM_REGIONS };