HipsterSloth / PSVRTracker

A sample app demonstrating position and orientation tracking for the PSVR headset
MIT License
37 stars 12 forks source link

Hit assert(false && "Can't write to pending frame queue.") likely red light off. #18

Open m-7761 opened 5 years ago

m-7761 commented 5 years ago

FYI: I hit this assert inside PS3EyeFrameProcessor::enqueueCompressedFrame_usbThread. It's a mild annoyance, but I think it's hit because the red lights on the PS3Eye cameras were off. That said, I'm not sure if they are turned on manually.

Afterward the red lights came on on their own, and it no longer hit.

The following subroutine had to return false for this to have occurred:

bool enqueue(const t_element_type& input)
    {
        const size_t head = m_head.load(std::memory_order_relaxed);

        if (((m_tail.load(std::memory_order_acquire) - (head + 1)) & m_mask) >= 1)
        {
            m_buffer[head & m_mask] = input;
            m_head.store(head + 1, std::memory_order_release);

            return true;
        }

        return false;
    }
m-7761 commented 5 years ago

Update: For the record, I seem to keep hitting this at startup unless the program was recently run. I think the cameras are activated, but go dormant after a little while. Then this assert must be triggered when they are brought out of standby or something.

EDITED: I am finding this annoying for-what-it's-worth. It seems to work. I think it just needs to account for this common scenario.

m-7761 commented 5 years ago

This (https://github.com/HipsterSloth/PSVRTracker/commit/671cbd5dabedb2eceb64d4c02e4692b6232213b0#diff-8407f6014ca07bbf93b7f3f7ac17c6b5) fixes this but I worry it may be treating the symptom.