Search Unity

curSource->m_Channel != NULL

Discussion in 'Editor & General Support' started by AaronC, Jan 21, 2011.

  1. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    This is killing me. What does it mean?

    the variable currentSource is less than or minus the main channel that is not equal to null??

    lol WTF

    curSource->m_Channel != NULL

    I searched the forums but the answers "Theres no audiosouce assigned" doesnt really compute with this situation.

    Cheers
    AC
     
  2. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Maybe this is of use for diagnostics: $Screen shot 2011-01-21 at 5.05.42 PM.jpg

    Thanks
    AC
     
  3. sccrstud92

    sccrstud92

    Joined:
    Jan 20, 2011
    Posts:
    145
    Well, from my experience, "->" means "pointer." So I'm guessing this is some sort of null pointer exception.
    Though I haven't started importing audio into my first project, all I suggest is checking so make sure all your audio objects are assigned the sounds that they are supposed to be assigned.

    Hopefully, a more experienced member can help me out on this one.
     
  4. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Doesn't it say "is not equal to null " though?

    Thanks
    AC

    Edit: What would be more helpfull from a debugging perspective is to have it actually point to an object. What its saying at the moment is "hey sometimes you're project is buggy, sometimes it isn't! Good luck finding the bug!"

    And this project never threw such an error in Unity 2.1
     
    Last edited: Jan 21, 2011
  5. sccrstud92

    sccrstud92

    Joined:
    Jan 20, 2011
    Posts:
    145
    Yeah, that type of debugging message would be much clearer, but compilers are notorious for their lack of clarity.
    If it worked in Unity 2.x, then if must be throwing errors now because Unity somehow changed how sounds work in 3.x. But again, I haven't started using sounds yet, so I can't be more of a help.
     
  6. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Think I nailed it, In awake I was choosing a soundclip from an array, but I also had the "PlayOnAwake" option checked to on

    So it must have been playing and choosing at the same time

    *Slaps forehead

    AC
     
  7. Nition

    Nition

    Joined:
    Jul 4, 2012
    Posts:
    781
    I've been getting this in Unity 4.5 and now 4.6. Can't work out what's causing it exactly yet (except that it's related to audio somehow).

    Console just says curSource->m_Channel != NULL. No extra information is provided.

    Anyone else seeing this in 2014?
     
  8. Nition

    Nition

    Joined:
    Jul 4, 2012
    Posts:
    781
    I've now narrowed it down to a .clip assignment on an audio source followed by a .Play(), but not sure why that particular one is causing trouble and others aren't.
     
    Last edited: Dec 10, 2014
  9. Nition

    Nition

    Joined:
    Jul 4, 2012
    Posts:
    781
    I can add one extra piece of information to this: The error message only happens if I play the sound via a method using Invoke. Calling the method directly instead throws no errors.

    Unfortunately I've been unable to reproduce this bug in a simple text program.
     
  10. Nition

    Nition

    Joined:
    Jul 4, 2012
    Posts:
    781
    Anyway, so I finally "fixed" the bug by converting my InvokeRepating INTO a Coroutine (with an infinite while loop and a WaitForSeconds). Same code runs with no error.
     
  11. QuinnWinters

    QuinnWinters

    Joined:
    Dec 31, 2013
    Posts:
    494
    I was getting this same error, and this thread is just about the only legitimate thing that comes up in a google search for it. I solved the problem in a different way however, so maybe my solution will help someone in the future.

    I found that the error on my end was due to having too many audio sources playing at one time. Due to the nature of my project I have hundreds of individual audio clips that can potentially be simultaneously playing (or trying to play.) Setting priority levels on the various audio sources via AudioSource.priority took care of the issue.
     
  12. RyanFavale

    RyanFavale

    Joined:
    May 30, 2014
    Posts:
    28
    Just updated to Unity 2017.1 and getting this error. Guess I'll start debugging my audio code. {"Ugh"}.