How to control the AVB media steam volume size

Technical questions regarding the XTC tools and programming with XMOS.
oyhp052
Member++
Posts: 16
Joined: Fri Jun 01, 2012 7:01 am

Post by oyhp052 »

OK, thank you , norman.


oyhp052
Member++
Posts: 16
Joined: Fri Jun 01, 2012 7:01 am

Post by oyhp052 »

norman wrote:if you work on the low cost avb audio endpoint, we maybe going to help each other. I've done some modifications to test the volume with the remote button (unused for now) :

in xr_avb_demo.xc

void ptp_server_and_gpio
uncomment

Code: Select all

c <: REMOTE_SEL; 
void demo(...)
add in the beginning

Code: Select all

int volumes[4];

	for(int i=0;i<4;i++)
	{
		volumes[i]=0x40000000;
	}
add after

Code: Select all

case c_gpio_ctl :> int cmd:
			{
				switch (cmd)
				{

Code: Select all

case REMOTE_SEL:
					{
						int vol = 0;

						if (volumes[0]==0x40000000)
						{
							vol = 0x7FFFFFFF;
						}
						else if (volumes[0]==0x7FFFFFFF)
						{
							vol = 0;
						}
						else
						{
							vol = 0x40000000;
						}

						for(int i=0;i<4;i++)
						{
							volumes[i] = vol;
						}

						set_avb_source_volumes(0, volumes, 4);
					}
					break;
in media_output_fifo.c
after

Code: Select all

#define MAX_VOLUME
add

Code: Select all

#define MEDIA_OUTPUT_FIFO_VOLUME_CONTROL

Hi, norman . I have ​​some new discoveries of your way recently .
Also need to modify the following code section :

in avb.h
add code
#define MEDIA_OUTPUT_FIFO_VOLUME_CONTROL

in avb_1722_listener.h
add code
#define MEDIA_OUTPUT_FIFO_VOLUME_CONTROL

then Run the demo project is successful .
However , when I debug the project , encounter a problem .
The program runs to c_io.h suspended , see the picture (in my own project ,but it is the same as in DEMO).
How to use the "void set_avb_source_volumes(int sink_num, int volumes[], int count);" successfully and how to understand the c_io.h assembly code , please ?
You do not have the required permissions to view the files attached to this post.
norman
Active Member
Posts: 55
Joined: Wed Jan 11, 2012 2:27 pm

Post by norman »

I met this error before ! but i don't remember for now what i've done. not helping ok....

You may have to look at which xc_abi_outint it stop by putting breakpoint in the caller "set_avb_source_volumes". then see which parameter is wrong between

Code: Select all

xc_abi_outuint(c, AVB1722_ADJUST_LISTENER_STREAM);
xc_abi_outuint(c, sink->stream.local_id);
xc_abi_outuint(c, AVB1722_ADJUST_LISTENER_VOLUME);
xc_abi_outuint(c, count);
for (int i=0;i<count;i++) {
xc_abi_outuint(c, volumes[i]);
}