Audio Cuts in random time, have to unplug headphones - ios

Very weird "crash". I am using
oscillator = AKOperationGenerator(channelCount: 2, operations: { parameters in
let portamentoOp = parameters[0].portamento(halfDuration: parameters[1])
let sineOp = AKOperation.sineWave(frequency: portamentoOp, amplitude: parameters[2])
let sawOp = AKOperation.sawtoothWave(frequency: portamentoOp, amplitude: parameters[2])
return [sawOp, sineOp] //saw on left, sine on right.
})
oscillator?.parameters = [440.0, 0.001, 1.0, 0.99]
To generate tones in my app, however after couple minutes of "playing" it just stops, no crash, no error nothing. Only thing I can do is to unplug headphones and plug them back again, setup audio again and it starts.
This is logs from device:
default 20:32:42.906934+1200 mediaserverd CAReportingClient.mm:470:-[CAReportingClient sendMessage:category:type:reporters:]: message {
"inf_frames" = 0;
"issue_type" = NonFinite;
"nan_frames" = 1083;
node = "PreDSP - { [ type: phpw; conn: 1; rout: 1 ] }";
"rtaid_client" = VA;
}: (
133143986217
)
default 20:32:42.907327+1200 mediaserverd AudioIssueDetectorManager.cpp:250:HandleAudioIssue: RTAID [ use_case=Generic issue_type=NonFinites clientID=VA node=PreDSP - { [ type: phpw; conn: 1; rout: 1 ] } ] -- [ nan_frames=1083 inf_frames=0 ]
default 20:32:42.909321+1200 rtcreportingd sendMessageWithDictionary: Sending message for session 41
default 20:32:42.909588+1200 rtcreportingd <private>(sendMessage): realtime is 0
default 20:32:42.909701+1200 rtcreportingd <private>(sendMessage): Batching 3, 1, 1
default 20:32:42.910209+1200 mediaserverd CAReportingClient.mm:470:-[CAReportingClient sendMessage:category:type:reporters:]: message {
"inf_frames" = 0;
"issue_type" = NonFinite;
"nan_frames" = 1083;
node = "PostDSP - { [ type: phpw; conn: 1; rout: 1 ] }";
"rtaid_client" = VA;
}: (
133143986217
)
default 20:32:42.911062+1200 mediaserverd AudioIssueDetectorManager.cpp:250:HandleAudioIssue: RTAID [ use_case=Generic issue_type=NonFinites clientID=VA node=PostDSP - { [ type: phpw; conn: 1; rout: 1 ] } ] -- [ nan_frames=1083 inf_frames=0 ]
default 20:32:42.913038+1200 rtcreportingd sendMessageWithDictionary: Sending message for session 41
default 20:32:42.913957+1200 rtcreportingd <private>(sendMessage): realtime is 0
default 20:32:42.914127+1200 rtcreportingd <private>(sendMessage): Batching 3, 1, 1
default 20:32:42.935883+1200 sharingd Identification starting maintenance timer
default 20:32:42.937060+1200 rapportd BLE device changed: SFDevice ID a6207782-86f9-e3fe-2ca2-fc6f74e80bd4, IDS B710183A, RSSI -47 (-44)*N, Nm 'Tomas’s MacBook Pro', Md 'MacBookPro16,1', DuetSync, PairedBT, PairedSys Conjectured, rapportID B710183A-9C32-45F2-B698-72BBC69FED93, WiFiP2P, DF 0x88 < MyiCloud AirDrop >
default 20:32:42.938332+1200 sharingd CompanionLink changed: IDS B710183A, Nm 'Tomas’s MacBook Pro', Md 'MacBookPro16,1'
default 20:32:43.009206+1200 powerlogHelperd {"msg":"CLCopyAppsUsingLocation", "event":"activity"}
default 20:32:43.038177+1200 nsurlsessiond Triggering periodic update to powerlog for client <private>
default 20:32:43.260560+1200 DTServiceHub Heartbeat

Related

Linux rx and tx stats in /proc/tty/driver/serial file is not working

I am trying to echo some string to /dev/ttyS0 and the rx and tx stats in /proc/tty/driver/serial remain 0.
If I change the irq of ttyS0 to 0 and then echo some string to ttyS0, the stats are changing according to the length of the string.
Would anyone be able to help me with this?
output of setserial -g /dev/ttyS[0123]
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 11
/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 10
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
output of stty -F /dev/ttyS0 -a
speed 115200 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S;
susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke -flusho -extproc
out put of cat /proc/interrupts for irq 11 with 16 cpu.
11: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 IO-APIC 11-edge ttyS0
output of cat /proc/tty/driver/serial:
0: uart:16550A port:000003F8 irq:11 tx:228 rx:0 RTS|DTR|DSR|CD|RI
1: uart:16550A port:000002F8 irq:10 tx:0 rx:0 CTS|DSR|CD|RI
2: uart:unknown port:000003E8 irq:4
3: uart:unknown port:000002E8 irq:3
As i said I have tried to change thee irq to 0 and it worked. But what is wrong with irq 11. There is no deviced registered for irq 11 in /proc/interrupts except ttyS0.

Netlogo ecosystem model die command

I am trying to simulate what happens to vultures if they randomly stumble upon a carcass that has been poisoned by poachers. The poisoned carcass needs to be random. I also need to plot the deaths, so do i need to set up a dead/poisoned state in order to plot the deaths, do I need to code a to die section. Im not sure. TIA
to go
; repeat 10800 [
ask vultures
[
if state = "searching" [ search-carcasses ]
if state = "following" [follow-leaders-find-carcasses]
if state = "searching"
[ if random-float 1 < ( 1 / 360 )
[ ifelse random 2 = 0
[ rt 45 ]
[ lt 45 ] ] ]
if state != "feeding"
[ fd 0.009 ]
if state = "leader" [set time-descending time-descending + 1]
if mycarcass != 0
[ if distance mycarcass <= 0.009
[ set state "feeding"
ask mycarcass
[ set occupied? "yes" ] ] ] if state = "feeding" [
ask mycarcass
[if poisoned? = "yes"
[set state "poisoned"] ] ] if state = "poisoned" [die] ] tick ; ]

kivy does not use touchscreen (in ubuntu touchscreen is working correctly)

I got an ubuntu 18.04 lts fresh install on x86. Connected is a iiyama touch screen. Off the box under ubuntu touchscreen support is active and working.
My Kivy app does not work with touchscreen support.
the log output of kivy is
[DEBUG ] Base: Create provider from probesysfs,provider=hidinput
[DEBUG ] ProbeSysfs: using probesysfs!
[DEBUG ] ProbeSysfs: found device: USBest Technology SiS HID Touch Controller at /dev/input/event3
[INFO ] ProbeSysfs: device match: /dev/input/event3
[INFO ] HIDInput: Read event from </dev/input/event3>
[INFO ] Base: Start application main loop
[INFO ] HIDMotionEvent: using <USBest Technology SiS HID Touch Controller>
[INFO ] HIDMotionEvent: <USBest Technology SiS HID Touch Controller> range ABS X position is 0 - 4095
[INFO ] HIDMotionEvent: <USBest Technology SiS HID Touch Controller> range ABS Y position is 0 - 4095
[INFO ] HIDMotionEvent: <USBest Technology SiS HID Touch Controller> range position X is 0 - 4095
[INFO ] HIDMotionEvent: <USBest Technology SiS HID Touch Controller> range position Y is 0 - 4095
I configured in the input section of config.ini (kivy):
[input]
hid_%(name)s = probesysfs,provider=hidinput
Before, under my last installation I got the kivy app running (using touchscreen) with the same ubuntu version.
I do not know, what I have missed so far.
Any hints to get it analysed?
Thanks in advance!
I want to clarify the situation.
Hardware: iiyama ProLite T2435MSC-B2, intel nux i3, ubuntu 18.0.4 lts, kivy 1.10.1.
To get the touchscreen working in kivy app, you have to set the following input section in ~/.kivy/config.ini.
Important to say is, that "fullscreen = auto" has to be set, else noch touch is recognized in the kivy app.
[kivy]
keyboard_repeat_delay = 300
keyboard_repeat_rate = 30
log_dir = logs
log_enable = 0
log_level = debug
log_name = kivy_%y-%m-%d_%_.txt
window_icon =
keyboard_mode = systemanddock
keyboard_layout = qwertz
desktop = 1
exit_on_escape = 1
pause_on_minimize = 0
kivy_clock = default
default_font = ['Roboto', 'data/fonts/Roboto-Regular.ttf', 'data/fonts/Roboto-Italic.ttf', 'data/fonts/Roboto-Bold.ttf', 'data/fonts/Roboto-BoldItalic.ttf']
log_maxfiles = 100
window_shape = data/images/defaultshape.png
config_version = 20
[graphics]
display = -1
fullscreen = auto
height = 1500
left = 0
maxfps = 60
multisamples = 2
position = auto
rotation = 0
show_cursor = 0
top = 0
width = 2000
resizable = 1
borderless = 0
window_state = visible
minimum_width = 0
minimum_height = 0
min_state_time = .035
allow_screensaver = 1
shaped = 0
[input]
mtdev_%(name)s = probesysfs,provider=mtdev
hid_%(name)s = probesysfs,provider=hidinput
[postproc]
double_tap_distance = 20
double_tap_time = 250
ignore = []
jitter_distance = 0
jitter_ignore_devices = mouse,mactouch,
retain_distance = 50
retain_time = 0
triple_tap_distance = 20
triple_tap_time = 375
[widgets]
scroll_timeout = 250
scroll_distance = 20
scroll_friction = 1.
scroll_stoptime = 300
scroll_moves = 5
[modules]

How to resolve the Flume Syslog set up error - "Event size larger than specified event size: 2500. Consider increasing the max event size"

