Hello,
in my design (based on dj reference design) I use HID to exchange commands and statuses between the board and pc.
It works fine, there is no interruption of audio stream.
Nevertheless, the levels of all input audio signals drop 8 dB when HID is enabled, even if
I don't send/receive messages. I tried to increase bInterval in HID descriptors from 8 to 100 - result is still the same.
What could be a reason for such behavior ?
Is there way around it ?
Gennady
usb audio and hid
-
- Experienced Member
- Posts: 99
- Joined: Sat Aug 31, 2013 11:23 pm
-
- XCore Expert
- Posts: 972
- Joined: Thu Dec 10, 2009 9:20 pm
- Location: Bristol, UK
The host isn't setting the volume via the HID endpoint is it?
-
- Experienced Member
- Posts: 99
- Joined: Sat Aug 31, 2013 11:23 pm
No. HID terminal is not even on.
-
- XCore Expert
- Posts: 972
- Joined: Thu Dec 10, 2009 9:20 pm
- Location: Bristol, UK
HID terminal?
Windows etc will recognise the play/pause/vol etc controls in the default design. If the device sends a HID volume control change msg to the host, the host could send a volume control to the usb audio device...
Also, have you got the ADC example code enabled?
Simple test. Mod the void Vendor_ReadHidButtons() to look like:
Windows etc will recognise the play/pause/vol etc controls in the default design. If the device sends a HID volume control change msg to the host, the host could send a volume control to the usb audio device...
Also, have you got the ADC example code enabled?
Simple test. Mod the void Vendor_ReadHidButtons() to look like:
Code: Select all
void Vendor_ReadHIDButtons(unsigned char hidData[])
{
hidData[0] = 0;
}
-
- Experienced Member
- Posts: 99
- Joined: Sat Aug 31, 2013 11:23 pm
I am using HID terminal to test message exchange.
No volume change messages are supposed to be sent over hid endpoint.
HID_CONTROLS in a reference design is undefined.
No volume change messages are supposed to be sent over hid endpoint.
HID_CONTROLS in a reference design is undefined.
-
- Experienced Member
- Posts: 99
- Joined: Sat Aug 31, 2013 11:23 pm
That is how it looks like.Ross wrote:
Simple test. Mod the void Vendor_ReadHidButtons() to look like:
Code: Select all
void Vendor_ReadHIDButtons(unsigned char hidData[]) { hidData[0] = 0; }
-
- XCore Expert
- Posts: 972
- Joined: Thu Dec 10, 2009 9:20 pm
- Location: Bristol, UK
What about ADC_VOL_CONTROL?
Apart from this I have no other ideas. HID shouldn't affect the audio.
Apart from this I have no other ideas. HID shouldn't affect the audio.
-
- Experienced Member
- Posts: 99
- Joined: Sat Aug 31, 2013 11:23 pm
Undefined
-
- XCore Expert
- Posts: 972
- Joined: Thu Dec 10, 2009 9:20 pm
- Location: Bristol, UK
how have you enabled hid then?
-
- Experienced Member
- Posts: 99
- Joined: Sat Aug 31, 2013 11:23 pm
I created my own hid descriptors.
Enabled case GET_DESCRIPTOR in endpoint0().
Created hid routine for my application (now it just sends back f/w version on any received message):
Enabled case GET_DESCRIPTOR in endpoint0().
Created hid routine for my application (now it just sends back f/w version on any received message):
Code: Select all
void Front_control(chanend chan_ep_from_host, chanend chan_ep_to_host)
{
union Data
{
int host_transfer_buf[BUFFER_SIZE];
unsigned char ubuf[BUFFER_SIZE*4];
} data;
int host_transfer_length = 0;
XUD_ep ep_from_host = XUD_Init_Ep(chan_ep_from_host);
XUD_ep ep_to_host = XUD_Init_Ep(chan_ep_to_host);
Init_peripherals();
while (1)
{
/* Receive a buffer (512-bytes) of data from the host */
host_transfer_length = XUD_GetBuffer(ep_from_host, (data.host_transfer_buf,
char[BUFFER_SIZE * 4]));
if (host_transfer_length < 0) {
XUD_ResetEndpoint(ep_from_host, ep_to_host);
continue;
}
data.ubuf[0] = fver[0];
data.ubuf[1] = fver[1];
data.ubuf[2] = fver[2];
data.ubuf[3] = fver[3];
data.ubuf[4] = fver[4];
/* Send the modified buffer back to the host */
host_transfer_length = XUD_SetBuffer(ep_to_host, (data.host_transfer_buf,
char[BUFFER_SIZE * 4]), host_transfer_length);
if(host_transfer_length < 0)
XUD_ResetEndpoint(ep_from_host, ep_to_host);
Delay_us(10000); // 10 ms
}
}