5340 audio change to right channel

Hello

nRF5340-audio-DK, NCS2.0.2, VScode

press BUTTON_VOLUME_UP then button reset,can't change to channel right.

    if (CONFIG_AUDIO_DEV == HEADSET) {
        ret=channel_assignment_set(AUDIO_CHANNEL_RIGHT);
        if(ret)printk("set channel right err:%d\n",ret);
    }

change to channel right failed, return -30

  

another question,  5340-audio can DFU?

  

Best regards

  • i konw set in prj.conf

    CONFIG_AUDIO_HEADSET_CHANNEL_COMPILE_TIME=y
    CONFIG_AUDIO_HEADSET_CHANNEL=1
    it can't set by channel_assignment_set() dynamic in code?
        
    Best regards
  • Hi 

    Did you make any changes to the sample, or are you experiencing issues straight out of the box?

    Are you sure that both the left and right channels are being sent from somewhere?

    another question,  5340-audio can DFU?

    Yes, this is possible. You can read more about the DFU support here.

    Best regards
    Torbjørn 

  • Hi,

    thanks for reply,

    1.not change the sample code, only to know how to change channels dynamicy in code.

       

    2.form the link,i don' konw how to add DFU, is there have examples for it?

    i konw hello_world project add DFU like follow:

    #include <mgmt/mcumgr/smp_bt.h>
    #include "os_mgmt/os_mgmt.h"
    #include "img_mgmt/img_mgmt.h"
    void ota()
    {
        os_mgmt_register_group();
        img_mgmt_register_group();
        smp_bt_register();

        int err = bt_enable(NULL);
        if (err) {
            printk("Bluetooth init failed (err %d)\n", err);
            return;
        }
        if (IS_ENABLED(CONFIG_SETTINGS)) {
            settings_load();
        }

        err = bt_le_adv_start(BT_LE_ADV_CONN, upad, ARRAY_SIZE(upad),upsd, ARRAY_SIZE(upsd));
        if (err) {
            printk("Advertising failed to start (err %d)\n", err);
            return;
        }
    }
       
    Best regards
  • Hi 

    1) The reason you can't change the channel assignment at run time is that this is statically configured through the UICR. In order for the run time selection to work you need to clear the UICR configuration. 

    The easiest way to change this if you are flashing new kits is to change it in nrf5340_audio_dk_devices.json in nrf5340_audio\tools\buildprog

    2) I don't think we have a complete example showing how to do DFU with LE Audio, no, but I will double check this and get back to you. 

    Best regards
    Torbjørn

Related