I am trying to set up Flume syslog source using org.apache.flume.source.MultiportSyslogTCPSource. Set up and configuration successful but I get the following error while flume generates the event from syslog.
[INFO ] [2019-03-28 13:22:27.217] [[channel=file-channel] - CheckpointBackUpThread] [org.apache.flume.channel.file.EventQueueBackingStoreFile] - Checkpoint backup completed.
[WARN ] [2019-03-28 13:22:31.853] [NioProcessor-2]
[org.apache.flume.source.MultiportSyslogTCPSource] - Event size larger than specified event size: 2500. Consider increasing the max event size.
[INFO ] [2019-03-28 13:22:35.686] [SinkRunner-PollingRunner-DefaultSinkProcessor] [org.apache.flume.sink.LoggerSink] - Event: { headers:{flume.syslog.status=Invalid} body: 31 33 33 62 32 20 74 3C 31 33 34 3E 4D 61 72 20 133b2 t<134>Mar }
Here is my configuration looks like:
#source,channel and sink
testagent.sources = testlog
testagent.channels = file-channel
testagent.sinks = logger-sink
#source
testagent.sources.testlog.type = org.apache.flume.source.MultiportSyslogTCPSource
testagent.sources.testlog.ports = 9002
testagent.sources.testlog.host = 127.0.0.1
#sink
testagent.sinks.logger-sink.type = logger
#channel
testagent.channels.file-channel.type = file
testagent.channels.file-channel.dataDirs = /test/data/01/
testagent.channels.file-channel.checkpointDir = /test/data/01/checkpoint
testagent.channels.file-channel.useDualCheckpoints = true
testagent.channels.file-channel.backupCheckpointDir = /test/data/01/checkpoint-backup
testagent.channels.file-channel.transactionCapacity = 10000
testagent.channels.file-channel.checkpointInterval = 20000
testagent.channels.file-channel.maxFileSize = 1072692224
testagent.channels.file-channel.minimumRequiredSpace = 524288000
testagent.channels.file-channel.capacity = 1000000
testagent.channels.file-channel.keep-alive = 3
testagent.channels.file-channel.checkpointOnClose = true
testagent.sinks.logger-sink.channel = file-channel
testagent.sources.testlog.channels = file-channel
Logs generated out of my test application should successfully be displayed into the flume agent log and events should be generated out of each log statement(line).
Update the size of the event in the configuration as shown below:
testagent.sinks.logger-sink.maxBytesToLog = 256
The default size of the event is 16 bytes.

Is it possible to get the duration (time) video through Youtube data API v3.0

Is it possible to get the duration
(time) video through Youtube data API v3.0.
If so, how?
You will have to make a call to the Youtube Data API's Video resource after you make the search call. You can put up to 50 video id's in search, so you wont have to call it for each element.
https://developers.google.com/youtube/v3/docs/videos/list
You'll want to set part=contentDetails, because duration is there.
For example the following call:
https://www.googleapis.com/youtube/v3/videos?id=9bZkp7q19f0&part=contentDetails&key={YOUR_API_KEY}
Gives this result:
{
"kind": "youtube#videoListResponse",
"etag": "\"XlbeM5oNbUofJuiuGi6IkumnZR8/ny1S4th-ku477VARrY_U4tIqcTw\"",
"items": [
{
"id": "9bZkp7q19f0",
"kind": "youtube#video",
"etag": "\"XlbeM5oNbUofJuiuGi6IkumnZR8/HN8ILnw-DBXyCcTsc7JG0z51BGg\"",
"contentDetails": {
"duration": "PT4M13S",
"dimension": "2d",
"definition": "hd",
"caption": "false",
"licensedContent": true,
"regionRestriction": {
"blocked": [
"DE"
]
}
}
}
]
}
The time is formatted as an ISO 8601 string. PT stands for Time Duration, 4M is 4 minutes, and 13S is 13 seconds.
Please refer to this question for more details
Here is how I did it from .NET and C#.
First include the "contentDetails" part
var searchListRequest = youtubeService.Videos.List("snippet,contentDetails");
Second convert the duration to something more programmatically manageable as follows:
TimeSpan YouTubeDuration = System.Xml.XmlConvert.ToTimeSpan(searchResult.ContentDetails.Duration);
I hope this is helpful
using javascript
function converTime(d) {
//ignore the "PT" part
d = d.search(/PT/i) > -1? d.slice(2) : d;
let h, m, s;
//indexes of the letters h, m, s in the duration
let hIndex = d.search(/h/i),
mIndex = d.search(/m/i),
sIndex = d.search(/s/i);
//is h, m, s inside the duration
let dContainsH = hIndex > -1,
dContainsM = mIndex > -1,
dContainsS = sIndex > -1;
//setting h, m, s
h = dContainsH? d.slice(0, hIndex) + ":" : "";
m = dContainsM? d.slice(dContainsH ? hIndex + 1 : 0, mIndex) : dContainsH? "0" : "0";
s = dContainsS? d.slice(dContainsM ? mIndex + 1 : hIndex + 1, sIndex) : "0";
//adding 0 before m or s
s = (dContainsM || dContainsS) && s < 10? "0" + s: s;
m = (dContainsH || dContainsM) && m < 10? "0" + m + ":" : m + ":";
return d !== "0S" ? h + m + s : "LIVE"
}
console.log(converTime("PT6M7S"));

Resources