insertData Audio Data Returning garbage data.

2014-07-21
2014-07-22
  • MorphingDragon
    MorphingDragon
    2014-07-21

    I'm having an issue trying to get sound working with OpenSLES and I've noticed that the values I'm getting from insertData aren't really sane.

    I get a lot of NaN's being passed in, and if it is a logical value it's really really small.

    Some example pairs where the first member is the original data, the second is the same value converted to PCM-16. (Mostly silence)

    07-21 20:45:59.312: I/StreamingVideoPlugin(24190): [NaN,0] [NaN,0] [NaN,0] [2.67614e-40,0] [NaN,0] [5.85037e-40,0] [NaN,0] [8.01473e-40,0] [NaN,0] [9.89712e-40,0] [NaN,0] [1.18646e-39,0] [NaN,0] [1.35538e-39,0] [NaN,0] [1.45759e-39,0] [NaN,0] [1.5043e-39,0] [NaN,0] [1.55526e-39,0] [NaN,0] [1.65537e-39,0] [NaN,0] [1.82392e-39,0] [NaN,0] [2.11895e-39,0] [NaN,0] [2.57842e-39,0] [NaN,0] [3.11843e-39,0] [NaN,0] [3.59782e-39,0] [NaN,0] [3.9037e-39,0] [7.55384e-41,0] [3.96539e-39,0] [6.13365e-40,0] [3.79616e-39,0] [1.1609e-39,0] [3.48334e-39,0] [1.7188e-39,0] [3.09648e-39,0] [2.18639e-39,0] [2.65965e-39,0] [2.47044e-39,0] [2.20239e-39,0] [2.60198e-39,0] [1.8005e-39,0] [2.67864e-39,0] [1.52852e-39,0] [2.68151e-39,0] [1.35426e-39,0] [2.52851e-39,0] [1.17479e-39,0] [2.27032e-39,0] [9.52516e-40,0] [2.00514e-39,0] [7.02042e-40,0] [1.76918e-39,0] [4.34063e-40,0] [1.63431e-39,0] [1.92673e-40,0] [1.64794e-39,0] [1.61261e-41,0] [1.724e-39,0] [NaN,0] [1.78056e-39,0] [NaN,0] [1.79409e-39,0] [NaN,0] [1.68857e-39,0] [NaN,0] [1.37057e-39,0] [NaN,0] [8.61089e-40,0] [NaN,0] [3.368

    What would be causing this? I'm basing my SLES implementation off av_player but I don't think OpenAL would accept this data either.

     
  • Can you reproduce this on the PC as well? Maybe it's something in the video file you're using? Would love to have a look at the video file if it's the problem.

     
  • MorphingDragon
    MorphingDragon
    2014-07-21

    On the PC, as in the Android emulator?

    The test video I'm using is just the example blender video "bunny.ogg"

     
  • No, I meant the actual PC version built with visual studio. Hmm, if you're using the bunny demo that means something must be wrong with vorbis/tremor that you're using? this video plays fine on pc/mac and audio is routed properly. You can try debugging the audio code on android, see where all the NaN's are coming from..

     
  • I'm actually using a separate audio file and use it to sync video instead of using audio embedded in the video itself, haven't had problems with that, android included.

     
  • MorphingDragon
    MorphingDragon
    2014-07-21

    I would like to avoid having to sync a sound file in Unity to video and io inside native code.

    Guess I'm spending tomorrow going down the rabbit hole with poor man's debugging. ;p

     
  • are you trying to use libtheoraplayer in Unity? that would be awesome to support ;)

    Anyway, keep me updated by your progress, don't hessitate to post here whenever you get stuck!

     
  • MorphingDragon
    MorphingDragon
    2014-07-22

    The issue is definitely coming from one of the non TheoraPlayer libraries.

     
    Last edit: MorphingDragon 2014-07-22
  • MorphingDragon
    MorphingDragon
    2014-07-22

    Sweet Jesus, I've never been so happy to see a random blob of numbers. I changed out tremor for the standard vorbis library.

    07-22 19:38:06.012: I/StreamingVideoPlugin(20811): [0.000343881,11] [-0.0105498,-345] [-0.00401407,-131] [-0.00903507,-296] [-0.00822262,-269] [-0.00754156,-247] [-0.0122609,-401] [-0.00623912,-204] [-0.015744,-515] [-0.00495959,-162] [-0.0184073,-603] [-0.00357243,-117] [-0.0204094,-668] [-0.00224478,-73] [-0.0219915,-720] [-0.00114222,-37] [-0.0231735,-759] [-0.000241056,-7] [-0.0237902,-779] [0.000554911,18] [-0.0236619,-775] [0.00131372,43] [-0.0227942,-746] [0.00198144,64] [-0.0213345,-699] [0.00239833,78] [-0.0192809,-631] [0.0025296,82] [-0.0165224,-541] [0.00252045,82] [-0.0132119,-432] [0.00245864,80] [-0.00978011,-320] [0.00226405,74] [-0.00654079,-214] [0.00181856,59] [-0.00345134,-113] [0.00111788,36] [-0.000262128,-8] [0.000286192,9] [0.00316956,103] [-0.000602742,-19] [0.00682343,223] [-0.00161374,-52] [0.0107533,352] [-0.00273375,-89] [0.0150303,492] [-0.00382281,-125] [0.0193839,635] [-0.00488387,-160] [0.0233533,765] [-0.00599717,-196] [0.026789,877] [-0.00702489,-230] [0.0297341,974] [-0.0078318,-256] [0.0319951,1048] [-0.00859106,-281] [0.

    Poorer performance on some ARMv7 devices, but most have a hardware FPU now so I'm not too worried.

     
  • cool! Thanks for researching this, that's good information!
    Yeah, screw the older arms :)