media.playEventSound() not working

I’m using media.playEventSound to play some effects that need to play with low latency in Android and audio is playing fine but the event listener of completion doesn’t trigger on device only in simulator. I’m using the #2013.2088 from daily builds. Should I report this as a bug?

just found your post now. I opened a similar one:

http://forums.coronalabs.com/topic/41927-mediasetsoundvolume-does-not-work-on-android-device/

similar in that way that the media api works different on device and the simulator. Maybe some qualified forum member has a solution or explanation for this?

Iván Juárez, do you have a small sample code that demonstrates the problem?

Thanks

Rob

Rob, this is the code I’m using:

print("Creating Event Sound")local event = media.newEventSound( 'snd/success.mp3' ) timer.performWithDelay( 500, function()     print("Playing Event Sound")     media.playEventSound( event, function() print("Sound finished!") end) end, 1)

Here the listener never gets executed on android (4.2.2). I tried with wav, ogg and others to see if is a encoding related issue but as I said the sound plays with no problems it just doesn’t trigger the completion function. The android log shows two errors, here is a fragment from the unfiltered log of the code above:

11-30 16:34:00.133: I/Corona(11810): Creating Event Sound 11-30 16:34:00.141: V/MediaPlayer(11810): decode(53, 0, 2299) 11-30 16:34:00.149: D/dalvikvm(11810): GC\_CONCURRENT freed 327K, 33% free 5521K/8144K, paused 3ms+3ms, total 45ms 11-30 16:34:00.157: V/MediaPlayerService(108): decode(59, 0, 2299) 11-30 16:34:00.157: V/MediaPlayerService(108): player type = 3 11-30 16:34:00.157: V/AwesomePlayer(108): setDefault 11-30 16:34:00.157: V/AwesomePlayer(108): constructor 11-30 16:34:00.157: V/AwesomePlayer(108): setDefault 11-30 16:34:00.157: V/AwesomePlayer(108): reset\_l() 11-30 16:34:00.157: V/WindowManager(468): Window{42592000 u0 Keyguard}mOrientationRequetedFromKeyguard=false 11-30 16:34:00.165: V/AwesomePlayer(108): reset\_l() while (mFlags & PREPARING) condition check 11-30 16:34:00.165: V/AwesomePlayer(108): cancelPlayerEvents (keepNotifications=0) 11-30 16:34:00.165: V/AwesomePlayer(108): mAudioTrackVector clear 11-30 16:34:00.165: V/AwesomePlayer(108): reset\_l() mAudioPlayer successfully deleted 11-30 16:34:00.165: V/AwesomePlayer(108): mSecMediaClock clear 11-30 16:34:00.165: V/StagefrightPlayer(108): StagefrightPlayer 11-30 16:34:00.165: V/AwesomePlayer(108): setListener 11-30 16:34:00.165: V/StagefrightPlayer(108): initCheck 11-30 16:34:00.165: V/AwesomePlayer(108): setAudioSink 11-30 16:34:00.165: V/StagefrightPlayer(108): setDataSource(59, 0, 2299) 11-30 16:34:00.165: V/AwesomePlayer(108): setDataSource (63, 0, 2299) 11-30 16:34:00.165: V/AwesomePlayer(108): reset\_l() 11-30 16:34:00.165: V/AwesomePlayer(108): reset\_l() while (mFlags & PREPARING) condition check 11-30 16:34:00.165: V/AwesomePlayer(108): cancelPlayerEvents (keepNotifications=0) 11-30 16:34:00.165: V/AwesomePlayer(108): mAudioTrackVector clear 11-30 16:34:00.165: V/AwesomePlayer(108): reset\_l() mAudioPlayer successfully deleted 11-30 16:34:00.165: V/AwesomePlayer(108): mSecMediaClock clear 11-30 16:34:00.180: D/WVMDrmPlugIn(107): WVMDrmPlugin::onInitialize : 5354 11-30 16:34:00.188: D/WVMDrmPlugIn(107): WVMDrmPlugin::onSetOnInfoListener : add 5354 11-30 16:34:00.188: E/DivXPlugin(107): DivXPlugin::onOpenDecryptSession() Not a Divx File. 11-30 16:34:00.188: W/SEC\_DRM\_PLUGIN\_Playready(107): PlayreadyPlugIn: Function[DRM\_ASFVerify\_Context\_Initialize]; Line[4070]; File type[0] 11-30 16:34:00.188: W/SEC\_DRM\_PLUGIN\_Playready(107): PlayReadyPlugIn: Function[onOpenDecryptSession]; Line[2482]; DRM Result[0x80004005] 11-30 16:34:00.188: D/WVMDrmPlugIn(107): WVMDrmPlugin::onTerminate : 5354 11-30 16:34:00.188: V/MediaExtractor(108): Autodetected media content as 'audio/mpeg' with confidence 0.20 11-30 16:34:00.188: V/AwesomePlayer(108): mBitrate = 32000 bits/sec 11-30 16:34:00.188: W/AwesomePlayer(108): couldn't get userdata - Weather 11-30 16:34:00.188: W/AwesomePlayer(108): couldn't get userdata - Authorization 11-30 16:34:00.188: W/AwesomePlayer(108): couldn't get userdata - SnapShot 11-30 16:34:00.188: W/AwesomePlayer(108): couldn't get userdata - SMRD 11-30 16:34:00.188: V/AwesomePlayer(108): current audio track index (0) is added to vector 11-30 16:34:00.188: V/AwesomePlayer(108): setDataSource\_l: Audio(1), Video(0) 11-30 16:34:00.196: I/AwesomePlayer(108): AwesomePlayer::setDataSource\_l():: This is not a DRM content 11-30 16:34:00.196: V/MediaPlayerService(108): prepare 11-30 16:34:00.196: V/AwesomePlayer(108): prepareAsync 11-30 16:34:00.196: V/MediaPlayerService(108): wait for prepare 11-30 16:34:00.211: V/AwesomePlayer(108): onPrepareAsyncEvent 11-30 16:34:00.211: I/SecMediaClock(108): SecMediaClock constructor 11-30 16:34:00.211: I/SecMediaClock(108): reset 11-30 16:34:00.211: V/AwesomePlayer(108): initAudioDecoder 11-30 16:34:00.211: E/OMXCodec(108): [LEGO] else flags = 0 11-30 16:34:00.211: I/OMXCodec(108): OMXCodec::Create mime (audio/mpeg), flags (0), matchComponentName ((null)), createEncoder (0) 11-30 16:34:00.211: I/OMXCodec(108): Attempting to allocate OMX node 'OMX.SEC.mp3.dec' 11-30 16:34:00.211: I/OMXCodec(108): Successfully allocated OMX node 'OMX.SEC.mp3.dec' 11-30 16:34:00.211: I/OMXCodec(108): OMXCodec::configureCodec 1 + 44100 ++ 11-30 16:34:00.219: I/OMXCodec(108): [OMX.SEC.mp3.dec] allocating 10 buffers of size 524288 on input port 11-30 16:34:00.219: I/OMXCodec(108): [OMX.SEC.mp3.dec] allocating 5 buffers of size 27648 on output port 11-30 16:34:00.219: V/AwesomePlayer(108): finishAsyncPrepare\_l 11-30 16:34:00.219: V/AwesomePlayer(108): notifyListner\_l() msg (200-MEDIA\_INFO), ext1 (973), ext2 (0) 11-30 16:34:00.219: V/AudioCache(108): notify(0x4216bc48, 200, 973, 0) 11-30 16:34:00.219: V/AudioCache(108): ignored 11-30 16:34:00.219: V/AwesomePlayer(108): notifyListner\_l() msg (5-MEDIA\_SET\_VIDEO\_SIZE), ext1 (0), ext2 (0) 11-30 16:34:00.219: V/AudioCache(108): notify(0x4216bc48, 5, 0, 0) 11-30 16:34:00.219: V/AudioCache(108): ignored 11-30 16:34:00.219: V/AwesomePlayer(108): notifyListner\_l() msg (1-MEDIA\_PREPARED), ext1 (0), ext2 (0) 11-30 16:34:00.219: V/AudioCache(108): notify(0x4216bc48, 1, 0, 0) 11-30 16:34:00.219: V/AudioCache(108): prepared 11-30 16:34:00.219: V/AudioCache(108): wait - success 11-30 16:34:00.219: V/MediaPlayerService(108): start 11-30 16:34:00.219: V/StagefrightPlayer(108): start 11-30 16:34:00.227: V/AwesomePlayer(108): play 11-30 16:34:00.227: V/AwesomePlayer(108): AwesomePlayer::play\_l():: This is not a DRM content 11-30 16:34:00.227: V/AwesomePlayer(108): startAudioPlayer\_l, sendErrorNotification (0) 11-30 16:34:00.243: I/AudioPlayer(108): Audioplayer kKeyAudioPCMFormat:1, 2, 0 11-30 16:34:00.243: I/AudioPlayer(108): Audioplayer1 (2, 1) 11-30 16:34:00.243: V/AudioCache(108): open(44100, 2, 0x0, 1, 4) 11-30 16:34:00.243: V/AwesomePlayer(108): addBatteryData 11-30 16:34:00.243: V/MediaPlayerService(108): wait for playback complete 11-30 16:34:00.258: I/OMXCodec(108): [OMX.SEC.mp3.dec] End Of Stream 11-30 16:34:00.258: V/AwesomePlayer(108): postAudioEOS delayUs (0) 11-30 16:34:00.258: V/AwesomePlayer(108): onCheckAudioStatus 11-30 16:34:00.258: V/AwesomePlayer(108): onCheckAudioStatus() set AUDIO\_AT\_EOS flag 11-30 16:34:00.258: V/AwesomePlayer(108): onStreamDone 11-30 16:34:00.258: V/AwesomePlayer(108): MEDIA\_PLAYBACK\_COMPLETE 11-30 16:34:00.258: V/AwesomePlayer(108): notifyListner\_l() msg (2-MEDIA\_PLAYBACK\_COMPLETE), ext1 (0), ext2 (0) 11-30 16:34:00.258: V/AudioCache(108): notify(0x4216bc48, 2, 0, 0) 11-30 16:34:00.258: V/AudioCache(108): playback complete - thread will wake up later 11-30 16:34:00.258: V/AwesomePlayer(108): cancelPlayerEvents (keepNotifications=1) 11-30 16:34:00.258: V/AwesomePlayer(108): addBatteryData 11-30 16:34:00.258: V/AudioCache(108): wait - success 11-30 16:34:00.258: V/StagefrightPlayer(108): reset 11-30 16:34:00.258: V/AwesomePlayer(108): reset\_l() 11-30 16:34:00.266: V/AwesomePlayer(108): reset\_l() while (mFlags & PREPARING) condition check 11-30 16:34:00.266: V/AwesomePlayer(108): cancelPlayerEvents (keepNotifications=0) 11-30 16:34:00.266: V/AwesomePlayer(108): mAudioTrackVector clear 11-30 16:34:00.266: I/OMXCodec(108): [OMX.SEC.mp3.dec] stop() sendCommand(0x2d4, OMX\_CommandStateSet, OMX\_StateIdle) 11-30 16:34:00.266: I/AudioPlayer(108): reset out 11-30 16:34:00.266: V/AwesomePlayer(108): reset\_l() mAudioPlayer successfully deleted 11-30 16:34:00.266: I/SecMediaClock(108): SecMediaClock destructor 11-30 16:34:00.266: V/AwesomePlayer(108): mSecMediaClock clear 11-30 16:34:00.266: V/StagefrightPlayer(108): ~StagefrightPlayer 11-30 16:34:00.266: V/StagefrightPlayer(108): reset 11-30 16:34:00.266: V/AwesomePlayer(108): reset\_l() 11-30 16:34:00.266: V/AwesomePlayer(108): reset\_l() while (mFlags & PREPARING) condition check 11-30 16:34:00.266: V/AwesomePlayer(108): cancelPlayerEvents (keepNotifications=0) 11-30 16:34:00.266: V/AwesomePlayer(108): mAudioTrackVector clear 11-30 16:34:00.266: V/AwesomePlayer(108): reset\_l() mAudioPlayer successfully deleted 11-30 16:34:00.266: V/AwesomePlayer(108): mSecMediaClock clear 11-30 16:34:00.266: V/AwesomePlayer(108): destructor 11-30 16:34:00.266: V/AwesomePlayer(108): reset\_l() 11-30 16:34:00.266: V/AwesomePlayer(108): reset\_l() while (mFlags & PREPARING) condition check 11-30 16:34:00.266: V/AwesomePlayer(108): cancelPlayerEvents (keepNotifications=0) 11-30 16:34:00.266: V/AwesomePlayer(108): mAudioTrackVector clear 11-30 16:34:00.266: V/AwesomePlayer(108): reset\_l() mAudioPlayer successfully deleted 11-30 16:34:00.266: V/AwesomePlayer(108): mSecMediaClock clear 11-30 16:34:00.641: I/Corona(11810): Playing Event Sound 11-30 16:34:00.657: V/AudioPolicyManagerBase(108): getOutput() stream 3, samplingRate 0, format 0, channelMask 3, flags 0 11-30 16:34:00.657: V/AudioPolicyManagerBase(108): getOutput() returns output 2 11-30 16:34:00.657: V/AudioPolicyManagerBase(108): getOutput() stream 3, samplingRate 0, format 0, channelMask 3, flags 0 11-30 16:34:00.657: V/AudioPolicyManagerBase(108): getOutput() returns output 2 11-30 16:34:00.657: V/AudioPolicyManagerBase(108): getOutput() stream 3, samplingRate 44100, format 1, channelMask 3, flags 4 11-30 16:34:00.657: V/AudioPolicyManagerBase(108): getOutput() returns output 2 11-30 16:34:00.657: V/LvOutput(108): initCheck: 0 11-30 16:34:00.657: V/LvOutput(108): attachEffects: attach processing to output 2, stream 3, session 1780, mode 0 11-30 16:34:00.657: V/LvOutput(108): attachEffects: no output processing needs to be attached to this stream 11-30 16:34:00.657: V/LvOutput(108): LvOutput::setAllProcessorEnabled(false) mOutputs.size(0) 11-30 16:34:00.657: V/AudioPolicyManagerBase(108): startOutput() output 2, stream 3, session 1780 11-30 16:34:00.657: V/AudioPolicyManagerBase(108): changeRefCount() stream 3, count 1 11-30 16:34:00.657: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:00.657: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:00.657: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:00.665: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:00.665: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:00.665: V/AudioPolicyManagerBase(108): getNewDevice() selected device 2 11-30 16:34:00.665: V/AudioPolicyManagerBase(108): setOutputDevice() output 2 device 0002 force 0 delayMs 0 11-30 16:34:00.665: V/AudioPolicyManagerBase(108): setOutputDevice() prevDevice 0002 11-30 16:34:00.665: V/AudioPolicyManagerBase(108): setOutputDevice() setting same device 0002 or null device for output 2 11-30 16:34:00.665: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:00.665: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:00.665: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:00.665: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:00.665: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:00.665: V/AudioPolicyManagerBase(108): getNewDevice() selected device 2 11-30 16:34:00.665: V/AudioPolicyManagerBase(108): checkOutputForStrategy(0002,0002,3) 11-30 16:34:00.665: I/AudioHardwareTinyALSA(108): AudioStreamOutALSA::write setDevice 11-30 16:34:00.665: D/AudioHardwareTinyALSA(108): OutALSA::setDevice: mode = 0, newDevice=0x2, currentDevice=0x2 ,force= 0 11-30 16:34:00.665: D/AudioHardwareTinyALSA(108): OutALSA::setDevice: mDevice 0x2, newDevice = 0x2 11-30 16:34:00.665: D/AudioHardwareTinyALSA(108): setOutputVolume 11-30 16:34:00.665: D/TinyUCM(108): setModifier Normal, en=1 11-30 16:34:00.665: I/AudioHardwareTinyALSA(108): OutALSA::setDevice: mHandle NULL mode[0], Device[00000002] 11-30 16:34:00.665: I/AudioHardwareTinyALSA(108): Open: mDefaults-\>direction=0 device=0 11-30 16:34:00.665: D/AudioHardwareTinyALSA(108): Channel: 2, Samplerate: 44100, Format: 0, Peroid Size: 1024, Period Count: 4 11-30 16:34:00.665: D/AudioHardwareTinyALSA(108): setPcmInterface: Stream=0x1, iSamplerate=8000++ 11-30 16:34:00.665: D/AudioHardwareTinyALSA(108): setPcmInterface-- 11-30 16:34:01.118: D/SensorService(468): 1.4 0.2 9.6 11-30 16:34:01.250: V/LvOutput(108): initCheck: 0 11-30 16:34:01.250: V/LvOutput(108): detachEffects: detach processing for output 2, stream 3, session 1780 11-30 16:34:01.250: V/LvOutput(108): detachEffects: no output processing was attached to this stream 11-30 16:34:01.250: V/AudioPolicyManagerBase(108): stopOutput() output 2, stream 3, session 1780 11-30 16:34:01.250: V/AudioPolicyManagerBase(108): changeRefCount() stream 3, count 0 11-30 16:34:01.250: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:01.250: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:01.250: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:01.250: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:01.250: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:01.250: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:01.250: V/AudioPolicyManagerBase(108): getNewDevice() selected device 0 11-30 16:34:01.250: V/AudioPolicyManagerBase(108): setOutputDevice() output 2 device 0000 force 0 delayMs 184 11-30 16:34:01.250: V/AudioPolicyManagerBase(108): setOutputDevice() prevDevice 0002 11-30 16:34:01.250: V/AudioPolicyManagerBase(108): setOutputDevice() setting same device 0000 or null device for output 2 11-30 16:34:01.250: V/AudioPolicyManagerBase(108): checkOutputForStrategy(0002,0002,3) 11-30 16:34:03.399: D/dalvikvm(938): GC\_CONCURRENT freed 391K, 33% free 5316K/7864K, paused 3ms+2ms, total 24ms

