please help me , when someone see this forum .
I'm developing an AVB project , based on xmos app_xr_avb_lc_demo . And I want to design a headphone jack which could select channel .
in xr_avb_demo.xc file :
when I established a connection between thread demo( ) and thread i2s_master() by use of a chan (named monitor_ch), and codes as follow :
in sw_avb/app_xr_avb_lc_demo/src/xr_avb_demo.xc file :
Code: Select all
void demo (.. , chanend monitor_ch , ... ); ---- thread
{
...
monitor_ch <: ch ;
monitor_ch <: val ;
...
}
in sw_avb/module_avb_audio/src/interfaces/i2s/audio_i2s.h
inline void i2s_master( .. , chanend monitor_ch, .. ); ---- thread
{
...
while (1)
{
monitor_ch :> monitor_set ; // Expected value 1
monitor_ch :> monitor_val ; // Expected value 2
...
if (k < num_out>>1) {
unsigned int sample_out;
c_listener :> sample_out;
sample_out = bitrev(sample_out << 8);
#pragma xta endpoint "i2s_master_sample_output"
p_dout[k] <: sample_out; //this 4 GPIO output avb audio
if (k==monitor_val) // use the monitor_val to change headphone jack channel
monitor_ch_audio<: sample_out; //the headphone jack output GPIO
...
}
}
1. when I remove the 2 lines and set the monitor_val :
// monitor_ch :> monitor_set ; // Expected value 1
// monitor_ch :> monitor_val ; // Expected value 2
...
if (k==0)
monitor_ch_audio<: sample_out;
Compile and debug the project , then the 4 GPIO output avb audio successful and can listen to the 1 channel's output avb audio, but I can not get the 2 expected value and to select headphone jack channel .
2. when I don't make any changle of the code above :
Compile and debug the project, then I can get the 2 expected val (monitor_set and monitor_val) by use "printstr( ) " and "printhex( )" via XTAG-2 . However , the 4 GPIO can't output avb audio any more , and the monitor_ch_audio GPIO can't output headphone jack audio also . I think maybe the 2 lines destroyed the i2s timing or clock , is this ? what should I do ? Could you give me some Suggestions?
Thanks