|
There's nothing wrong with the code you posted, other than being so heavily excerpted that nobody could possibly help you with your problem. You should see what it does in the debugger; it's possible run it on the device while still connected to the debugger.
|
# ? Dec 28, 2015 16:32 |
|
|
# ? Jun 5, 2024 06:09 |
Well, if I do that I get a symbol dump, but I'm not sure how to read it. The last thing in the stack trace before each crash is TTSPlaybackSetUseVoiceBooster. I'm happy to delve into this to whatever degree I have to; if that means building an isolated case project I can. E: code:
Data Graham fucked around with this message at 17:03 on Dec 28, 2015 |
|
# ? Dec 28, 2015 16:53 |
I thought it might be that I need to link AVFoundation and/or CoreAudio with the keyboard extension at compile time, but no dice. And I know at least it's not about the declaration options since it does the same thing if I init the synthesizer inline in the speakMessage function.
|
|
# ? Dec 28, 2015 17:31 |
I made a super simple demo app that has this behavior.
|
|
# ? Dec 28, 2015 18:40 |
|
Anyone have good advice on how to get into kernel programming? I've grokked a little bit of Mach IPC, but want to learn the other deep stuff that makes xpc (and others) tick.
|
# ? Dec 28, 2015 19:52 |
|
Doctor w-rw-rw- posted:Anyone have good advice on how to get into kernel programming? I've grokked a little bit of Mach IPC, but want to learn the other deep stuff that makes xpc (and others) tick. Step 1: grow a very long beard
|
# ? Dec 28, 2015 23:55 |
Data Graham posted:I made a super simple demo app that has this behavior. Status update, I've punted and now I'm just having it play a prerecorded audio clip. I really feel like this should not be necessary though
|
|
# ? Dec 28, 2015 23:57 |
|
I made a sample app and speech synthesis works fine vv
|
# ? Dec 29, 2015 01:15 |
|
Data Graham posted:Well, if I do that I get a symbol dump, but I'm not sure how to read it. The last thing in the stack trace before each crash is TTSPlaybackSetUseVoiceBooster. The immediate cause of the crash is that this function has been passed a null pointer as its first argument, which apparently isn't allowed. I assume you're not calling it directly, but maybe you can figure out from the backtrace why that's happening. Maybe you're doing something at the wrong point during initialization?
|
# ? Dec 29, 2015 02:25 |
Doc Block posted:I made a sample app and speech synthesis works fine vv Thanks for this—but the main thing is speech synthesis from within a keyboard extension. Speaking utterances from the containing app works fine. Sorry if I wasn't clear.
|
|
# ? Dec 29, 2015 02:37 |
rjmccall posted:The immediate cause of the crash is that this function has been passed a null pointer as its first argument, which apparently isn't allowed. I assume you're not calling it directly, but maybe you can figure out from the backtrace why that's happening. Maybe you're doing something at the wrong point during initialization? I have to imagine so. I can't figure why it would work in the simulator but not on the device, though. Is viewDidLoad the right place to be alloc'ing my synthesizer? I put my project here: https://github.com/bctiemann/kb-speech-test
|
|
# ? Dec 29, 2015 03:02 |
|
I added a keyboard extension to my test app, and yeah, it seems that speech synthesis doesn't work from inside keyboard extensions.
|
# ? Dec 29, 2015 03:21 |
|
Data Graham posted:I have to imagine so. I can't figure why it would work in the simulator but not on the device, though. Is viewDidLoad the right place to be alloc'ing my synthesizer? That doesn't crash for me, but I did get this: quote:2015-12-28 19:49:12.458 KB Test Keyboard[3600:989240] __27-[_UIRemoteKeyboards proxy]_block_invoke Failed to access remote service: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.UIKit.KeyboardManagement.hosted was invalidated." UserInfo={NSDebugDescription=The connection to service named com.apple.UIKit.KeyboardManagement.hosted was invalidated.} E: Yep. The docs suggest you don't get access to the audio session directly: Text Programming Guide for iOS/Playing Input Clicks posted:The system automatically manages the audio session for custom input clicks, including audio ducking as needed. (For information on audio sessions, see Audio Session Programming Guide.) As for why: Audio Session Programming Guide/Running Your App in the Simulator posted:When you add audio session support to your app, you can run your app in the Simulator or on a device. However, the Simulator does not simulate audio session behavior and does not have access to the hardware features of a device. Also, the error when 'Speak Message' is pressed: quote:2015-12-28 20:05:19.775 KB Test Keyboard[3950:994816] 20:05:19.775 ERROR: [0x16e2d3000] 645: Couldn't connect to com.apple.audio.AudioQueueServer; AudioQueue will not be usable Doctor w-rw-rw- fucked around with this message at 05:06 on Dec 29, 2015 |
# ? Dec 29, 2015 04:49 |
Where do you see that console output? I connect to the keyboard process in Debug, but I never get any console logging for the keyboard target, only for the container app. Anyway, thanks for chasing that down; fooey.
|
|
# ? Dec 29, 2015 05:16 |
|
I suspect the constrained environment of a keyboard extension may not be allowed to access audio services in the way you want. Are the APIs in question marked as extension-safe? And if they are extension-safe APIs, does your extension have any required entitlements? Also, an "is it plugged in" question: Are you certain your extension links the frameworks you need?
|
# ? Dec 29, 2015 05:22 |
|
It makes sense that keyboard extensions can't play audio themselves, with the OS handling keyboard clicks etc. A user having keyclicks turned off is a pretty clear indication they want the keyboard to be silent, and even if they don't have them disabled they almost certainly don't want their music/podcast/whatever getting cut out so the keyboard can play cute little sounds or whatever while they type out a quick text message. Doc Block fucked around with this message at 05:55 on Dec 29, 2015 |
# ? Dec 29, 2015 05:24 |
|
Data Graham posted:Where do you see that console output? I connect to the keyboard process in Debug, but I never get any console logging for the keyboard target, only for the container app.
|
# ? Dec 29, 2015 07:32 |
Doctor w-rw-rw- posted:I'm launching the KB Test Keyboard extension against the test app on a 9.0 device. Maybe 9.2 has a crash? Nah, it's the same for me back to 8.4. Anyway, no, what I meant was, how do you actually get any output to show up? I don't get any NSLog messages that I put in the keyboard extension, regardless of whether I've selected the keyboard target in the console log viewer, or even if I only attach to the keyboard process and not the container app process. It's the same on the simulator vs. the device too. Is there some trick to this?
|
|
# ? Dec 30, 2015 12:48 |
|
Select the keyboard scheme instead of your app's scheme, then build & run that. It'll ask you which app to run your extension in, and once you pick one you're off and running and any logged messages should show up.
|
# ? Dec 30, 2015 19:46 |
|
Data Graham posted:Is there some trick to this?
|
# ? Dec 30, 2015 20:11 |
Doc Block posted:Select the keyboard scheme instead of your app's scheme, then build & run that. It'll ask you which app to run your extension in, and once you pick one you're off and running and any logged messages should show up. Huh. That was the trick. Thanks!
|
|
# ? Dec 30, 2015 20:18 |
|
Speaking of random nonsense that breaks everything: If you have a Swift file with multiple XCTestCase subclasses then Xcode will steadfastly refuse to enable the record UI test button. Yeah.
|
# ? Dec 30, 2015 20:28 |
|
Plowing my way through adopting size classes and I seriously love laying things out manually. I just like setting precise margins, sizes, and offsets, and seeing everything fall into place. It also reaffirms my dislike of Storyboard layout. Everything I've ever laid out in IB I've ended up redoing in code and been much happier.
|
# ? Dec 31, 2015 00:14 |
|
lord funk posted:Plowing my way through adopting size classes and I seriously love laying things out manually. I just like setting precise margins, sizes, and offsets, and seeing everything fall into place. Drop iOS 8- and adopt UIStackView. It's what Autolayout v1 should have been, with the rest of this Autolayout stuff lurking in the shadows for truly advanced cases.
|
# ? Dec 31, 2015 00:37 |
|
Ender.uNF posted:Drop iOS 8- and adopt UIStackView. It's what Autolayout v1 should have been, with the rest of this Autolayout stuff lurking in the shadows for truly advanced cases. Nope. Not getting burned by any more Apple layout stuff. I don't like all the opaque work that goes on you don't get to see. For example: UIStackView Class Reference posted:Note: Baseline alignment only works on views whose height matches their intrinsic content size’s height. If the view is stretched or compressed, the baseline appears in the wrong location. Good to know! And I'm sure there are a dozen other little niggles that you'll only find out when you're knee-deep in a complicated layout and you can't figure out why your stack keeps shifting down by 30 points and ahhhhhHHHHHHHH. This is clearly a YMMV, but I'm just so much happier knowing everything about why my views are where they are.
|
# ? Dec 31, 2015 00:49 |
|
layoutSubviews is love, layoutSubviews is life (or frankly anything that allows you to control the execution of measure+layout phases is decent)
|
# ? Dec 31, 2015 02:22 |
|
Doctor w-rw-rw- posted:Anyone have good advice on how to get into kernel programming? I've grokked a little bit of Mach IPC, but want to learn the other deep stuff that makes xpc (and others) tick. Is there some specific technology you're exited about? There's an almost infinite depth of complexity when diving into operating systems, it helps to have some small piece to pick apart. XPC is built on top of Mach IPC and libdispatch - there's no extra kernel magic going on. However, XPC is going to be more difficult for you to investigate because it isn't open source. Here's some books on the lower layers of OS X: this one is pretty old school (10.4) but covers a lot of in-depth kernel stuff: http://osxbook.com and this one is supposedly more up to date, but I haven't read it yet: http://newosxbook.com
|
# ? Jan 2, 2016 06:46 |
|
Yep, I own both. Maybe looking at NextBSD's implementation of XPC will be educational.
|
# ? Jan 2, 2016 08:50 |
|
Doctor w-rw-rw- posted:Yep, I own both. Maybe looking at NextBSD's implementation of XPC will be educational. One way to get into it would be to dig into the implementation and try to fix some bugs or implement some features in their APIs in general (beyond just XPC too). A bonus would be the potential mentoring you could get from others hacking on NextBSD, they're top-tier OS hackers. Another way to get your feet wet would be to help with the bring-up of the Swift Core Libraries version of libdispatch and Foundation on non-OS X platforms. A lot of that stuff can use OS-level functionality, whether that's in-kernel or a layer above it. For one example, NSTask is really best implemented atop posix_spawn but either it may not be supported or not have all the needed features on Linux, FreeBSD, NetBSD, etc. It's not necessarily just kernel development , it's systems development.
|
# ? Jan 2, 2016 09:54 |
|
Here is my two word review of UIStackView: It's good.
|
# ? Jan 2, 2016 22:33 |
|
I feel so stupid saying that to anyone who's ever used, like, any other UI framework ever. Yet I agree completely.
|
# ? Jan 3, 2016 10:13 |
|
pokeyman posted:I feel so stupid saying that to anyone who's ever used, like, any other UI framework ever. Yet I agree completely. No, don't fight it. I'm increasingly convinced that 90%+ precent of UI code is expressible as a FlexBox/UIStackView, and we'd all be better for it if everyone just collectively came to that conclusion.
|
# ? Jan 3, 2016 14:50 |
|
I'd been dreading redoing a custom table cell I had because I'd changed some underlying mechanics, and it turned out to be basically trivial to just make it a big vertical UIStackView with smaller ones when I needed to line up a couple elements horizontally. It makes basic property/edit pages take the amount of time/effort I expect such things to take for how much thought needs to go into them. I can lay out things that go like label-text box-label-textbox-button without a million trips to the constraint edit panes getting them to line up properly. I don't consider myself a good designer by any means, and maybe a Real Designer would want to do much more custom layout than I'm doing. But when I just want to whack together the face to a bunch of backend code I wrote, add a single element to a settings page or whatever, I can now do that without expecting it to be an hour+ part of implementing the feature. It's the sleeper best feature of iOS 9.
|
# ? Jan 4, 2016 00:38 |
|
I was updating my app for iOS 9 and replaced ~200 lines of custom layout code with 3 lines of stack view stuff. Stack view is great.
|
# ? Jan 4, 2016 03:26 |
|
A buddy of mine has had success using this drop in replacement for the UIStackView in order to still support iOS8: https://github.com/tomvanzummeren/TZStackView I'm thinking about trying it out soon because
|
# ? Jan 4, 2016 14:26 |
|
Dessert Rose posted:Here is my two word review of UIStackView: I'd love to recommend that to my fellow developer, in case he ever decides that he prefers easy coding. But for now, he insists on supporting all manner of ancient hardware he happens to have on hand.
|
# ? Jan 5, 2016 06:34 |
|
kuroshi posted:I'd love to recommend that to my fellow developer, in case he ever decides that he prefers easy coding. But for now, he insists on supporting all manner of ancient hardware he happens to have on hand. Such is the life of supporting 2-years-back devices 99% chance he has to do so biz-wise
|
# ? Jan 5, 2016 06:42 |
|
kuroshi posted:I'd love to recommend that to my fellow developer, in case he ever decides that he prefers easy coding. But for now, he insists on supporting all manner of ancient hardware he happens to have on hand. Well, if you're not using Interface Builder I don't imagine it would be too hard to write your own stacking view. This was certainly possible back in ~2013, in the iOS 5 days.
|
# ? Jan 5, 2016 06:44 |
|
kuroshi posted:I'd love to recommend that to my fellow developer, in case he ever decides that he prefers easy coding. But for now, he insists on supporting all manner of ancient hardware he happens to have on hand. Didn't read the post above, did you?
|
# ? Jan 5, 2016 15:53 |
|
|
# ? Jun 5, 2024 06:09 |
|
Doh004 posted:Didn't read the post above, did you? He still intends to support iOS 6.1. For personal reasons. He is in charge of the project, after all. The business reason is that he actually happens to own several devices that were EOLed at iOS 6.1, and by gum, he'll make sure his software runs perfectly on them as well as any new device. The software is the mobile version of foobar2000, which is being launched for iOS, Android, Windows Phone 8, and Windows Universal for Windows 10 (and 10 Phone). So far, it's interesting benchmarking things on my various devices, since I have to limit various quad core Android devices to only two benchmark threads to compare per-core performance to the iOS devices I have, since they're all dual core devices. So far, the iOS devices stomp all over everything else.
|
# ? Jan 7, 2016 08:58 |