Re: User interface unresponsive in window

2015-04-17 Thread Jonathan Taylor
>> Am I right in thinking that when running under Xcode any drawing errors will 
>> be logged to the Xcode console?
> 
> No, not unless they’re actually exceptions. Messages from other processes are 
> only going to appear in the system log.

OK, thanks for your suggestion about checking the system log then - I will look 
out for that.

> With puzzling, intermittent errors like this, I often find that reading your 
> own code carefully may be more productive than going to heroic debugging 
> extremes. The trick is not to prejudge *where* in your code you should look. 
> (Don’t be the person looking underneath the street light for a dropped 
> quarter because “that’s where the light is”.)

That's a fair suggestion, but taken in its most general sense that is a 
near-impossible task. There are 100-odd source files in the project, etc, and 
just "code-read the project and look for some bug" is a non-starter. Are you 
effectively saying that you agree with my hypothesis that the cause is 
GUI-related code being executed on a non-main thread? If you or others have 
definitely seen that cause problems of this sort in the past, then I'll 
certainly do a second more thorough read-through of any code that could 
possibly be relevant...

Cheers
Jonny

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Thousands of leaked CGContext ?

2015-04-17 Thread Eric Matecki

Hi,

(I know this is not 100% Cocoa, but it isn't 100% CoreGraphics either...)

I'm drawing to an NSWindow with CoreGraphics, and each time there is a leaked CGContext, CGContextDelegate, CGColorTransform, 
NSBitmapGraphicsContext, and NSFocusStack (one of each).



Here is how I do it :

CGDataProviderDirectCallbacks callbacks = {
0,
&MyProviderGetBytePointer,
&MyProviderReleaseBytePointer,
&MyProviderGetBytesAtPosition,
&MyProviderReleaseInfo
};

MyProviderStruct  mps = { mBlock, mDirtyRect.X(), mDirtyRect.Y() };

CGDataProviderRef  provider = CGDataProviderCreateDirect( &mps, sizeof(mps), 
&callbacks );

NSWindow*  window = (NSWindow*)Window();
CGImageRef  image = CGImageCreate( size_t(mDirtyRect.W()), 
size_t(mDirtyRect.H()), 8, 32, size_t(mBlock->Width()*4),
   [[window colorSpace] CGColorSpace], 
kCGBitmapByteOrder32Big | kCGImageAlphaNoneSkipFirst,
   provider, NULL, false, 
kCGRenderingIntentRelativeColorimetric );

CGContextRef  myContext = (CGContextRef)[[NSGraphicsContext currentContext] 
graphicsPort];

CGContextDrawImage( myContext, CGRectMake( mDirtyRect.X(), geom.H() - 
mDirtyRect.Y() - mDirtyRect.H(),
   mDirtyRect.W(), mDirtyRect.H() 
), image );

CGContextFlush( myContext );
CGImageRelease( image );
CGDataProviderRelease( provider );


I don't release the CGContextRef because I don't 'create' it.
If I release it, the app doesn't crash but doesn't draw anything anymore after 
the first one.

My data provider just copy bytes from a legacy data structure.

What am I doing wrong ?
Or maybe there is a better way of doing this ?

Thanks for any help !

--
Keep intel OUTSIDE my Mac !
Hiii !!! I can see Intel chips creeping around my G5 !

Eric M.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Scattered NSProgress use

2015-04-17 Thread Daryle Walker
On Apr 13, 2015, at 12:33 PM, Jens Alfke  wrote:
> 
>> On Apr 11, 2015, at 12:49 PM, Daryle Walker > > wrote:
>> 
>> We have to make sure that the automatic parent/nesting aspect doesn’t make 
>> sibling & cousin progress objects, whose actions will be interlaced, 
>> interfere with each other.
> 
> It’s only automatic while an NSProgress is made the currentProgress, and 
> currentProgress is a per-thread state. So you’re in control of what code 
> runs, and what other NSProgresses are created, while one is current. If you’d 
> rather, you can make everything explicit by _never_ making an NSProgress 
> current, and instead passing it in as the parent when you create new child 
> instances.

You can’t do that (for now). A progress object’s parent must be the current one 
or nothing (i.e. NIL); arbitrary parentage isn’t currently supported.

— 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: layout method not getting called on Content View

2015-04-17 Thread Dave

> On 16 Apr 2015, at 22:37, Quincey Morris 
>  wrote:
> 
> On Apr 16, 2015, at 13:54 , Dave  > wrote:
>> 
>> I’m wondering if the call to super should happen before I mess with the 
>> Content View? 
> 
> From the NSWindowController documentation:
> 
>> "The default implementation does nothing.”
> 
> However, it’s probably better practice to put it at the top of your method.

Yes, I’m nearly always concerned I have it in the wrong place, it can cause 
havoc in some cases.

I changed my code to walk the view hierarchy and set the Frame at 
windowDidLoadl time and I can confirm it works wonderfully! 

I may eventually adapt it to use constraints. I wish it were possible to apply 
Auto Layout out on some subview chains and Manual Layout on others, but it 
doesn’t seem possible?

Thanks a lot for your help, just knowing it *should* work is enough sometimes!

All the Best
Dave


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: User interface unresponsive in window

2015-04-17 Thread Kyle Sluder
On Fri, Apr 17, 2015, at 04:16 AM, Jonathan Taylor wrote:
> That's a fair suggestion, but taken in its most general sense that is a
> near-impossible task. There are 100-odd source files in the project, etc,
> and just "code-read the project and look for some bug" is a non-starter.


Before you embark on such a task, you might try breaking on -[NSCell
drawWithFrame:inView:] or a similar method that you know is being called
as part of the badness.

The problem there is that you don't know if the issue is at the callsite
that triggers the drawing. But it's likely enough that it's worth
starting your search there.

> Are you effectively saying that you agree with my hypothesis that the
> cause is GUI-related code being executed on a non-main thread? If you or
> others have definitely seen that cause problems of this sort in the past,
> then I'll certainly do a second more thorough read-through of any code
> that could possibly be relevant...

You might also have an issue with runloops—either you're touching the UI
from a thread that doesn't have a running runloop, or you've got a
nested runloop invocation on your main thread, and it's never escaping
some special mode (like NSEventTrackingRunLoopMode). Either way, the
result is that code sets up a timer or delay-perform that never fires,
which might explain the symptoms you're seeing.

--Kyle Sluder

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

NSStatusItem, Popover and NSTextField make responder

2015-04-17 Thread Alex Kac
I have a popover that is opened on tapping a menu status item. In the
popover I have a text field that I’d like to have become active when
the popover is open.

When the app is in the foreground and you tap on the status item it
does become active. When its in the background, it does not. In beta,
we’re getting reports from users that they are expecting it to and
other apps do.

Now I’ve been in the iOS world for a few years and the OS X world only
a few months, but I used to work in what is now Carbon and I’ve been
lurking here for years so I’ve got a few ideas, but so far none of
them are working.

I’d love to hear some tips if you have any. I thought it was something
with run-loop modes but I haven’t had any luck with that.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: User interface unresponsive in window

2015-04-17 Thread Uli Kusterer
On 15 Apr 2015, at 16:04, Jonathan Taylor  wrote:
> I've started encountering intermittent problems in one specific window in my 
> application, where text input boxes become unresponsive, steppers remain 
> highlighted after clicking, etc. I'm rather short of ideas on how to debug 
> this, particular since I haven't worked out how to reproduce it reliably. 
> Other windows seem to remain unaffected.
> 
> From dimly-remembered past experience I have a feeling it could be related to 
> something somewhere resulting in GUI code being executed on a non-main 
> thread. There is in principle a risk of that, since the window interacts with 
> peripherals/drivers etc involving multithreaded code. I've tried to isolate 
> the GUI code from the multithreaded code, but may perhaps have missed some 
> obscure case. [ideally, I'd probably totally isolate anything multithreaded 
> from ObjC code, but that would mean a proliferation of shadow classes, which 
> is something I'd prefer to avoid being dragged into]
> 
> Even if my suspicion about the cause (multithreading+GUI) is correct, I'm 
> still not sure how to pin down and debug the problem, since there are so many 
> entry points into GUI-related code (e.g. property value changes), not all of 
> which even involve my own code directly. It would be great if there was some 
> way of enabling a global "exception if main-thread requirements are 
> violated", but I certainly haven't heard of such a thing (and can imagine 
> there could be very good reasons why it would be prohibitively hard to 
> implement). Can anyone suggest ways to diagnose and debug my problem (or 
> indeed suggest other possible causes I haven't thought of)?

A few ideas:

- access of UI from non-main thread, corrupting data
- view inserted as subview of one of its superviews
- Someone calling one of the nextEventMatchingMask: methods and swallowing 
events that someone else is looking for to end a loop.
- Exception thrown from tracking code
- Someone calling display: from inside drawRect:, causing an endless recursion

Have you tried just pausing your app in the debugger when this happens and 
looking at each thread to see what is running?

Cheers,
-- Uli
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Scattered NSProgress use

2015-04-17 Thread Jens Alfke

> On Apr 17, 2015, at 8:07 AM, Daryle Walker  wrote:
> 
>> If you’d rather, you can make everything explicit by _never_ making an 
>> NSProgress current, and instead passing it in as the parent when you create 
>> new child instances.
> 
> You can’t do that (for now). A progress object’s parent must be the current 
> one or nothing (i.e. NIL); arbitrary parentage isn’t currently supported.

Oops, you’re right. What I’m actually doing is making the parent progress 
current, creating the child, then immediately resigning current. The point is 
not to separate making one progress current from creating a child.

—Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Thousands of leaked CGContext ?

2015-04-17 Thread David Duncan

> On Apr 17, 2015, at 2:38 AM, Eric Matecki  wrote:
> 
> Hi,
> 
> (I know this is not 100% Cocoa, but it isn't 100% CoreGraphics either...)
> 
> I'm drawing to an NSWindow with CoreGraphics, and each time there is a leaked 
> CGContext, CGContextDelegate, CGColorTransform, NSBitmapGraphicsContext, and 
> NSFocusStack (one of each).
> 
> 
> Here is how I do it :
> 
>CGDataProviderDirectCallbacks callbacks = {
>0,
>&MyProviderGetBytePointer,
>&MyProviderReleaseBytePointer,
>&MyProviderGetBytesAtPosition,
>&MyProviderReleaseInfo
>};
> 
>MyProviderStruct  mps = { mBlock, mDirtyRect.X(), mDirtyRect.Y() };
> 
>CGDataProviderRef  provider = CGDataProviderCreateDirect( &mps, 
> sizeof(mps), &callbacks );
> 
>NSWindow*  window = (NSWindow*)Window();

What does this line do?

>CGImageRef  image = CGImageCreate( size_t(mDirtyRect.W()), 
> size_t(mDirtyRect.H()), 8, 32, size_t(mBlock->Width()*4),
>   [[window colorSpace] CGColorSpace], 
> kCGBitmapByteOrder32Big | kCGImageAlphaNoneSkipFirst,
>   provider, NULL, false, 
> kCGRenderingIntentRelativeColorimetric );
> 
>CGContextRef  myContext = (CGContextRef)[[NSGraphicsContext 
> currentContext] graphicsPort];
> 
>CGContextDrawImage( myContext, CGRectMake( mDirtyRect.X(), geom.H() - 
> mDirtyRect.Y() - mDirtyRect.H(),
>   mDirtyRect.W(), mDirtyRect.H() 
> ), image );
> 
>CGContextFlush( myContext );
>CGImageRelease( image );
>CGDataProviderRelease( provider );
> 
> 
> I don't release the CGContextRef because I don't 'create' it.
> If I release it, the app doesn't crash but doesn't draw anything anymore 
> after the first one.
> 
> My data provider just copy bytes from a legacy data structure.
> 
> What am I doing wrong ?
> Or maybe there is a better way of doing this ?
> 
> Thanks for any help !
> 
> -- 
> Keep intel OUTSIDE my Mac !
> Hiii !!! I can see Intel chips creeping around my G5 !
> 
> Eric M.
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/david.duncan%40apple.com
> 
> This email sent to david.dun...@apple.com

--
David Duncan


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

RE: NSStatusItem, Popover and NSTextField make responder

2015-04-17 Thread Lee Ann Rucker
It's just not possible. When you're in the runloop to track the menu (or 
presumably popover, though I haven't tried that) [NSApp isActive] is NO, 
activateIgnoringOtherApps has no effect, so there's no keyWindow and the 
textfield needs to be in a keyWindow to become firstResponder. I have done 
everything I can think of - performSelector...afterDelay, dug down into Carbon 
Events and Event Taps, and filed radars on it.

We get it to work by using a window instead of a menu, but that has its own 
problems - in fullscreen the menubar assumes it's free to slide back up because 
there's no visible menu, the button won't stay highlighted because there's no 
menu, etc.

From: cocoa-dev-bounces+lrucker=vmware@lists.apple.com 
[cocoa-dev-bounces+lrucker=vmware@lists.apple.com] on behalf of Alex Kac 
[a...@webis.net]
Sent: Friday, April 17, 2015 9:20 AM
To: cocoa-dev@lists.apple.com
Subject: NSStatusItem, Popover and NSTextField make responder

I have a popover that is opened on tapping a menu status item. In the
popover I have a text field that I’d like to have become active when
the popover is open.

When the app is in the foreground and you tap on the status item it
does become active. When its in the background, it does not. In beta,
we’re getting reports from users that they are expecting it to and
other apps do.

Now I’ve been in the iOS world for a few years and the OS X world only
a few months, but I used to work in what is now Carbon and I’ve been
lurking here for years so I’ve got a few ideas, but so far none of
them are working.

I’d love to hear some tips if you have any. I thought it was something
with run-loop modes but I haven’t had any luck with that.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/lrucker%40vmware.com

This email sent to lruc...@vmware.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Images Being Substituted in UIText .attributedText -- It's an iOS bug

2015-04-17 Thread Michal L. Wright
Hi,

Well, I used a tech support incident and it was determined that I should submit 
a bug report, which I have done. (And the tech support incident was credited 
back to my account.)

-- Mike

> Message: 1
> Date: Fri, 10 Apr 2015 19:18:22 -0400
> From: "Michal L. Wright" 
> To: cocoa-dev@lists.apple.com
> Subject: Images Being Substituted in UIText .attributedText
> Message-ID: 
> Content-Type: text/plain; charset=windows-1252
> 
> Hi,
> 
> I have a pair of almost-matching flat-file database apps, iData Pro for the 
> Mac and iData Pro-Mobile for mobile devices. Datafiles for both apps are 
> written to disk as a plist (xml) file and are almost identical in structure. 
> Up till now, iData Pro-Mobile could display only plain text. Now I’m 
> modifying it to display formatted text, like the Mac version.
> 
> Datafiles are organized into records.
> 
> Each record  includes a block of RTFD text, which is an NSAttributedString 
> object that is displayed in an NSTextView in iData Pro and in a UITextView in 
> iData Pro-Mobile. A typical NSAttributedString is encoded as NSData like this 
> in the xml:
> 
> TextRTFD
> 
> cnRmZAADAgcAAABUWFQucnRmAQAAAC51AQAAKwAA
> AAEAAABtAQAAe1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcY29jb2Fy
> dGYxMjY1XGNvY29hc3VicnRmMjEwCntcZm9udHRibFxmMFxmbmls
> XGZjaGFyc2V0MCBHZW9yZ2lhO30Ke1xjb2xvcnRibDtccmVkMjU1
> XGdyZWVuMjU1XGJsdWUyNTU7fQpccGFyZFx0eDU2MFx0eDExMjBc
> dHgxNjgwXHR4MjI0MFx0eDI4MDBcdHgzMzYwXHR4MzkyMFx0eDQ0
> ODBcdHg1MDQwXHR4NTYwMFx0eDYxNjBcdHg2NzIwCgpcZjBcZnMy
> NCBcY2YwIE1yLiBGcmVkIEZhcmtsZVwKMTIzNDU2NyBOb3J0aHdl
> c3QgQnJvYWR3YXkgQXZlLlwKQXVzdGluLCBUWCAgNzc3NzdcClwK
> V29yazogNTE1LTU1NS0wOTg3XApGQVg6IDUxNS01NTUtNjc4OVwK
> SG9tZTogNTE1LTU1NS00NTY3XApcCn0BIwEH
> VFhULnJ0ZhDBUAtVtgEA
> 
> 
> The UIText and NSAttributedString calls for iOS are a bit different from the 
> ones I use on the Mac, but I now have the mobile app showing formatted text 
> with embedded images. I’ve added “Insert Image” and “Set Font” menu items to 
> the editing menu, and they are working fine. “Insert Image” gives access to 
> saved photos, and “Set Font” includes a font picker and a color picker.
> 
> The results are great, except for one rather bizarre glitch — when stepping 
> throught records (and making no changes), images in the currently displayed 
> record are occasionally replaced by images from other previously displayed 
> records.
> 
> I’ve hacked around a bit, but don’t really have any idea what could be 
> causing this behavior. It’s almost as though the system is caching the images 
> and getting them mixed up at display time. This occurs in what seems to be an 
> entirely random way. I haven’t been able to find any repeatable pattern of 
> replacements.
> 
> A particularly odd thing is that if I select and copy an incorrect image, 
> then paste it into a different datafile, the correct image is pasted in. This 
> seems to indicate some kind of disconnect between the display of images and 
> the underlying attributed text.
> 
> Here’s what I do iData Pro when parsing the NSData TextRTFD for the display 
> of a new record:
> 
>   IBOutlet NSTextView *freeformTextView; // From my 
> RecordViewController.h file. RecordViewController is a UIViewController
> 
>   NSUInteger length = [freeformTextViewString length];
> 
>// Clear attributes displayed for the previous record
>   NSRange fuRange = NSMakeRange(0, length);
>   [freeformTextView setTypingAttributes:nil];
>   [[freeformTextView textStorage] removeAttribute:NSLinkAttributeName 
> fuRange];
> 
>   // Replace the text; use the RTFD version if it is available
>   NSData *textRTFD = [record textRTFD];  // from the xml datafile
>   if (textRTFD])
>   [freeformTextView replaceCharactersInRange:allRange 
> withRTFD:textRTFD];
> 
> This results in the display of the RTFD styled text with any attachments, 
> including links, images, and/or sound files. (And the preceding code has been 
> in use for over a decade with no problems.)
> 
> Here’s what I do in iData Pro-Mobile:
> 
>   // Replace the attributedText; use the RTFD version if it is available
>   NSData *textRTFD = [record textRTFD];
>   if (textRTFD)
>   {
>   NSError *error;
>   NSDictionary *dict = [NSDictionary 
> dictionaryWithObjectsAndKeys: NSRTFDTextDocumentType, 
> NSDocumentTypeDocumentAttribute, nil];
> 
>   NSAttributedString *attributedText = [[NSAttributedString 
> alloc] initWithData:textRTFD options:dict documentAttributes:NULL 
> error:&error];
> 
>   [freeformTextView setAttributedText:attributedText];
>   }
> 
> Only images are affected. Text formatting — text content, fonts, point sizes, 
> text colors — remains stable. When a datafile is transferred to the Mac and 
> opened in the Mac app, it displays as expected.
> 
> Is it obvious that I’m doing something wrong, or could this be an iOS bug?
> 
> Th

No sound through speaker

2015-04-17 Thread Ron Wagner


I am receiving reports from users that the sound generated from our app isn’t 
always coming out of the iPhone speaker, but will always come out of the ear 
buds when they are plugged in. This is an intermittent problem, though when the 
problem is presenting itself, it can remain for days. 

We are generating sound with two APIs: AVAudioPlayer and AVSpeechSynthesizer, 
used in different parts of the app, not at the same time. I have remotely 
logged for some users info that the APIs are in fact being called, and that 
there are no errors being returned.

The users also report that sound from other apps such as YouTube and other 
sound affects apps, etc., play through the speakers fine when our app is 
exhibiting this problem.

I have done some testing and found that sound will play through the earbuds 
regardless of the position of the mute switch on the side of the phone above 
the volume buttons, but will not play through the speaker (with the earbuds 
unplugged) if the mute switch is in the muted position. I asked the users if 
they might have had the mute switch in the muted position, and they state it 
was not in the mute position, and cycling the mute switch on and off had no 
affect.

Seeing as how we have not implemented a “cone of silence” feature in our app, 
I’m out of ideas of where to look and how to debug this problem. Since the 
sound always plays through earbuds when plugged in, I can’t see how it would be 
our code. 

Has anyone else experienced sound not working in one app, or have any ideas of 
why sound would not play through the speaker?

Thanks
Ron Wagner
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: No sound through speaker

2015-04-17 Thread Uli Kusterer
On 17 Apr 2015, at 22:32, Ron Wagner  wrote:
>  I asked the users if they might have had the mute switch in the muted 
> position, and they state it was not in the mute position, and cycling the 
> mute switch on and off had no affect.
> 
> Seeing as how we have not implemented a “cone of silence” feature in our app, 
> I’m out of ideas of where to look and how to debug this problem. Since the 
> sound always plays through earbuds when plugged in, I can’t see how it would 
> be our code. 

 If I may doubt your users for a second: There are different categories of 
sound (I don’t recall what they were called precisely), which control whether a 
sound should be muted by the mute switch or not. Have you checked whether 
you’re possibly using the wrong sound category? The users you asked may have 
only thought that since YouTube plays sound, it isn’t muted.

In general, the “mute” switch is actually a “ringer” switch. That is, it’s 
supposed to *only* suppress notification sounds and ring tones, not e.g. movie 
audio. Could that perhaps be your issue? I think the APIs that let you set this 
category of sound are called “audio session” or so?

Cheers,
-- Uli Kusterer
“The Witnesses of TeachText are everywhere...”
http://zathras.de


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: No sound through speaker

2015-04-17 Thread David Rowland
Check Apple’s documentation for Audio Sessions,

https://developer.apple.com/library/ios/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/Introduction/Introduction.html
 


Perhaps it will help.

David



> On Apr 17, 2015, at 1:32 PM, Ron Wagner  wrote:
> 
> 
> 
> I am receiving reports from users that the sound generated from our app isn’t 
> always coming out of the iPhone speaker, but will always come out of the ear 
> buds when they are plugged in. This is an intermittent problem, though when 
> the problem is presenting itself, it can remain for days. 
> 
> We are generating sound with two APIs: AVAudioPlayer and AVSpeechSynthesizer, 
> used in different parts of the app, not at the same time. I have remotely 
> logged for some users info that the APIs are in fact being called, and that 
> there are no errors being returned.
> 
> The users also report that sound from other apps such as YouTube and other 
> sound affects apps, etc., play through the speakers fine when our app is 
> exhibiting this problem.
> 
> I have done some testing and found that sound will play through the earbuds 
> regardless of the position of the mute switch on the side of the phone above 
> the volume buttons, but will not play through the speaker (with the earbuds 
> unplugged) if the mute switch is in the muted position. I asked the users if 
> they might have had the mute switch in the muted position, and they state it 
> was not in the mute position, and cycling the mute switch on and off had no 
> affect.
> 
> Seeing as how we have not implemented a “cone of silence” feature in our app, 
> I’m out of ideas of where to look and how to debug this problem. Since the 
> sound always plays through earbuds when plugged in, I can’t see how it would 
> be our code. 
> 
> Has anyone else experienced sound not working in one app, or have any ideas 
> of why sound would not play through the speaker?
> 
> Thanks
> Ron Wagner
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/rowlandd%40sbcglobal.net
> 
> This email sent to rowla...@sbcglobal.net

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com