This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC8531: Can't adjust the lch, rch volume through PC.

Part Number: CC8531
Other Parts Discussed in Thread: CC8530

Hi TI experts,

A customer designed a wireless headset using the CC8530, CC8531. 

As shown in the figure below, the Lch and Rch volumes are set differently by PC. However, the audio output of the headset has the same level.

Attached the customer's purepath configure setting. Please check how we can fix.

190415-5M-slac-2048.zip

Please refer to the block below for the hardware configuration.

Thanks,

Downey Kim.

  • Hi Downey,

    Would it be possible to share some more details on the RX side (being host controlled) and how they control the codec? As the RX side is host controlled, any codex or audio settings is mainly left to the STM part to handle.

    The assumption is that they should use VC_GET_VOLUME to read out the master volume as well as each logic channel offset and add these together for the final volume for each channel. This means they would need to do this twice, once for each channel.

    Playing around with the level balance tool (I happen to have one of the headsets on my desk) it seems like the RX side favors the "highest" of the two. 

  • Hi M-W,

    Even if each Lch/Rch is changed on a computer, reading CC8530(RX) EHIF confirms all the same values.

    What does the explanation below mean? If it operates in mono, it is the same as the customer's phenomenon.

    --> Playing around with the level balance tool (I happen to have one of the headsets on my desk) it seems like the RX side favors the "highest" of the two. 

    Please check it..

    Thanks!

    Downey Kim.

  • Hi Downey,

    I would need to know how they handle the VC_GET_VOLUME EHIF command on their host controller (if not possible to share it here, please reach out to me in a PM). The reason for this is because it is expected that they issue this command for each logical channel. For a stereo situation, you would for example have to issue the VC_GET_VOLUME command for channel 1 and 2 respectively and then apply the offsets individually when updating the codec. 

    If I could get this additional information (on how they handle this on their host) then I could do more targeted testing on my side to help you figure out the root cause in this case.

  • Hi M-W,

    I share command of customer.

    Audio channel setting. They set NWM_ACH_SET_USAGE.

    tx_buf[0] = (CC853x_CMD_REQ | EHIF_NWM_ACH_SET_USAGE);
    tx_buf[1] = 16; // Param = 16 bytes
    tx_buf[2] = 0; // Front L = 0
    tx_buf[3] = 1; // Front R = 0
    tx_buf[4] = 0xFF; // Front L = 0
    tx_buf[5] = 0xFF; // Front R = 0
    tx_buf[6] = 0xFF; // Front L = 0
    tx_buf[7] = 0xFF; // Front R = 0
    tx_buf[8] = 0xFF; // Front L = 0
    tx_buf[9] = 0xFF; // Front R = 0
    tx_buf[10] = 0xFF; // Front L = 0
    tx_buf[11] = 0xFF; // Front R = 0
    tx_buf[12] = 0xFF; // Front L = 0
    tx_buf[13] = 0xFF; // Front R = 0
    tx_buf[14] = 0; // MIC 0 =
    tx_buf[15] = 0xFF; // MIC 1 =
    tx_buf[16] = 0xFF; // MIC 2 =
    tx_buf[17] = 0xFF; // MIC 3 = 

    When reading the volume value, 2 bytes are read using the following COMMAND.

    LEFT CHANNEL

    tx_buf[0] = (CC853x_CMD_REQ | EHIF_VC_GET_VOLUME);
    tx_buf[1] = 1;
    tx_buf[2] = 0x00 | (0<< 2) | (0<< 1);

    RIGHT CHANNEL

    tx_buf[0] = (CC853x_CMD_REQ | EHIF_VC_GET_VOLUME);
    tx_buf[1] = 1;
    tx_buf[2] = 0x00 | (1<< 2) | (0<< 1);

    Please check it..

    Thanks!

    Downey Kim

  • Hi Downey,

    That seems to be their issue. They are reading out the master volume only and not the logical channel offset. The resulting volume setting / channel would be the master volume + logical channel offset for that channel. As they are only reading the master volume, the balancing is not included. 

    In other words, they need use VC_GET_VOLUME to read out both volume and offset and combine these. Do they have a way to update the product in field that could be used to help you try this out?

  • Hi M-W,

    Thank you very much!

    In other words, they need use VC_GET_VOLUME to read out both volume and offset and combine these.

    -> do you have example? they want to test it on the their board.

    Downey Kim.

  • Hi Downey,

    I do not have any DK examples to share with you I'm afraid. I will poke around to see if there is anything I could share with you (as there are no official examples of such) but until then I would recommend they try it on the product in question. 

  • Hi Downey,

    Took some time to put together a quick demo with the devkit and PurePath Wireless Commander as the EHIF script runner, this is what I put together to test it:

    //========================================================================
    // Resets the EB with alias "SLAVE", searches for at most 3 available WASP
    // networks, attempts to connect to the network with strongest RSSI and 
    // set up audio.
    //========================================================================
    
    set_timeout(1000000);
    id("SLAVE");
    sys_reset();
    wait(10);
    
    
    nwm_do_join(0,100,0x2001FC31);
    	
    status=nwm_get_status_s();
    if (status.data.length>0) {
    	nwm_ach_set_usage(0,1);
    	//vc_set_volume(0,0,1,2,1,0,0xff0f);
    	ehc_evt_clr();
    	printlog("Successfully connected to WASP network.");
    	
    	wait(1000);
    
    	// Get master volume
    	get_master_volume=vc_get_volume_s(0,0,0);
    	master_volume=(get_master_volume.data[0] << 16) | (get_master_volume.data[1]);	
    	printlog("master volume is: "+master_volume+"");
    	
    	// Get logical channel offset
    	for (i = 0; i < 1; i++){
    		get_volume=vc_get_volume_s(1,0,1);
    
    		logical_channel_0_offset=(get_volume.data[0] << 16) | (get_volume.data[1]);	
    		printlog("Logical channel 0 offset: "+logical_channel_0_offset+"");
    
    		get_volume=vc_get_volume_s(0,0,1);
    
    		logical_channel_1_offset=(get_volume.data[0] << 16) | (get_volume.data[1]);		
    		printlog("Logical channel 1 offset: "+logical_channel_1_offset+"");
    
    		wait(3000);
    	}
    } else {
    	printlog("Could not connect to WASP network.");
    }

    It connects to a device, starts the audio stream and prints out the master + local channel volumes. When running this script I get in return:

    1) master volume

    2) logical channel offset / channel

    Looking at these values, one will find that one logical offset is always 0, this is the lowest of the two (at least on Windows). This because the master volume is adjusted to that of the channel with the highest volume which means the offset is 0. The lowest of the two channel will have a non-zero offset (or most likely assuming they are not on the same balance level), this is the offset from the master volume for that channel.

    Either way, to get the resulting channel volume you have to add the master volume with the logical channel offset :)

  • Hi 

    I need to explain The parameters of nwm_ach_set_usage and vc_get_volume_s.

    please provide the library of "vc_set_volume()" function and vc_get_volume_s() function, nwm_ach_set_usage() function.

    please give me a explain to get_master_volume structure.

    thanks 

    regards,

    robin.

  • Hi Robin,

    The best explanation is found in the User's Guide or help section of PurePath Wireless Commander. In the case of nwm_ach_set_usage, it is used to assign mapping of logical channels. Invoking it also forces the slave to start/stop producing/consuming some of the channels. 

    The script above is from the PurePath Wireless Commander script view. As for C-code libraries, please see the following app note with both examples and library attached:

    https://www.ti.com.cn/cn/lit/pdf/swra369

    As for "structures", these are also given in the User's Guide or the help section mentioned above: