audioscience / avdecc-lib

Simple C++ library for implementing IEEE1722.1 (AVB Device Enumeration, Discovery and Control)
MIT License
79 stars 45 forks source link

Strings_desc_count() only works for first configuration. #367

Closed kdonahoe closed 7 years ago

kdonahoe commented 7 years ago

Hello, I am writing code in c# using your library and a managed class. I've had no success accessing strings for any configuration other than the first one. When I try to call strings_desc_count() on any configuration other than the first, it returns 0... however I know that each configuration has a count of 9+ strings. All of the other "counts"(ex. stream_input_desc_count() ) work but this one... I noticed that the use of this method was commented out in your cmd_line.cpp (starting line 1663)... The method in question is below:

///
/// \return The number of Strings descriptors present in the current configuration.
///
AVDECC_CONTROLLER_LIB32_API virtual size_t STDCALL strings_desc_count() = 0;

If you could provide any insights on approaches of how to fix this, or if somehow its being used wrong, or if perhaps it hasn't been completely implemented yet---help is appreciated.

Thank you.

vronchetti commented 7 years ago

Hi @avd17,

I'm assuming you are up to date with the master branch?

I see one bug in our locale descriptor enumeration code: base strings descriptor index here is hardcoded to 0 when it should be ldr->base_strings()

Could you post the output of the view_details cmd on two different configurations?

select [end station index (from cmd_list)] [entity_index] [configuration_index]

e.g.

> select 1 0 0
> view details
> select 1 0 1
> view details

A Wireshark capture would also be helpful if you are set up to do so.

Regards, Victor

kdonahoe commented 7 years ago

@vronchetti sorry for the late response on my end. I am totally up to date with the master branch. Attached are two documents with details of both the first and second configuration (this is done WITH the edit to end_station_imp that you provided ... unfortunately still the same output). Using the second configuration (index 1), the object names listed for the for the stream inputs and outputs are null , and there are zero strings listed also (when there is actually 9)... Thanks 000.txt 001.txt

kdonahoe commented 7 years ago

If you use the "view all" command on a config other than the first config, you will see that the list of descriptors comes back empty.

vronchetti commented 7 years ago

@avd17 thank you for the updated info - we clearly have a bug somewhere in our multi-configuration enumeration code. Could you please attach a wireshark capture in a zip file?

kdonahoe commented 7 years ago

avdecc-lib_view_details.zip Riedel_view_details.zip

@vronchetti attached is the capture (avdecc-lib_view_details) taken using your lib . I'm not very familiar with wireshark yet, so I hope this is OK. Also attached is a wireshark taken using a different AVB manager, just for comparison.

vronchetti commented 7 years ago

thanks @avd17.

One more thing - could you change the logging level to LOGGING_LEVEL_DEBUG and send over the console output of your device being enumerated?

kdonahoe commented 7 years ago

enumeration_debug.txt Attached. Thanks @vronchetti

vronchetti commented 7 years ago

@avd17 bad copy-paste bug,

see here

Please try with this change:

- log_imp_ref->post_log_msg(LOGGING_LEVEL_DEBUG, "Background read of %s index %d config %d", utility::aem_desc_value_to_name(b_next->m_type), b_next->m_index, b_first->m_config);
- read_desc_init(b_next->m_type, b_next->m_index, b_first->m_config);
+ log_imp_ref->post_log_msg(LOGGING_LEVEL_DEBUG, "Background read of %s index %d config %d", utility::aem_desc_value_to_name(b_next->m_type), b_next->m_index, b_next->m_config);
+ read_desc_init(b_next->m_type, b_next->m_index, b_next->m_config);
kdonahoe commented 7 years ago

enumeration_debug.txt Re-tried with change

kdonahoe commented 7 years ago

That fixed it! Thank you for your help! -Katie

vronchetti commented 7 years ago

Thank you for bringing the bug to our attention! Regards, Victor