Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19996] iOS: deadlock occurs on sound.play

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-11-16T23:10:58.000+0000
Affected Version/sRelease 5.1.0
Fix Version/sRelease 5.1.0
ComponentsiOS
Labelsqe-5.1.0, regression
ReporterHarry Bryant
AssigneeAngel Petkov
Created2015-11-16T20:57:05.000+0000
Updated2015-11-16T23:10:58.000+0000

Description

Description:

*This is a regression from 5.0.2.GA* Sound fails to play when an app is built with Ti SDK 5.1.0. The following error occurs attempting to play a sound from a device:
Nov 16 12:48:33 Future-Angle AudioTester[1141] <Warning>: *** -[NSLock lock]: deadlock (<NSLock: 0x146e7b830> '(null)')
Nov 16 12:48:33 Future-Angle AudioTester[1141] <Warning>: *** Break on _NSLockError() to debug.
The bug was originally found when running the sound test cases in KitchenSink, but the same issue occurs when isolated into a separate app.

Steps to reproduce:

1. Create a Classic project. 2. Include attached .wav file to project directory > Resources > etc 3. Add following demo code to app.js:
var win = Titanium.UI.createWindow({
		title: "Window One"
	});
		
	//TODO: USE OBJECT
	var sound = Titanium.Media.createSound();
	sound.url='/etc/cricket.wav'; // For testing #1913
	
	//
	// PLAY
	//
	var play = Titanium.UI.createButton({
		title:'Play',
		height:40,
		width:145,
		left:10,
		top:10
	});
	play.addEventListener('click', function()
	{
		sound.play();		
	});
	win.add(play);
	
win.open();
3. Run app to device. 4. Press play.

Result:

Receive deadlock error and sound fails to play.

Expected Result:

app should not deadlock and should succeed in playing the sample file.

Attachments

FileDateSize
cricket.wav2015-11-16T20:56:45.000+000080923

Comments

  1. Angel Petkov 2015-11-16

    PR pending https://github.com/appcelerator/titanium_mobile/pull/7450
  2. Harry Bryant 2015-11-16

    Verified as fixed, using the latest Ti SDK build: 5.1.0.v20151116142031 I was able to produce sound both on device & simulators. Tested the above sample code as well as KitchenSink, with no issue. iPhone 6s Device & Sim (9.1) iPhone 6 Device & Sim (8.4) Mac OSX El Capitan 10.11 (15A284) Ti SDK: 5.1.0.v20151116142031 Appc Studio: 4.4.0.201511130407 Appc NPM: 4.2.1 Appc CLI: 5.1.0-54 Ti CLI: 5.0.4 Alloy: 1.7.25 Xcode 7.1(7B91b) Node v0.12.7 production *Closing ticket.*

JSON Source