I just used this code:

local soundID = media.newEventSound( "splat01.mp3" ) media.playEventSound( soundID, function() print("Hello" ) end)

And I saw “Hello” print in my console.log.

just found your post now. I opened a similar one:

http://forums.coronalabs.com/topic/41927-mediasetsoundvolume-does-not-work-on-android-device/

similar in that way that the media api works different on device and the simulator. Maybe some qualified forum member has a solution or explanation for this?

Iván Juárez, do you have a small sample code that demonstrates the problem?

Thanks

Rob

Rob, this is the code I’m using:

print("Creating Event Sound")local event = media.newEventSound( 'snd/success.mp3' ) timer.performWithDelay( 500, function()     print("Playing Event Sound")     media.playEventSound( event, function() print("Sound finished!") end) end, 1)

Here the listener never gets executed on android (4.2.2). I tried with wav, ogg and others to see if is a encoding related issue but as I said the sound plays with no problems it just doesn’t trigger the completion function. The android log shows two errors, here is a fragment from the unfiltered log of the code above:

11-30 16:34:00.133: I/Corona(11810): Creating Event Sound 11-30 16:34:00.141: V/MediaPlayer(11810): decode(53, 0, 2299) 11-30 16:34:00.149: D/dalvikvm(11810): GC\_CONCURRENT freed 327K, 33% free 5521K/8144K, paused 3ms+3ms, total 45ms 11-30 16:34:00.157: V/MediaPlayerService(108): decode(59, 0, 2299) 11-30 16:34:00.157: V/MediaPlayerService(108): player type = 3 11-30 16:34:00.157: V/AwesomePlayer(108): setDefault 11-30 16:34:00.157: V/AwesomePlayer(108): constructor 11-30 16:34:00.157: V/AwesomePlayer(108): setDefault 11-30 16:34:00.157: V/AwesomePlayer(108): reset\_l() 11-30 16:34:00.157: V/WindowManager(468): Window{42592000 u0 Keyguard}mOrientationRequetedFromKeyguard=false 11-30 16:34:00.165: V/AwesomePlayer(108): reset\_l() while (mFlags & PREPARING) condition check 11-30 16:34:00.165: V/AwesomePlayer(108): cancelPlayerEvents (keepNotifications=0) 11-30 16:34:00.165: V/AwesomePlayer(108): mAudioTrackVector clear 11-30 16:34:00.165: V/AwesomePlayer(108): reset\_l() mAudioPlayer successfully deleted 11-30 16:34:00.165: V/AwesomePlayer(108): mSecMediaClock clear 11-30 16:34:00.165: V/StagefrightPlayer(108): StagefrightPlayer 11-30 16:34:00.165: V/AwesomePlayer(108): setListener 11-30 16:34:00.165: V/StagefrightPlayer(108): initCheck 11-30 16:34:00.165: V/AwesomePlayer(108): setAudioSink 11-30 16:34:00.165: V/StagefrightPlayer(108): setDataSource(59, 0, 2299) 11-30 16:34:00.165: V/AwesomePlayer(108): setDataSource (63, 0, 2299) 11-30 16:34:00.165: V/AwesomePlayer(108): reset\_l() 11-30 16:34:00.165: V/AwesomePlayer(108): reset\_l() while (mFlags & PREPARING) condition check 11-30 16:34:00.165: V/AwesomePlayer(108): cancelPlayerEvents (keepNotifications=0) 11-30 16:34:00.165: V/AwesomePlayer(108): mAudioTrackVector clear 11-30 16:34:00.165: V/AwesomePlayer(108): reset\_l() mAudioPlayer successfully deleted 11-30 16:34:00.165: V/AwesomePlayer(108): mSecMediaClock clear 11-30 16:34:00.180: D/WVMDrmPlugIn(107): WVMDrmPlugin::onInitialize : 5354 11-30 16:34:00.188: D/WVMDrmPlugIn(107): WVMDrmPlugin::onSetOnInfoListener : add 5354 11-30 16:34:00.188: E/DivXPlugin(107): DivXPlugin::onOpenDecryptSession() Not a Divx File. 11-30 16:34:00.188: W/SEC\_DRM\_PLUGIN\_Playready(107): PlayreadyPlugIn: Function[DRM\_ASFVerify\_Context\_Initialize]; Line[4070]; File type[0] 11-30 16:34:00.188: W/SEC\_DRM\_PLUGIN\_Playready(107): PlayReadyPlugIn: Function[onOpenDecryptSession]; Line[2482]; DRM Result[0x80004005] 11-30 16:34:00.188: D/WVMDrmPlugIn(107): WVMDrmPlugin::onTerminate : 5354 11-30 16:34:00.188: V/MediaExtractor(108): Autodetected media content as 'audio/mpeg' with confidence 0.20 11-30 16:34:00.188: V/AwesomePlayer(108): mBitrate = 32000 bits/sec 11-30 16:34:00.188: W/AwesomePlayer(108): couldn't get userdata - Weather 11-30 16:34:00.188: W/AwesomePlayer(108): couldn't get userdata - Authorization 11-30 16:34:00.188: W/AwesomePlayer(108): couldn't get userdata - SnapShot 11-30 16:34:00.188: W/AwesomePlayer(108): couldn't get userdata - SMRD 11-30 16:34:00.188: V/AwesomePlayer(108): current audio track index (0) is added to vector 11-30 16:34:00.188: V/AwesomePlayer(108): setDataSource\_l: Audio(1), Video(0) 11-30 16:34:00.196: I/AwesomePlayer(108): AwesomePlayer::setDataSource\_l():: This is not a DRM content 11-30 16:34:00.196: V/MediaPlayerService(108): prepare 11-30 16:34:00.196: V/AwesomePlayer(108): prepareAsync 11-30 16:34:00.196: V/MediaPlayerService(108): wait for prepare 11-30 16:34:00.211: V/AwesomePlayer(108): onPrepareAsyncEvent 11-30 16:34:00.211: I/SecMediaClock(108): SecMediaClock constructor 11-30 16:34:00.211: I/SecMediaClock(108): reset 11-30 16:34:00.211: V/AwesomePlayer(108): initAudioDecoder 11-30 16:34:00.211: E/OMXCodec(108): [LEGO] else flags = 0 11-30 16:34:00.211: I/OMXCodec(108): OMXCodec::Create mime (audio/mpeg), flags (0), matchComponentName ((null)), createEncoder (0) 11-30 16:34:00.211: I/OMXCodec(108): Attempting to allocate OMX node 'OMX.SEC.mp3.dec' 11-30 16:34:00.211: I/OMXCodec(108): Successfully allocated OMX node 'OMX.SEC.mp3.dec' 11-30 16:34:00.211: I/OMXCodec(108): OMXCodec::configureCodec 1 + 44100 ++ 11-30 16:34:00.219: I/OMXCodec(108): [OMX.SEC.mp3.dec] allocating 10 buffers of size 524288 on input port 11-30 16:34:00.219: I/OMXCodec(108): [OMX.SEC.mp3.dec] allocating 5 buffers of size 27648 on output port 11-30 16:34:00.219: V/AwesomePlayer(108): finishAsyncPrepare\_l 11-30 16:34:00.219: V/AwesomePlayer(108): notifyListner\_l() msg (200-MEDIA\_INFO), ext1 (973), ext2 (0) 11-30 16:34:00.219: V/AudioCache(108): notify(0x4216bc48, 200, 973, 0) 11-30 16:34:00.219: V/AudioCache(108): ignored 11-30 16:34:00.219: V/AwesomePlayer(108): notifyListner\_l() msg (5-MEDIA\_SET\_VIDEO\_SIZE), ext1 (0), ext2 (0) 11-30 16:34:00.219: V/AudioCache(108): notify(0x4216bc48, 5, 0, 0) 11-30 16:34:00.219: V/AudioCache(108): ignored 11-30 16:34:00.219: V/AwesomePlayer(108): notifyListner\_l() msg (1-MEDIA\_PREPARED), ext1 (0), ext2 (0) 11-30 16:34:00.219: V/AudioCache(108): notify(0x4216bc48, 1, 0, 0) 11-30 16:34:00.219: V/AudioCache(108): prepared 11-30 16:34:00.219: V/AudioCache(108): wait - success 11-30 16:34:00.219: V/MediaPlayerService(108): start 11-30 16:34:00.219: V/StagefrightPlayer(108): start 11-30 16:34:00.227: V/AwesomePlayer(108): play 11-30 16:34:00.227: V/AwesomePlayer(108): AwesomePlayer::play\_l():: This is not a DRM content 11-30 16:34:00.227: V/AwesomePlayer(108): startAudioPlayer\_l, sendErrorNotification (0) 11-30 16:34:00.243: I/AudioPlayer(108): Audioplayer kKeyAudioPCMFormat:1, 2, 0 11-30 16:34:00.243: I/AudioPlayer(108): Audioplayer1 (2, 1) 11-30 16:34:00.243: V/AudioCache(108): open(44100, 2, 0x0, 1, 4) 11-30 16:34:00.243: V/AwesomePlayer(108): addBatteryData 11-30 16:34:00.243: V/MediaPlayerService(108): wait for playback complete 11-30 16:34:00.258: I/OMXCodec(108): [OMX.SEC.mp3.dec] End Of Stream 11-30 16:34:00.258: V/AwesomePlayer(108): postAudioEOS delayUs (0) 11-30 16:34:00.258: V/AwesomePlayer(108): onCheckAudioStatus 11-30 16:34:00.258: V/AwesomePlayer(108): onCheckAudioStatus() set AUDIO\_AT\_EOS flag 11-30 16:34:00.258: V/AwesomePlayer(108): onStreamDone 11-30 16:34:00.258: V/AwesomePlayer(108): MEDIA\_PLAYBACK\_COMPLETE 11-30 16:34:00.258: V/AwesomePlayer(108): notifyListner\_l() msg (2-MEDIA\_PLAYBACK\_COMPLETE), ext1 (0), ext2 (0) 11-30 16:34:00.258: V/AudioCache(108): notify(0x4216bc48, 2, 0, 0) 11-30 16:34:00.258: V/AudioCache(108): playback complete - thread will wake up later 11-30 16:34:00.258: V/AwesomePlayer(108): cancelPlayerEvents (keepNotifications=1) 11-30 16:34:00.258: V/AwesomePlayer(108): addBatteryData 11-30 16:34:00.258: V/AudioCache(108): wait - success 11-30 16:34:00.258: V/StagefrightPlayer(108): reset 11-30 16:34:00.258: V/AwesomePlayer(108): reset\_l() 11-30 16:34:00.266: V/AwesomePlayer(108): reset\_l() while (mFlags & PREPARING) condition check 11-30 16:34:00.266: V/AwesomePlayer(108): cancelPlayerEvents (keepNotifications=0) 11-30 16:34:00.266: V/AwesomePlayer(108): mAudioTrackVector clear 11-30 16:34:00.266: I/OMXCodec(108): [OMX.SEC.mp3.dec] stop() sendCommand(0x2d4, OMX\_CommandStateSet, OMX\_StateIdle) 11-30 16:34:00.266: I/AudioPlayer(108): reset out 11-30 16:34:00.266: V/AwesomePlayer(108): reset\_l() mAudioPlayer successfully deleted 11-30 16:34:00.266: I/SecMediaClock(108): SecMediaClock destructor 11-30 16:34:00.266: V/AwesomePlayer(108): mSecMediaClock clear 11-30 16:34:00.266: V/StagefrightPlayer(108): ~StagefrightPlayer 11-30 16:34:00.266: V/StagefrightPlayer(108): reset 11-30 16:34:00.266: V/AwesomePlayer(108): reset\_l() 11-30 16:34:00.266: V/AwesomePlayer(108): reset\_l() while (mFlags & PREPARING) condition check 11-30 16:34:00.266: V/AwesomePlayer(108): cancelPlayerEvents (keepNotifications=0) 11-30 16:34:00.266: V/AwesomePlayer(108): mAudioTrackVector clear 11-30 16:34:00.266: V/AwesomePlayer(108): reset\_l() mAudioPlayer successfully deleted 11-30 16:34:00.266: V/AwesomePlayer(108): mSecMediaClock clear 11-30 16:34:00.266: V/AwesomePlayer(108): destructor 11-30 16:34:00.266: V/AwesomePlayer(108): reset\_l() 11-30 16:34:00.266: V/AwesomePlayer(108): reset\_l() while (mFlags & PREPARING) condition check 11-30 16:34:00.266: V/AwesomePlayer(108): cancelPlayerEvents (keepNotifications=0) 11-30 16:34:00.266: V/AwesomePlayer(108): mAudioTrackVector clear 11-30 16:34:00.266: V/AwesomePlayer(108): reset\_l() mAudioPlayer successfully deleted 11-30 16:34:00.266: V/AwesomePlayer(108): mSecMediaClock clear 11-30 16:34:00.641: I/Corona(11810): Playing Event Sound 11-30 16:34:00.657: V/AudioPolicyManagerBase(108): getOutput() stream 3, samplingRate 0, format 0, channelMask 3, flags 0 11-30 16:34:00.657: V/AudioPolicyManagerBase(108): getOutput() returns output 2 11-30 16:34:00.657: V/AudioPolicyManagerBase(108): getOutput() stream 3, samplingRate 0, format 0, channelMask 3, flags 0 11-30 16:34:00.657: V/AudioPolicyManagerBase(108): getOutput() returns output 2 11-30 16:34:00.657: V/AudioPolicyManagerBase(108): getOutput() stream 3, samplingRate 44100, format 1, channelMask 3, flags 4 11-30 16:34:00.657: V/AudioPolicyManagerBase(108): getOutput() returns output 2 11-30 16:34:00.657: V/LvOutput(108): initCheck: 0 11-30 16:34:00.657: V/LvOutput(108): attachEffects: attach processing to output 2, stream 3, session 1780, mode 0 11-30 16:34:00.657: V/LvOutput(108): attachEffects: no output processing needs to be attached to this stream 11-30 16:34:00.657: V/LvOutput(108): LvOutput::setAllProcessorEnabled(false) mOutputs.size(0) 11-30 16:34:00.657: V/AudioPolicyManagerBase(108): startOutput() output 2, stream 3, session 1780 11-30 16:34:00.657: V/AudioPolicyManagerBase(108): changeRefCount() stream 3, count 1 11-30 16:34:00.657: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:00.657: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:00.657: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:00.665: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:00.665: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:00.665: V/AudioPolicyManagerBase(108): getNewDevice() selected device 2 11-30 16:34:00.665: V/AudioPolicyManagerBase(108): setOutputDevice() output 2 device 0002 force 0 delayMs 0 11-30 16:34:00.665: V/AudioPolicyManagerBase(108): setOutputDevice() prevDevice 0002 11-30 16:34:00.665: V/AudioPolicyManagerBase(108): setOutputDevice() setting same device 0002 or null device for output 2 11-30 16:34:00.665: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:00.665: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:00.665: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:00.665: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:00.665: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:00.665: V/AudioPolicyManagerBase(108): getNewDevice() selected device 2 11-30 16:34:00.665: V/AudioPolicyManagerBase(108): checkOutputForStrategy(0002,0002,3) 11-30 16:34:00.665: I/AudioHardwareTinyALSA(108): AudioStreamOutALSA::write setDevice 11-30 16:34:00.665: D/AudioHardwareTinyALSA(108): OutALSA::setDevice: mode = 0, newDevice=0x2, currentDevice=0x2 ,force= 0 11-30 16:34:00.665: D/AudioHardwareTinyALSA(108): OutALSA::setDevice: mDevice 0x2, newDevice = 0x2 11-30 16:34:00.665: D/AudioHardwareTinyALSA(108): setOutputVolume 11-30 16:34:00.665: D/TinyUCM(108): setModifier Normal, en=1 11-30 16:34:00.665: I/AudioHardwareTinyALSA(108): OutALSA::setDevice: mHandle NULL mode[0], Device[00000002] 11-30 16:34:00.665: I/AudioHardwareTinyALSA(108): Open: mDefaults-\>direction=0 device=0 11-30 16:34:00.665: D/AudioHardwareTinyALSA(108): Channel: 2, Samplerate: 44100, Format: 0, Peroid Size: 1024, Period Count: 4 11-30 16:34:00.665: D/AudioHardwareTinyALSA(108): setPcmInterface: Stream=0x1, iSamplerate=8000++ 11-30 16:34:00.665: D/AudioHardwareTinyALSA(108): setPcmInterface-- 11-30 16:34:01.118: D/SensorService(468): 1.4 0.2 9.6 11-30 16:34:01.250: V/LvOutput(108): initCheck: 0 11-30 16:34:01.250: V/LvOutput(108): detachEffects: detach processing for output 2, stream 3, session 1780 11-30 16:34:01.250: V/LvOutput(108): detachEffects: no output processing was attached to this stream 11-30 16:34:01.250: V/AudioPolicyManagerBase(108): stopOutput() output 2, stream 3, session 1780 11-30 16:34:01.250: V/AudioPolicyManagerBase(108): changeRefCount() stream 3, count 0 11-30 16:34:01.250: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:01.250: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:01.250: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:01.250: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:01.250: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:01.250: W/AudioPolicyManagerBase(108): stream type [13], return media strategy 11-30 16:34:01.250: V/AudioPolicyManagerBase(108): getNewDevice() selected device 0 11-30 16:34:01.250: V/AudioPolicyManagerBase(108): setOutputDevice() output 2 device 0000 force 0 delayMs 184 11-30 16:34:01.250: V/AudioPolicyManagerBase(108): setOutputDevice() prevDevice 0002 11-30 16:34:01.250: V/AudioPolicyManagerBase(108): setOutputDevice() setting same device 0000 or null device for output 2 11-30 16:34:01.250: V/AudioPolicyManagerBase(108): checkOutputForStrategy(0002,0002,3) 11-30 16:34:03.399: D/dalvikvm(938): GC\_CONCURRENT freed 391K, 33% free 5316K/7864K, paused 3ms+2ms, total 24ms

I just used this code:

local soundID = media.newEventSound( "splat01.mp3" ) media.playEventSound( soundID, function() print("Hello" ) end)

And I saw “Hello” print in my console.log.