Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E88F0C47B for ; Mon, 17 Nov 2014 11:20:33 +0000 (UTC) Received: (qmail 19995 invoked by uid 500); 17 Nov 2014 11:20:33 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 19969 invoked by uid 500); 17 Nov 2014 11:20:33 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 19956 invoked by uid 99); 17 Nov 2014 11:20:33 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Nov 2014 11:20:33 +0000 Date: Mon, 17 Nov 2014 11:20:33 +0000 (UTC) From: =?utf-8?Q?Aaron_Ru=C3=9F_=28JIRA=29?= To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CB-8020) avoid error message in console for failed renaming of recording-file (if Media object was only used for playing) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-8020?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:all-tabpanel ] Aaron Ru=C3=9F updated CB-8020: -------------------------- Description:=20 On Android, if a Media object is only used for playing a sound, i.e. not fo= r recording, then, on releasing the media object, an error is logged to the= LogCat console, complaining about a failed attempt to rename the temporary= file (that is used for recording audio). {panel:title=3DExample LogCat output (after releasing the Media object):} 11-14 13:57:14.138: V/MediaPlayer(29175): destructor 11-14 13:57:14.138: V/MediaPlayer(29175): disconnect 11-14 13:57:14.138: D/AudioPlayer(29175): renaming /storage/emulated/0/tmpr= ecording.3gp to /android_asset/www/audio/beep-notification.mp3 {color:red}11-14 13:57:14.138: E/AudioPlayer(29175): FAILED renaming /stora= ge/emulated/0/tmprecording.3gp to /android_asset/www/audio/beep-notificatio= n.mp3{color} {panel} Solution: in the AudioPlayer class, do not create the MediaRecorder (for audio record= ing) on object creation (i.e. in the AudioPlayer's constructor), but instea= d create it lazily, only if/when the AudioPlayer is used for recording audi= o (i.e. in method {{startRecording(String)}}). Example solution see: https://github.com/mmig/cordova-plugin-media/commit/66ac88689cb092179cdc3ed= a3bd64b1d8616077e NOTE: In addition to manually testing, that the proposed changes (see GitHub link= above) did not brake recording, I also did run the unit tests from plugin = {{org.apache.cordova.media.tests}} successfully (on a Samsung Note 10 device with Android 4.4.2) NOTE 2: this is the same issue as described in [CB-3800|https://issues.apache.org/j= ira/browse/CB-3800] and [CB-3835|https://issues.apache.org/jira/browse/CB-3= 835]=20 ...in CB-3835 David Mihalcik already provided the solution ... but it was n= ot accepted ... yet (??) NOTE 3: the code in AudioPlayer suggests, that lazy-loading of the recorder was pla= nned or had been implemented at some point and then was changed (for whatev= er reason). See for example methods `destroy()`, `stopRecording`, and `getDuration()`: = in these methods it is assumed, that the `recorder` field is `null`, if the= AudioPlayer objec _is not_ used for recording (and is not `null` if it _is= _ used for recording). was: On Android, if a Media object is only used for playing a sound, i.e. not fo= r recording, then, on releasing the media object, an error is logged to the= LogCat console, complaining about a failed attempt to rename the temporary= file (that is used for recording audio). {panel:title=3DExample LogCat output (after releasing the Media object):} 11-14 13:57:14.138: V/MediaPlayer(29175): destructor 11-14 13:57:14.138: V/MediaPlayer(29175): disconnect 11-14 13:57:14.138: D/AudioPlayer(29175): renaming /storage/emulated/0/tmpr= ecording.3gp to /android_asset/www/audio/beep-notification.mp3 {color:red}11-14 13:57:14.138: E/AudioPlayer(29175): FAILED renaming /stora= ge/emulated/0/tmprecording.3gp to /android_asset/www/audio/beep-notificatio= n.mp3{color} {panel} Solution: in the AudioPlayer class, do not create the MediaRecorder (for audio record= ing) on object creation (i.e. in the AudioPlayer's constructor), but instea= d create it lazily, only if/when the AudioPlayer is used for recording audi= o (i.e. in method {{startRecording(String)}}). Example solution see: https://github.com/mmig/cordova-plugin-media/commit/66ac88689cb092179cdc3ed= a3bd64b1d8616077e NOTE: In addition to manually testing, that that the proposed changes (see GitHub= link above) did not brake recording, I also did run the unit tests from pl= ugin {{org.apache.cordova.media.tests}} successfully (on a Samsung Note 10 device with Android 4.4.2) NOTE 2: this is the same issue as described in [CB-3800|https://issues.apache.org/j= ira/browse/CB-3800] and [CB-3835|https://issues.apache.org/jira/browse/CB-3= 835]=20 ...in CB-3835 David Mihalcik already provided the solution ... but it was n= ot accepted ... yet (??) > avoid error message in console for failed renaming of recording-file (if = Media object was only used for playing) > -------------------------------------------------------------------------= --------------------------------------- > > Key: CB-8020 > URL: https://issues.apache.org/jira/browse/CB-8020 > Project: Apache Cordova > Issue Type: Bug > Components: Android, Plugin Media > Reporter: Aaron Ru=C3=9F > Priority: Minor > Original Estimate: 10m > Remaining Estimate: 10m > > On Android, if a Media object is only used for playing a sound, i.e. not = for recording, then, on releasing the media object, an error is logged to t= he LogCat console, complaining about a failed attempt to rename the tempora= ry file (that is used for recording audio). > {panel:title=3DExample LogCat output (after releasing the Media object):} > 11-14 13:57:14.138: V/MediaPlayer(29175): destructor > 11-14 13:57:14.138: V/MediaPlayer(29175): disconnect > 11-14 13:57:14.138: D/AudioPlayer(29175): renaming /storage/emulated/0/tm= precording.3gp to /android_asset/www/audio/beep-notification.mp3 > {color:red}11-14 13:57:14.138: E/AudioPlayer(29175): FAILED renaming /sto= rage/emulated/0/tmprecording.3gp to /android_asset/www/audio/beep-notificat= ion.mp3{color} > {panel} > Solution: > in the AudioPlayer class, do not create the MediaRecorder (for audio reco= rding) on object creation (i.e. in the AudioPlayer's constructor), but inst= ead create it lazily, only if/when the AudioPlayer is used for recording au= dio (i.e. in method {{startRecording(String)}}). > Example solution see: > https://github.com/mmig/cordova-plugin-media/commit/66ac88689cb092179cdc3= eda3bd64b1d8616077e > NOTE: > In addition to manually testing, that the proposed changes (see GitHub li= nk above) did not brake recording, I also did run the unit tests from plugi= n {{org.apache.cordova.media.tests}} successfully > (on a Samsung Note 10 device with Android 4.4.2) > NOTE 2: > this is the same issue as described in [CB-3800|https://issues.apache.org= /jira/browse/CB-3800] and [CB-3835|https://issues.apache.org/jira/browse/CB= -3835]=20 > ...in CB-3835 David Mihalcik already provided the solution ... but it was= not accepted ... yet (??) > NOTE 3: > the code in AudioPlayer suggests, that lazy-loading of the recorder was p= lanned or had been implemented at some point and then was changed (for what= ever reason). > See for example methods `destroy()`, `stopRecording`, and `getDuration()`= : in these methods it is assumed, that the `recorder` field is `null`, if t= he AudioPlayer objec _is not_ used for recording (and is not `null` if it _= is_ used for recording). -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org