Page 1 of 1

error: movable pointer `pbuf' does not point to its initial object when going out of scope

Posted: Tue May 01, 2018 4:47 pm
by malo
Hello,

trying to stop spdif receiver as described in here:
http://www.xcore.com/viewtopic.php?t=5164

unfortunately using

Code: Select all

asm ("outct res[%0], %1"::"r"(sc_spdif_rx_),"r"(XS1_CT_END));
or

Code: Select all

soutct (sc_spdif_rx_, XS1_CT_END);
is leading to the following error:

error: movable pointer `pbuf' does not point to its initial object when going out of scope

using lib_spdif: VERSION = 2.0.2
and just simple wrapper around spdif_rx

Code: Select all

        while (1)
        {
            printf ("Starting SPDIF RX.\n");
            spdif_rx (c_out_, p_in_, clk_, DEFAULT_FREQ_HZ_SPDIF);
            printf ("SPDIF RX stopped.\n");
        }
Any ideas would be appreciated:)

wbr
malo

Re: error: movable pointer `pbuf' does not point to its initial object when going out of scope

Posted: Tue May 01, 2018 10:07 pm
by mon2
Maybe this will help. Found the following details by searching on Google with the same error message:

http://www.xcore.com/viewtopic.php?t=5058

Re: error: movable pointer `pbuf' does not point to its initial object when going out of scope

Posted: Wed May 02, 2018 9:38 am
by malo
Hello,

thanks for the hint, there is small problem that spdif rx is xmos library written / generated in assembly:)
Maybe person who wrote the library is still reading the forum and willing to help?

wbr
malo

Re: error: movable pointer `pbuf' does not point to its initial object when going out of scope

Posted: Wed May 02, 2018 12:57 pm
by infiniteimprobability
Try adding:

Code: Select all

  pp = reconfigure_port(move(pbuf), in port);
to the end of void spdif_rx(streaming chanend c, in port p, clock clk, unsigned sample_freq_estimate) in spdif_rx.xc

That should put all of the pointers and ownership back to thier original states.

Please post if this works for you and I'll look at library update.

Re: error: movable pointer `pbuf' does not point to its initial object when going out of scope

Posted: Wed May 02, 2018 1:15 pm
by malo
Hello,

yes it works now.
how simple - when you understand it:)

thanks
malo

Re: error: movable pointer `pbuf' does not point to its initial object when going out of scope

Posted: Wed May 02, 2018 2:06 pm
by infiniteimprobability
Thanks for reporting it. There is a pull request with this fix in it now

https://github.com/xmos/lib_spdif/pull/7