Thursday, 2016-06-30

*** YuriW has quit IRC00:00
*** Yruama_Lairba has quit IRC01:03
*** ArturShaik has joined #kxstudio01:33
*** designbybeck has joined #kxstudio01:59
*** designbybeck has quit IRC02:15
*** HeyCitizen has joined #kxstudio02:47
*** ArturShaik has quit IRC03:23
*** ArturShaik has joined #kxstudio03:40
*** falktx` has joined #kxstudio03:57
*** falktx has quit IRC04:00
*** therealthelonius has quit IRC04:37
*** therealthelonius has joined #kxstudio04:37
*** wolftune has quit IRC04:47
*** rghvdberg has joined #kxstudio06:52
*** jim has quit IRC07:11
*** jim has joined #kxstudio07:13
*** sakrecoer has quit IRC08:26
*** DoverMo has joined #kxstudio08:32
*** DoverMo has quit IRC08:37
*** dromer has joined #kxstudio09:08
*** dreamer has quit IRC09:08
*** dromer is now known as dreamer09:08
*** dreamer has joined #kxstudio09:08
*** olinuxx has joined #kxstudio09:21
*** olinuxx has joined #kxstudio09:21
rgareusFergusL: aah there you are :) you left rather quicky yesterday09:50
rgareusFergusL: re  "documentation on [..] like relationship of sampling rate with block size, latency, perceived latency, feeding data to a DAC etc"09:50
rgareusFergusL: the first is easy  latency [s] =  block-size [samples] / sample-rate [samples / seconds]09:50
rgareusFergusL: perceived latency, unless you mean psychoacoustics:   http://manual.ardour.org/synchronization/latency-and-latency-compensation/ (elaborates on round-trip and latency sources)09:51
rgareusFergusL:  feeding data to a DAC.. that's vague. On an electrical level?  that'll take full semester to explain :) just using a DAC that's already on some PC bus ?09:52
FergusLrgareus: thanks for the rather detailed answer!10:25
FergusLin the meantime I made myself a cute LibreOffice Calc sheet which calculates latency and other things10:25
FergusLthat ardour link was interesting too, I liked the note about church organist and latency compensation haha10:31
rgareusFergusL: that's only half joking :)10:34
FergusLI could get that, I believe! being pretty far from the location of the sound production and also the time needed for the mechanical parts to activate and produce sound10:35
rgareusthe mechanics for those organs do have a *mechanical* latency of often > 100ms  and then until the air starts resonating some HUGE pipes can be up to half a second10:35
rgareusand then the crowd in the church starts..  anoter second later with about 2 seconds jitter :)10:36
FergusLI was at St Merry church few weeks ago and singer performed along with the organ, I couldn't tell where the organist was but it made a nice surround effect10:37
rgareusthe point is that in a many of cases  users screaming "I need extreme low latency" is bullshit.10:41
rgareusgranted it's more complicated - esp with headphone monitoring. but well.10:41
rgareusFergusL: is there a particula thing that you're working on, or just out of general interest?10:42
FergusLwhat's extreme low? <1ms ? for all embedded setups I'm planning on working on i'm aiming at <= 6ms10:43
rgareusFergusL: as rule of thumb <= 10ms  round-trip is fine.10:43
FergusLhm last time in #moddevices I asked a few questions about kernel hacking and linux setup on Mod, cause I'm going to start working on lower power, lower performance things10:44
rgareusthat's ~ 3 meters in air.10:44
FergusL(more like the Bela Platform if you happen to know about it)10:44
rgareusyeah, heard about it, didn't get my hands on it, yet10:45
rgareusFergusL: in that case limiting factor will be bus  and upwards  (driver, kernel-scheduler, user-space software)10:46
FergusLand very precisely all those questions I have arise from wondering how to handle playing the sound through the DAC *and* processing the next block at the same time in a single core context10:46
FergusLI know about DMA, at the much lower level, that helps with these asynchronous tasks and I also know it's used in embedded platforms10:47
rgareusFergusL:       write n samples ;  read n-samples ;     process those samples  [ wait until you can write and read N samples]   repeat;10:50
rgareusit's not async10:50
rgareusthe "wait until"  is usually sleep  wake up on IRQ10:51
FergusLand also well below human ear perception of a dropout ?10:51
rghvdberghttps://soundcloud.com/rghvdberg/rghvdberg-today-is-not-that-day-osc-8810:51
LAbot`Title: rghvdberg - Today Is Not That Day [OSC 88] by Rob van den Berg | Free Listening on SoundCloud (at soundcloud.com)10:51
rghvdbergdone with it ... next song is gonna be a happy one .. this is bringing me down10:52
rghvdberg;-)10:52
rgareusFergusL: dropout:    there are 2 aspects to it:    audible artifacts since the signal goes to 0 when you don't feed more data.10:53
rgareusFergusL: if you were not playing silence it'll be a click   high-frequency.    non-zero to zero in one sample10:53
rgareusFergusL: often more important is timing however.    all processing is late   and it gradually drifts.10:54
FergusLyes! actually that was one of the tests I've made yesterday haha, trying cutting single samples, in Pd and then in audacity10:54
rgareusFergusL: the latter part is not important if you only play back.   but any    in -> process -> out   will be problematic   reverbs are an example.10:55
rgareusor recordings won't align anymore10:56
*** Yruama_Lairba has joined #kxstudio10:56
rgareuse.g  record 1 sec of guitar @ 48K  -> 48000 samples;      rewind   record 1 sec of drums  @ 48K    [dropout] -> less than 48000 samples, short by the dropout-duration.10:57
rgareusthings don't align anymore10:57
rgareusFergusL: DMA is always IRQ triggered.10:58
rgareusFergusL: there's a callback when the trasaction is complete10:58
rgareusthe kernel alsa driver abstracts that nicely, however10:59
rgareusFergusL: I'm not sure how low-level you want to go:   for debugging the mod-driver I've written  https://github.com/moddevices/mod-alsa-test11:00
rgareusmainly useful exercise DMA transfers and conveniently set various parameters11:01
FergusLrgareus: ok really cool! I'll look at that11:02
rgareusFergusL: one thing that you notice   https://github.com/moddevices/mod-alsa-test/blob/master/mod-alsa-test.c#L327    << "start processing"11:03
rgareusFergusL:  first write  N samples11:03
rgareusFergusL: jack does the same.     you pre-seed the output  before reading11:03
rgareus it's  not    [  read -> process -> write   ]            but   [ write -> read -> process  ]11:04
rgareusFergusL: that may explain the  single-core synchronous part11:04
rgareusFergusL: then again, you could just use jack and forget about all of that :)11:06
rgareusmod-alsa-test isn't complete. it does not actually do something with the samples and also properly supports MOD's  SND_PCM_FORMAT_S24_BE11:07
rgareusuhm _LE11:08
rgareusbut for debugging driver wakeup and DMA timing I didn't care for actual audio.11:09
FergusLhttp://www.adeneo-embedded.com/content/download/1801/23674/file/Real-time%20Audio%20on%20Embedded%20Linux.pdf I found that as well, quite old and very different hardware but it suggests non-rt non-jack can provide decent latencies11:09
FergusLthe platform is 600MHz single core!11:09
rgareuswell, you can do that stuff on a 1MHz Arduino, too11:10
rgareusthe limiting factor is  processing11:10
rgareusFergusL: that's a good overview11:13
rgareuseven has a reference to cyclictest11:13
rgareusFergusL: rt-kernel is only needed if there are lots of other things going on that can prevent the audio DMA irq to be handled in time.11:17
rgareusUSB is also a good candidate.  normally all usb devices are equal.11:18
rgareusbut you do want a usb-soundcard to have priority over a usb-mouse..11:19
FergusLI see, yes, makes sense, that's why I want to keep the software stack at a minimum, hence also why OpenWRT seemed interesting, it doesn't have any of the typical desktop services running etc...11:19
rgareusindeed, though that part is user-space.  and even vanilla kernel have  scheduling policies for those.11:21
rgareusstill, switching tasks takes time.11:21
FergusLrecently acquired hardware to test regarding all of those ideas: http://bz.seeedstudio.com/depot/LinkIt-Smart-7688-p-2573.html?cPath=122_142 + its 24 bit audio in/out breakout11:22
rgareusFergusL: cyclictest is really a good middle-ground to start.       cyclictest -m -S -d0 -p80    #  keep it running for a while11:24
rgareusFergusL: the last number in line is the worst-case  (usec)11:24
rgareusFergusL: that's the time it takes for the scheduler to switch between two tasks11:24
rgareusand if the kernel-scheduler already has   - 1000usec  == 1ms  as worst case,  you can't have latency lower than that.11:25
rgareusif that number gets large -> use a rt-kernel.     if it stays reliably low, kernel is good in general.  (not taking the actual audio-driver into account)11:27
rgareusnext step is to keep cyclictest running and start audio playback to check the driver.     that's where the mod fell over11:28
FergusLrgareus: actually where did you spot cyclictest? in the pdf I linked to?11:28
rgareusFergusL: on most distros it comes with the  rt-tests package11:28
rgareushttps://rt.wiki.kernel.org/index.php/Cyclictest11:28
LAbot`Title: Cyclictest - RTwiki (at rt.wiki.kernel.org)11:28
rgareus^^ has link to source etc11:29
FergusLvery afraid openwrt won't have it :| I'll check... actually I have those boards just next to be but I'm still supposed to write my Masters 2 thesis so I have only just looked at it! haven't taken the take to start it11:30
FergusLthanks11:30
rgareusFergusL: the "Real-Time Audio..." slides mentioned it11:31
FergusLsaw it now11:31
rgareusbut regardless it's a very useful tool11:32
FergusLok thanks! at least that tells me the first thing I'll have to do to get an idea of the expectations I should have11:34
FergusLalso, can you confirm by rt kernel you mean a kernel patched for specific hardware? I remember it was very specific to Allwinner A20 when I tried the rt patchset, also rt on OpenWRT is of interest in the networking industry but not much investigated11:35
rgareusonly sunxi is special.11:39
rgareusthe rt-patch is for vanilla linux which runs just fine on ARM.11:39
rgareusthere's no specific hardware patch  -  except that weird sunxi abomination (they have lot of custom hardware with crappy drivers that won't be accepted upstream, so they forked it)11:40
FergusLisn't Allwinner doing all that crap in the first place? gpl issues etc11:42
FergusLalright, back to all that later, really got to focus on writing :)11:46
*** olinuxx has quit IRC11:47
*** bill-auger has quit IRC11:57
*** bill-auger has joined #kxstudio11:57
*** olinuxx has joined #kxstudio12:00
*** stuartcnz has quit IRC12:05
rgareusrghvdberg: today's indeed not that day!12:19
rgareusrghvdberg: your profile pic on SC pictures you in front or a mic.  Do any of your tracks have vocals?12:20
*** stuartcnz has joined #kxstudio12:21
*** falktx|work has joined #kxstudio13:16
rghvdbergnope, don't even have a microphone13:20
rghvdbergI sing backing vocals with my live bands13:21
rghvdbergI only make songs for the one synth challenge ... I'm weird13:22
FergusLrgareus: hm have you used the CROSS_COMPILE make flag in rt-tests? seems it's ignored14:40
FergusLoh, wait, other issue I hadn't noticed14:42
*** YuriW has joined #kxstudio15:05
*** wolftune has joined #kxstudio15:21
*** falktx|work has quit IRC15:28
*** ArturShaik has quit IRC15:36
*** wolftune has quit IRC15:45
*** GrusGrus has joined #kxstudio15:46
*** wolftune has joined #kxstudio15:54
*** GrusGrus has quit IRC15:59
FergusLrgareus: seems I get indeed some errors to cross compile to the platform I'm using16:16
FergusLhttp://paste.leloop.org/?a8b896d405438951#1KQLtOsXg0ujqAxlef3OgBeRFpCm8NTLEkptWfKwDWg= it's an error with a function already declared, this block is inside an #ifdef __UCLIBC__... I found a hack on a chinese forum that just "#ifdef 0" haha.. haven't tested16:19
FergusLjuste pasting that here in case you want to have a look, and thanks for all your previous help!16:20
*** BitPuffin has joined #kxstudio16:38
*** rghvdberg has quit IRC16:44
*** sirriffsalot has joined #kxstudio16:45
*** falktx|work has joined #kxstudio18:06
*** olinuxx has quit IRC18:57
*** jablo has joined #kxstudio19:12
*** BitPuffin has quit IRC19:26
*** falktx|work has quit IRC19:58
*** rncbc has joined #kxstudio19:59
*** bill-auger_ has joined #kxstudio21:22
*** bill-auger has quit IRC21:22
*** wolftune has quit IRC21:31
*** prettyvanilla_ has joined #kxstudio21:37
*** wolftune has joined #kxstudio21:38
*** prettyvanilla has quit IRC21:45
*** daeavelwyn has quit IRC21:45
*** jablo has quit IRC21:46
*** olinuxx has joined #kxstudio21:59
*** olinuxx has joined #kxstudio21:59
*** YuriW has quit IRC22:23
*** wolftune has quit IRC23:20
*** wolftune has joined #kxstudio23:23

Generated by irclog2html.py 2.13.0 by Marius Gedminas - find it at mg.pov.lt!