{"id":4883,"date":"2019-06-18T00:35:19","date_gmt":"2019-06-17T22:35:19","guid":{"rendered":"https:\/\/demdlx704as001.ad.harman.com\/?p=4883"},"modified":"2024-05-13T09:05:49","modified_gmt":"2024-05-13T07:05:49","slug":"hardware-abstraction","status":"publish","type":"post","link":"https:\/\/audioworx.transfunnel.co\/old\/?p=4883","title":{"rendered":"Hardware Abstraction"},"content":{"rendered":"<p>Hardware abstraction is being done at Audio Object functions level such as calc, init etc.<\/p>\n<p class=\"heading\"><strong>Audio Object Function Level Abstraction<\/strong><\/p>\n<p>When the audio object function implementations are significantly different across various platforms, platform specific functions should be in different cpp files (file per core). A new cpp file needs to be introduced for every object that has any core-specific code. The object will still have one header file across all platforms. Dll specific functions should be part of Win32 specific files.<\/p>\n<p class=\"heading\"><strong>Folder Structure<\/strong><\/p>\n<p>The folder structure will look like the following:<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-21382\" src=\"https:\/\/audioworx.transfunnel.co\/old\/wp-content\/uploads\/2019\/06\/HA_Fig2-1.jpg\" alt=\"\" width=\"391\" height=\"296\" \/> <img decoding=\"async\" class=\"alignnone wp-image-21383\" src=\"https:\/\/audioworx.transfunnel.co\/old\/wp-content\/uploads\/2019\/06\/HA_Fig1-1.jpg\" alt=\"\" width=\"389\" height=\"289\" \/><\/p>\n<p class=\"heading\"><strong>Override Defines<\/strong><\/p>\n<p>Each object will also have an \u201cOBJECT\u201d_OVERRIDE define. This define may be in the object header. However, for the xAF basic audio objects and the core objects, they have been combined into <em>build\\processor\\&#8221;PLATFORM&#8221;\\objectOverride&#8221;PLATFORM<\/em>&#8220;.<em>cmake<\/em>\u00a0file that shall be included in the build process.<\/p>\n<p>For non-Sharc platforms, the API function specific defines are available in AudioFramework.h and the Biquad specific defines are available in <em>private\\src\\framework\\filter\\CMakeLists.txt<\/em>:<\/p>\n<p class=\"text\"><img decoding=\"async\" class=\"alignnone wp-image-21390\" src=\"https:\/\/audioworx.transfunnel.co\/old\/wp-content\/uploads\/2019\/06\/HA_Fig1-3.jpg\" alt=\"\" width=\"604\" height=\"197\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-21391\" src=\"https:\/\/audioworx.transfunnel.co\/old\/wp-content\/uploads\/2019\/06\/HA_Fig2-3.jpg\" alt=\"\" width=\"742\" height=\"272\" \/><\/p>\n<p>For example, build\\processor\\armv8a\\objectOverrideArmv8a.cmake will look like the following:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21393\" src=\"https:\/\/audioworx.transfunnel.co\/old\/wp-content\/uploads\/2019\/06\/HA_Fig1-4.jpg\" alt=\"\" width=\"1031\" height=\"255\" \/><\/p>\n<p>For SHARC based platforms, it is not possible to define the override macro as a logical expression of individual API macros as done above. Here the logical operation is done separately with the<em> math<\/em> directive and subsequently assigned to the overriding macro. Both the API function specific defines and the Biquad specific defines are available in this file build\\processor\\sharc\\objectOverrideSharc.cmake:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-21394\" src=\"https:\/\/audioworx.transfunnel.co\/old\/wp-content\/uploads\/2019\/06\/HA_Fig2-4.jpg\" alt=\"\" width=\"646\" height=\"520\" \/><\/p>\n<p>The FIR object has Sharc specific implementation for init() and calc(). The FIR_OVERRRIDE define will be the union of XAF_INIT and XAF_CALC defines as given below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21388\" src=\"https:\/\/audioworx.transfunnel.co\/old\/wp-content\/uploads\/2019\/06\/HA_Fig2-2.jpg\" alt=\"\" width=\"605\" height=\"87\" \/><\/p>\n<p class=\"heading\"><strong>Files<\/strong><\/p>\n<p>In the generic implementation of the object, every function that is overridden in optimization files should be surrounded by an ifdef check. Using the example above, the generic file <em>FIR.cpp<\/em> would look like this:<\/p>\n<p class=\"text\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21396\" src=\"https:\/\/audioworx.transfunnel.co\/old\/wp-content\/uploads\/2019\/06\/HA_Fig1-5.jpg\" alt=\"\" width=\"1020\" height=\"346\" \/><\/p>\n<p>The Sharc file &#8211; <em>FIRSharc.cpp<\/em> &#8211; in this case should override both init() and calc():<\/p>\n<p class=\"text\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21397\" src=\"https:\/\/audioworx.transfunnel.co\/old\/wp-content\/uploads\/2019\/06\/HA_Fig2-5.jpg\" alt=\"\" width=\"1023\" height=\"380\" \/><\/p>\n<p class=\"heading\"><strong>Build System<\/strong><\/p>\n<p class=\"text\">Based on the target processor, the build system should always include the generic cpp implementation and the processor specific implementation. For example, when compiling for Sharc for the xAF basic audio objects:<\/p>\n<p class=\"heading\"><strong>Generic Files<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21398\" src=\"https:\/\/audioworx.transfunnel.co\/old\/wp-content\/uploads\/2019\/06\/HA_Fig1-6.jpg\" alt=\"\" width=\"1007\" height=\"275\" \/><\/p>\n<p class=\"heading\"><strong>SHARC files<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21399\" src=\"https:\/\/audioworx.transfunnel.co\/old\/wp-content\/uploads\/2019\/06\/HA_Fig2-6.jpg\" alt=\"\" width=\"1019\" height=\"224\" \/><\/p>\n<p class=\"text\">\n","protected":false},"excerpt":{"rendered":"<p>Hardware abstraction is being done at Audio Object functions level such as calc, init etc. Audio Object Function Level Abstraction When the audio object function implementations are significantly different across various platforms, platform specific functions should be in different cpp files (file per core). A new cpp file needs to be introduced for every object [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","footnotes":"","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"off","ocean_gallery_id":[]},"categories":[353],"tags":[],"coauthors":[165],"_links":{"self":[{"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=\/wp\/v2\/posts\/4883"}],"collection":[{"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4883"}],"version-history":[{"count":20,"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=\/wp\/v2\/posts\/4883\/revisions"}],"predecessor-version":[{"id":28046,"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=\/wp\/v2\/posts\/4883\/revisions\/28046"}],"wp:attachment":[{"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4883"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4883"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4883"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/audioworx.transfunnel.co\/old\/index.php?rest_route=%2Fwp%2Fv2%2Fcoauthors&post=4883"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}