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

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
malo
Active Member
Posts: 33
Joined: Fri Sep 16, 2016 9:03 pm
Contact:

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

Post 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


View Solution
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post 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
malo
Active Member
Posts: 33
Joined: Fri Sep 16, 2016 9:03 pm
Contact:

Post 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
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post 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.
malo
Active Member
Posts: 33
Joined: Fri Sep 16, 2016 9:03 pm
Contact:

Post by malo »

Hello,

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

thanks
malo
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post 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
Post Reply