Huge Amazon device sale! Shop all the discounts now

06-13-2014 09:31 AM
53 123
tools
  1. CommonBlob's Avatar
    Ive set up a sample in Windows RT to test audio latency, initially I tried using MediaElement. However its clear that this is NOT any good for audio, its more for video and simple sounds.

    So Im writing a sample using DirectX XAudio2. The plus side is this is DirectX and Native code. The downside is its an extra learning curve, might get something going if I get enough time in the next couple of hours though.
    ejb222 and vp710 like this.
    06-25-2012 06:25 AM
  2. CommonBlob's Avatar
    Well, I cannot say this is a super accurate, but I have tested XAudio2 in Windows RT.

    Now the caveats to testing:

    * This is in debug mode, so in theory release mode should be a touch faster
    * This is testing on an Intel I7 Laptop
    * This does not include any special effects to the sample, it is just a sample getting played
    * I am using SharpDX to interpret DirectX native C++ to c# (I such at C++)
    * This is not using a touchscreen, there will always be a touchscreen latency and I cannot answer that question here as each one will probably be different
    * I am only able to test timing when the code believes the sound is off to be played, there could be additional latency compared to what I get to my ears. I can tell you that I cannot hear anything between when I lift the mouse button and the note being played.

    So simply, all I am doing is setting up my objects on load. Then I have a button that sets up a buffer and loads a soundstream into that buffer. So this is a pre-buffered audio sample.

    Then another button submits the buffer and plays the sound.

    The results:

    Audio sample at 44100

    Preparing the buffer: 60ms - 70ms
    Submit and play: 5ms - 7ms

    Audio sample at 22050

    Preparing the buffer: 50ms - 60ms
    Submit and play: 2ms - 4ms

    To my ears, it seems pretty good, but I am not doing anything on the fly and this is also not touch screen.
    vp710 likes this.
    06-25-2012 07:35 AM
  3. ejb222's Avatar
    Thanks Blob! I appreciate your work. Is that good results? What about recording? Even the ability to plug in a digital condesor mic to my phone to record would be a helpful.
    06-25-2012 10:28 AM
  4. vp710's Avatar
    Thanks for the experiment Blob!

    So the best you could get right now, for a full quality sample is 65ms, not counting input (touch) lag? I'd have to test it, but my experience with DAW's would lead me to believe it's pretty bad unfortunately. Still better than Android (and their 300+ms) but far behind iOS (below 10ms).

    But if I understand correctly, the way latency is measured could mean it gives longer results than how it translates in real life, right?

    Fingers crossed for WinRT.
    06-25-2012 01:06 PM
  5. cckgz4's Avatar
    I think part of Apple's products appeal to the masses is that they are used by creative people, be it in design, music, video, etc. I hope MS gets this right...
    this is true
    06-25-2012 01:38 PM
  6. CommonBlob's Avatar
    Thanks for the experiment Blob!

    So the best you could get right now, for a full quality sample is 65ms, not counting input (touch) lag? I'd have to test it, but my experience with DAW's would lead me to believe it's pretty bad unfortunately. Still better than Android (and their 300+ms) but far behind iOS (below 10ms).

    But if I understand correctly, the way latency is measured could mean it gives longer results than how it translates in real life, right?

    Fingers crossed for WinRT.
    Kind of vp710 :)

    Its not as bad as that. Normally you would precache the wav sample into memory (its not large), so you can ignore most of that first 60-70ms as the lag is mainly caused by disk read.

    Really what you have is:

    Touch Lag + Buffer Lag + Audio Playback Lag = Button to your ears.

    Now if you want it to be a decent audio engine, you will have to also add Effect Lag, now that's dependant on your code.

    I think I could get something good at around 15ms or even better, all depends on how far the effects go. But that's only using my measurements, touchlag and to my ear lag is not included as I can't really measure that. It could be very minimal, but as we know touchscreen drivers will differ depending on manufacturer.

    As good as IOS? Im not sure until I try.

    If I can ramp up my current Windows Phone implementation and get it out there, I will have time to work on a Windows RT version of what will be called Metro Music Studio. Although im quite excited for Windows 8 and can't wait to design on large screens.
    I was surprised how easy it was getting SharpDX and XAudio working, a testament to SharpDX and c# I guess!
    Last edited by CommonBlob; 06-25-2012 at 03:33 PM.
    06-25-2012 03:22 PM
  7. CommonBlob's Avatar
    Thanks Blob! I appreciate your work. Is that good results? What about recording? Even the ability to plug in a digital condesor mic to my phone to record would be a helpful.
    Its not bad results, its hard to get real meaning without being able to track latency in the "real world", but its better than I had expected.

    Ive not tested recording yet, I will try and test this as well, although gauging how well this works will be trickier. I suspect I would need to play a song and tap a beat to it, then try and "feel" the latency. Thankfully I played Violin for 12 years, guitar for 5 and drums for 2, so I think im reasonably musical!
    06-25-2012 03:32 PM
  8. vp710's Avatar
    Kind of vp710 :)

    Its not as bad as that. Normally you would precache the wav sample into memory (its not large), so you can ignore most of that first 60-70ms as the lag is mainly caused by disk read.

    Really what you have is:

    Touch Lag + Buffer Lag + Audio Playback Lag = Button to your ears.

    Now if you want it to be a decent audio engine, you will have to also add Effect Lag, now that's dependant on your code.

    I think I could get something good at around 15ms or even better, all depends on how far the effects go. But that's only using my measurements, touchlag and to my ear lag is not included as I can't really measure that. It could be very minimal, but as we know touchscreen drivers will differ depending on manufacturer.

    As good as IOS? Im not sure until I try.

    If I can ramp up my current Windows Phone implementation and get it out there, I will have time to work on a Windows RT version of what will be called Metro Music Studio. Although im quite excited for Windows 8 and can't wait to design on large screens.
    I was surprised how easy it was getting SharpDX and XAudio working, a testament to SharpDX and c# I guess!
    Wow, that's great news!!! 15ms would be usable, definitely. Blob, I'm so excited about this experiment. Can't wait to see how it translates on, say, a Surface! ;)

    CommonBlob likes this.
    06-25-2012 05:15 PM
  9. vp710's Avatar
    AAHH! Damn Board Express not posting my stuff. :mad:

    Re recording: if you can multi-track, the easiest way to check for latency is to play an audio click track on track #1 and record it on track #2. Then it's really easy to compare, even with you eyes if you're in a DAW.

    But I don't think recording is as critical as input latency as you can always use latency compensation to nudge the recorded tracks in place automatically but playing live instruments with lag is next to impossible.

    Thanks again Blob for giving us eager folks answers. ;)
    06-25-2012 06:45 PM
  10. ejb222's Avatar
    If there was a way to guestimate, you think anymore developers are working on this? Anyway to get more people on this? You think someone on this site could do a write up to get more attention? I think this is a rather crucial area that's been largely overlooked and thought that this could be a great niche...but as of right now Apple has no competition and I know a lot of musicians that are Apple exclusive because of this. I mean we can't be the only people that are concerned or have looked into this right????
    06-25-2012 07:50 PM
  11. vp710's Avatar
    There really is not much that's been done on the subject. I started a thread on xda and only one person has responded so far. Then there's the article i linked to in previous posts and a few things here and there but that's about it. I don't know if it's because people don't know or don't care, or if devs are waiting for the final release of win8. I'm sure it will be hard to get quality metro music apps because most companies and devs cater to the big apple userbase. I'd love to see an in-depth article on wpc though.

    Sent from my Lumia 710 using Board Express
    06-25-2012 08:07 PM
  12. jdevenberg's Avatar
    My 2 cents.
    Creative types prefer Apple products 90% of the time. Even if Windows Phone were the superior platform for recording on the go, that isn't going to sway them as it doesn't have the "cool" factor that an Apple product has. WP8 is targeted squarely at two groups of people: Corporate and average consumers. Gamers are also target, but to a lesser degree. With its grid of square tiles, with their single solid color on a solid background, and focus on delivering information, WP very much appeals to left brain types who want organization and efficiency. In short, it puts function before form. I love how Windows Phone looks, but I am most certainly left brained, loving Science, math, and diving deep into technology (I can't remember the last time I had a computer running only a single OS). Microsoft shows off production applications, highlighting Office and its SharePoint capabilities. iOS (and Android, though to a lesser degree), put form before function. Developers can create very beautiful, artistic icons, but they don't tell you anything. It is full of textures that serve to beautify, but distract from getting at the info you want. You can choose a beautiful background to always see on your home screen, but it can make reading your icons more difficult. All of these things appeal to right brained, creative type peoples (artists, musicians, etc.) Apple likes to show off advanced apps like iMovie and Garage band. For this reason, I don't think you will ever have music apps on Windows Phone that are up to par with the iOS options.
    06-26-2012 01:25 AM
  13. CommonBlob's Avatar
    If there was a way to guestimate, you think anymore developers are working on this? Anyway to get more people on this? You think someone on this site could do a write up to get more attention? I think this is a rather crucial area that's been largely overlooked and thought that this could be a great niche...but as of right now Apple has no competition and I know a lot of musicians that are Apple exclusive because of this. I mean we can't be the only people that are concerned or have looked into this right????
    There definitely will be developers looking at this. I don't think you will be seeing a full DAW in the near future on Metro, but we will eventually. All the other DAWs will keep going on desktop mode, and maybe make them a little more touch friendly.

    The thing windows has going for it is the USB port and the full windows experience. There are already hundreds of devices that will work. However, I know today MIDI devices are not supported at all in metro, BUT, most modern midi devices also have USB so that is supported.

    There is a road ahead with some uncertainties no doubt
    vp710 likes this.
    06-26-2012 03:45 AM
  14. CommonBlob's Avatar
    Wow, that's great news!!! 15ms would be usable, definitely. Blob, I'm so excited about this experiment. Can't wait to see how it translates on, say, a Surface! ;)

    Click to view quoted image
    LOL :)

    Its a little frustrating that so much of my code can't be directly moved to WinRT. Thankfully chunks can be.

    I hope to get the phone version of the music studio out at the latest, August, so assuming im not sick of music apps by then, I can work on the WinRT version all the time (which is still part time as I have a job!)
    vp710 and ejb222 like this.
    06-26-2012 03:48 AM
  15. ejb222's Avatar
    Please dont get sick of Music apps...we have way too many Photo apps(probably more than iPhone fart apps) to give up now.
    vp710 likes this.
    06-26-2012 07:52 AM
  16. CommonBlob's Avatar
    Please dont get sick of Music apps...we have way too many Photo apps(probably more than iPhone fart apps) to give up now.
    I have about 3 games that are partially complete that I would like to finish at some point. But I don't think I will give up. I also hope to start a WinRT version sooner than August as the bigger screen excites me. I also don't want to let down all the people who have bought the current version of Pianist.
    vp710 likes this.
    06-26-2012 08:26 AM
  17. vp710's Avatar
    My 2 cents.
    Creative types prefer Apple products 90% of the time. Even if Windows Phone were the superior platform for recording on the go, that isn't going to sway them as it doesn't have the "cool" factor that an Apple product has. WP8 is targeted squarely at two groups of people: Corporate and average consumers. Gamers are also target, but to a lesser degree. With its grid of square tiles, with their single solid color on a solid background, and focus on delivering information, WP very much appeals to left brain types who want organization and efficiency. In short, it puts function before form. I love how Windows Phone looks, but I am most certainly left brained, loving Science, math, and diving deep into technology (I can't remember the last time I had a computer running only a single OS). Microsoft shows off production applications, highlighting Office and its SharePoint capabilities. iOS (and Android, though to a lesser degree), put form before function. Developers can create very beautiful, artistic icons, but they don't tell you anything. It is full of textures that serve to beautify, but distract from getting at the info you want. You can choose a beautiful background to always see on your home screen, but it can make reading your icons more difficult. All of these things appeal to right brained, creative type peoples (artists, musicians, etc.) Apple likes to show off advanced apps like iMovie and Garage band. For this reason, I don't think you will ever have music apps on Windows Phone that are up to par with the iOS options.
    I don't know about this left brain / right brain thing man. A lot of creative types also like a minimalist environment. Apple products certainly have minimalist lines. The metro UI could be considered an extension of the Helvetica font, the most popular font in design, applied to a broader spectrum.

    All it would take to attract creative types to Win8 are solid apps and great products (like the surface) and people using them to create. Win8Pro is, after all, equivalent to a MacBook Air and an iPad in one product. If only Microsoft would come up with decent apps like Garage Band and iMovie built-in into Win8...

    I don't think the platform is doomed, and I'm hoping we'll see a lot more ports of great music apps, especially since Windows 8 will slowly replace Win 7 and millions of computers in the world. I think this is Microsoft's goal as well: by spreading a tablet OS, or mix of tablet / desktop on most computers in the world, developing for Win8 becomes a cash cow.
    ejb222 likes this.
    06-26-2012 12:40 PM
  18. ejb222's Avatar
    ^ wish I could like this about 100 times
    06-26-2012 04:00 PM
  19. jdevenberg's Avatar
    I don't think that the platform is doomed, in fact I think it had a bright future. I just don't think it will ever be the platform of choice for creative type people.
    06-26-2012 08:06 PM
  20. vp710's Avatar
    Well, you could be right, but I'm creative and I can't stand Apple products. :D
    06-26-2012 08:17 PM
  21. jdevenberg's Avatar
    Well, you could be right, but I'm creative and I can't stand Apple products. :D
    That's why I didn't say all. Blanket statements are almost always incorrect. ;-)
    vp710 likes this.
    06-26-2012 10:00 PM
  22. ejb222's Avatar
    Anyway to get Dan to bring this up to Microsoft? Or at least to get someone with connections talking about this? MS may have solutions...or maybe they forgot about this aspect and there is still time to create solutions :)
    06-27-2012 07:23 AM
  23. KingCrimson's Avatar
    There is a reason the iPhone is the smartphone of choice for musicians. Core Audio is the best audio subsystem in the business. Does WP8 have anything to compete with Core Audio?
    06-27-2012 11:48 AM
  24. vp710's Avatar
    New article about W8 and music production: The Cakewalk Blog Blog Archive Windows 8 – A benchmark for music production applications

    Apparently W8 would perform better under the desktop mode. Jury's still out on whether or nor devs will be able to make Metro apps low latency...
    06-27-2012 11:55 AM
  25. CommonBlob's Avatar
    New article about W8 and music production: The Cakewalk Blog Blog Archive Windows 8 – A benchmark for music production applications

    Apparently W8 would perform better under the desktop mode. Jury's still out on whether or nor devs will be able to make Metro apps low latency...
    Its safe to say that Windows 8 is generally faster than Windows 7, but in desktop mode we can use ASIO with our nice soundcards and get that nice latency. I have an old 45 EMU 0404 PCI card that works a treat with my guitar at 3ms latency. Also works just as great on Windows 8.

    However, Windows RT tablets don't quite get everything in desktop mode, the drivers will differ so who knows what will happen there.

    Good article though vp710, lays these facts out nice and clear, and shows us that Windows 8 IS better
    vp710 likes this.
    06-27-2012 03:13 PM
53 123
LINK TO POST COPIED TO CLIPBOARD