diff options
-rw-r--r-- | README.md | 10 | ||||
-rw-r--r-- | doxygen/Doxyfile | 253 | ||||
-rw-r--r-- | include/tinyalsa/mixer.h | 2 | ||||
-rw-r--r-- | include/tinyalsa/pcm.h | 10 | ||||
-rw-r--r-- | include/tinyalsa/plugin.h | 6 | ||||
-rw-r--r-- | src/Makefile | 12 | ||||
-rw-r--r-- | src/pcm.c | 24 | ||||
-rw-r--r-- | src/pcm_hw.c | 23 | ||||
-rw-r--r-- | src/pcm_io.h | 5 | ||||
-rw-r--r-- | src/pcm_plugin.c | 64 | ||||
-rw-r--r-- | utils/Makefile | 8 |
11 files changed, 313 insertions, 104 deletions
@@ -15,7 +15,12 @@ The aims are: ### Building -TinyALSA uses Makefile as the primary build system. +TinyALSA supports these build systems: + + - [CMake](https://en.wikipedia.org/wiki/CMake) + - [Make](https://en.wikipedia.org/wiki/Make_(software)) + - [Meson](https://en.wikipedia.org/wiki/Meson_(software)) + - [Soong](https://android.googlesource.com/platform/build/soong/+/refs/heads/master/README.md) for Android To build and install with Make, run the commands: @@ -27,7 +32,8 @@ sudo ldconfig ### Installing -TinyALSA is now available as a set of the following debian packages from [launchpad](https://launchpad.net/~taylorcholberton/+archive/ubuntu/tinyalsa): +TinyALSA is now available as a set of the following [Debian](https://en.wikipedia.org/wiki/Debian) +packages from [launchpad](https://launchpad.net/~taylorcholberton/+archive/ubuntu/tinyalsa): | Package Name: | Description: | |-----------------|-----------------------------------------------------| diff --git a/doxygen/Doxyfile b/doxygen/Doxyfile index 9279343..a57ac00 100644 --- a/doxygen/Doxyfile +++ b/doxygen/Doxyfile @@ -1,4 +1,4 @@ -# Doxyfile 1.8.11 +# Doxyfile 1.8.17 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -17,11 +17,11 @@ # Project related configuration options #--------------------------------------------------------------------------- -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 @@ -93,6 +93,14 @@ ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = English +# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all generated output in the proper direction. +# Possible values are: None, LTR, RTL and Context. +# The default value is: None. + +OUTPUT_TEXT_DIRECTION = None + # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. @@ -179,6 +187,16 @@ SHORT_NAMES = NO JAVADOC_AUTOBRIEF = YES +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus @@ -226,7 +244,12 @@ TAB_SIZE = 4 # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. +# When you need a literal { or } or , in the value part of an alias you have to +# escape them by means of a backslash (\), this can lead to conflicts with the +# commands \{ and \} for these it is advised to use the version @{ and @} or use +# a double escape (\\{ and \\}) ALIASES = @@ -264,17 +287,26 @@ OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_OUTPUT_VHDL = NO +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: -# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: -# Fortran. In the later case the parser tries to guess whether the code is fixed -# or free formatted code, this is the default for Fortran type files), VHDL. For -# instance to make doxygen treat .inc files as Fortran files (default is PHP), -# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, +# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files), VHDL, tcl. For instance to make doxygen treat +# .inc files as Fortran files (default is PHP), and .f files as C (default is +# Fortran), use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # @@ -285,7 +317,7 @@ EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. +# documentation. See https://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. @@ -293,6 +325,15 @@ EXTENSION_MAPPING = MARKDOWN_SUPPORT = YES +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or @@ -318,7 +359,7 @@ BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. @@ -424,6 +465,12 @@ EXTRACT_ALL = NO EXTRACT_PRIVATE = NO +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. @@ -478,8 +525,8 @@ HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO, these declarations will be -# included in the documentation. +# declarations. If set to NO, these declarations will be included in the +# documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO @@ -502,7 +549,7 @@ INTERNAL_DOCS = NO # names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. +# (including Cygwin) ands Mac users are advised to set this option to NO. # The default value is: system dependent. CASE_SENSE_NAMES = YES @@ -689,7 +736,7 @@ LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. @@ -734,7 +781,8 @@ WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return # value. If set to NO, doxygen will only warn about wrong or incomplete -# parameter documentation, but not about the absence of documentation. +# parameter documentation, but not about the absence of documentation. If +# EXTRACT_ALL is set to YES then this flag will automatically be disabled. # The default value is: NO. WARN_NO_PARAMDOC = YES @@ -771,12 +819,14 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = "./mainpage.h" "../src" "../include/tinyalsa" +INPUT = "./mainpage.h" \ + "../src" \ + "../include/tinyalsa" # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of # possible encodings. # The default value is: UTF-8. @@ -793,10 +843,13 @@ INPUT_ENCODING = UTF-8 # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, -# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl, -# *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js. +# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment), +# *.doc (to be provided as doxygen C comment), *.txt (to be provided as doxygen +# C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f, *.for, *.tcl, *.vhd, +# *.vhdl, *.ucf, *.qsf and *.ice. -FILE_PATTERNS = "*.c" "*.h" +FILE_PATTERNS = "*.c" \ + "*.h" # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. @@ -949,7 +1002,7 @@ INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. +# entity all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO @@ -981,12 +1034,12 @@ SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version +# (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # @@ -1014,10 +1067,10 @@ VERBATIM_HEADERS = YES # rich C++ code for which doxygen's built-in parser lacks the necessary type # information. # Note: The availability of this option depends on whether or not doxygen was -# generated with the -Duse-libclang=ON option for CMake. +# generated with the -Duse_libclang=ON option for CMake. # The default value is: NO. -CLANG_ASSISTED_PARSING = +CLANG_ASSISTED_PARSING = NO # If clang assisted parsing is enabled you can provide the compiler with command # line options that you would normally use when invoking the compiler. Note that @@ -1027,6 +1080,16 @@ CLANG_ASSISTED_PARSING = CLANG_OPTIONS = +# If clang assisted parsing is enabled you can provide the clang parser with the +# path to the compilation database (see: +# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) used when the files +# were built. This is equivalent to specifying the "-p" option to a clang tool, +# such as clang-check. These options will then be passed to the parser. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. + +CLANG_DATABASE_PATH = + #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- @@ -1145,7 +1208,7 @@ HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. @@ -1181,6 +1244,17 @@ HTML_COLORSTYLE_GAMMA = 80 HTML_TIMESTAMP = NO +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. @@ -1204,13 +1278,13 @@ HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# environment (see: https://developer.apple.com/xcode/), introduced with OSX +# 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1249,7 +1323,7 @@ DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on # Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output @@ -1325,7 +1399,7 @@ QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1333,7 +1407,7 @@ QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# Folders (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual- # folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1342,7 +1416,7 @@ QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1350,7 +1424,7 @@ QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1358,7 +1432,7 @@ QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = @@ -1451,7 +1525,7 @@ EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # @@ -1462,8 +1536,14 @@ FORMULA_FONTSIZE = 10 FORMULA_TRANSPARENT = YES +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering +# https://www.mathjax.org) which uses client side JavaScript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path @@ -1490,8 +1570,8 @@ MATHJAX_FORMAT = HTML-CSS # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest @@ -1533,7 +1613,7 @@ MATHJAX_CODEFILE = SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a web server instead of a web client using Javascript. There +# implemented using a web server instead of a web client using JavaScript. There # are two flavors of web server based searching depending on the EXTERNAL_SEARCH # setting. When disabled, doxygen will generate a PHP script for searching and # an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing @@ -1552,7 +1632,7 @@ SERVER_BASED_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). +# Xapian (see: https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1565,7 +1645,7 @@ EXTERNAL_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and +# Xapian (see: https://xapian.org/). See the section "External Indexing and # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. @@ -1617,21 +1697,35 @@ LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. # -# Note that when enabling USE_PDFLATEX this option is only used for generating -# bitmaps for formulas in the HTML output, but not in the Makefile that is -# written to the output directory. -# The default file is: latex. +# Note that when not enabling USE_PDFLATEX the default is latex when enabling +# USE_PDFLATEX the default is pdflatex and when in the later case latex is +# chosen this is overwritten by pdflatex. For specific output languages the +# default can have been set differently, this depends on the implementation of +# the output language. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate # index for LaTeX. +# Note: This tag is used in the Makefile / make.bat. +# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file +# (.tex). # The default file is: makeindex. # This tag requires that the tag GENERATE_LATEX is set to YES. MAKEINDEX_CMD_NAME = makeindex +# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to +# generate index for LaTeX. In case there is no backslash (\) as first character +# it will be automatically added in the LaTeX code. +# Note: This tag is used in the generated output file (.tex). +# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat. +# The default value is: makeindex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_MAKEINDEX_CMD = makeindex + # If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX # documents. This may be useful for small projects and may help to save some # trees in general. @@ -1752,7 +1846,7 @@ LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See -# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. # The default value is: plain. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1766,6 +1860,14 @@ LATEX_BIB_STYLE = plain LATEX_TIMESTAMP = NO +# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute) +# path from which the emoji images will be read. If a relative path is entered, +# it will be relative to the LATEX_OUTPUT directory. If left blank the +# LATEX_OUTPUT directory will be used. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EMOJI_DIRECTORY = + #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- @@ -1805,9 +1907,9 @@ COMPACT_RTF = NO RTF_HYPERLINKS = NO -# Load stylesheet definitions from file. Syntax is similar to doxygen's config -# file, i.e. a series of assignments. You only have to provide replacements, -# missing definitions are set to their default value. +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# configuration file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. # # See also section "Doxygen usage" for information on how to generate the # default style sheet that doxygen normally uses. @@ -1816,8 +1918,8 @@ RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is -# similar to doxygen's config file. A template extensions file can be generated -# using doxygen -e rtf extensionFile. +# similar to doxygen's configuration file. A template extensions file can be +# generated using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. RTF_EXTENSIONS_FILE = @@ -1903,6 +2005,13 @@ XML_OUTPUT = xml XML_PROGRAMLISTING = YES +# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include +# namespace members in file scope as well, matching the HTML output. +# The default value is: NO. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_NS_MEMB_FILE_SCOPE = NO + #--------------------------------------------------------------------------- # Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- @@ -1935,9 +2044,9 @@ DOCBOOK_PROGRAMLISTING = NO #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an -# AutoGen Definitions (see http://autogen.sf.net) file that captures the -# structure of the code including all documentation. Note that this feature is -# still experimental and incomplete at the moment. +# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# the structure of the code including all documentation. Note that this feature +# is still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO @@ -2104,12 +2213,6 @@ EXTERNAL_GROUPS = YES EXTERNAL_PAGES = YES -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of 'which perl'). -# The default file (with absolute path) is: /usr/bin/perl. - -PERL_PATH = /usr/bin/perl - #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- @@ -2123,15 +2226,6 @@ PERL_PATH = /usr/bin/perl CLASS_DIAGRAMS = YES -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see: -# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - # You can include diagrams made with dia in doxygen documentation. Doxygen will # then run dia to produce the diagram and insert it in the documentation. The # DIA_PATH tag allows you to specify the directory where the dia binary resides. @@ -2361,6 +2455,11 @@ DIAFILE_DIRS = PLANTUML_JAR_PATH = +# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a +# configuration file for plantuml. + +PLANTUML_CFG_FILE = + # When using plantuml, the specified paths are searched for files specified by # the !include statement in a plantuml block. diff --git a/include/tinyalsa/mixer.h b/include/tinyalsa/mixer.h index 7f0f022..2acdd54 100644 --- a/include/tinyalsa/mixer.h +++ b/include/tinyalsa/mixer.h @@ -44,7 +44,7 @@ extern "C" { #endif /* TLV header size*/ -#define TLV_HEADER_SIZE (2 * sizeof(unsigned int)) +#define TLV_HEADER_SIZE sizeof(struct snd_ctl_tlv) struct mixer; diff --git a/include/tinyalsa/pcm.h b/include/tinyalsa/pcm.h index f4b7d73..1184d81 100644 --- a/include/tinyalsa/pcm.h +++ b/include/tinyalsa/pcm.h @@ -95,6 +95,16 @@ * */ #define PCM_NONBLOCK 0x00000010 +/** Means a PCM is opened + * @ingroup libtinyalsa-pcm + */ +#define PCM_STATE_OPEN 0x00 + +/** Means a PCM HW_PARAMS is set + * @ingroup libtinyalsa-pcm + */ +#define PCM_STATE_SETUP 0x01 + /** Means a PCM is prepared * @ingroup libtinyalsa-pcm */ diff --git a/include/tinyalsa/plugin.h b/include/tinyalsa/plugin.h index a140754..b2f97b9 100644 --- a/include/tinyalsa/plugin.h +++ b/include/tinyalsa/plugin.h @@ -30,6 +30,7 @@ #ifndef TINYALSA_PLUGIN_H #define TINYALSA_PLUGIN_H +#include <poll.h> #include <stdint.h> #include <stdlib.h> #include <sys/types.h> @@ -128,6 +129,11 @@ struct pcm_plugin_ops { /** Any custom or alsa specific ioctl implementation */ int (*ioctl) (struct pcm_plugin *plugin, int cmd, void *arg); + void *(*mmap) (struct pcm_plugin *plugin, void *addr, size_t length, + int prot, int flags, off_t offset); + int (*munmap) (struct pcm_plugin *plugin, void *addr, size_t length); + int (*poll) (struct pcm_plugin *plugin, struct pollfd *pfd, nfds_t nfds, + int timeout); }; /** Minimum and maximum values for hardware parameter constraints. diff --git a/src/Makefile b/src/Makefile index 79628b5..aaa84b8 100644 --- a/src/Makefile +++ b/src/Makefile @@ -23,19 +23,19 @@ LIBVERSION = $(TINYALSA_VERSION) .PHONY: all all: libtinyalsa.a libtinyalsa.so -pcm.o: pcm.c pcm.h +pcm.o: pcm.c limits.h pcm.h pcm_io.h plugin.h snd_card_plugin.h -pcm_plugin.o: pcm_plugin.c pcm_io.h +pcm_plugin.o: pcm_plugin.c asoundlib.h pcm_io.h plugin.h snd_card_plugin.h -pcm_hw.o: pcm_hw.c pcm_io.h +pcm_hw.o: pcm_hw.c asoundlib.h pcm_io.h limits.o: limits.c limits.h -mixer.o: mixer.c mixer.h +mixer.o: mixer.c mixer.h mixer_io.h plugin.h -snd_card_plugin.o: snd_card_plugin.c snd_card_plugin.h +snd_card_plugin.o: snd_card_plugin.c plugin.h snd_card_plugin.h -mixer_plugin.o: mixer_plugin.c mixer_io.h +mixer_plugin.o: mixer_plugin.c mixer_io.h plugin.h snd_card_plugin.h mixer_hw.o: mixer_hw.c mixer_io.h @@ -404,8 +404,8 @@ int pcm_set_config(struct pcm *pcm, const struct pcm_config *config) pcm->buffer_size = config->period_count * config->period_size; if (pcm->flags & PCM_MMAP) { - pcm->mmap_buffer = mmap(NULL, pcm_frames_to_bytes(pcm, pcm->buffer_size), - PROT_READ | PROT_WRITE, MAP_SHARED, pcm->fd, 0); + pcm->mmap_buffer = pcm->ops->mmap(pcm->data, NULL, pcm_frames_to_bytes(pcm, pcm->buffer_size), + PROT_READ | PROT_WRITE, MAP_SHARED, 0); if (pcm->mmap_buffer == MAP_FAILED) { int errno_copy = errno; oops(pcm, errno, "failed to mmap buffer %d bytes\n", @@ -544,19 +544,19 @@ static int pcm_hw_mmap_status(struct pcm *pcm) return 0; int page_size = sysconf(_SC_PAGE_SIZE); - pcm->mmap_status = mmap(NULL, page_size, PROT_READ, MAP_SHARED, - pcm->fd, SNDRV_PCM_MMAP_OFFSET_STATUS); + pcm->mmap_status = pcm->ops->mmap(pcm->data, NULL, page_size, PROT_READ, MAP_SHARED, + SNDRV_PCM_MMAP_OFFSET_STATUS); if (pcm->mmap_status == MAP_FAILED) pcm->mmap_status = NULL; if (!pcm->mmap_status) goto mmap_error; - pcm->mmap_control = mmap(NULL, page_size, PROT_READ | PROT_WRITE, - MAP_SHARED, pcm->fd, SNDRV_PCM_MMAP_OFFSET_CONTROL); + pcm->mmap_control = pcm->ops->mmap(pcm->data, NULL, page_size, PROT_READ | PROT_WRITE, + MAP_SHARED, SNDRV_PCM_MMAP_OFFSET_CONTROL); if (pcm->mmap_control == MAP_FAILED) pcm->mmap_control = NULL; if (!pcm->mmap_control) { - munmap(pcm->mmap_status, page_size); + pcm->ops->munmap(pcm->data, pcm->mmap_status, page_size); pcm->mmap_status = NULL; goto mmap_error; } @@ -581,9 +581,9 @@ static void pcm_hw_munmap_status(struct pcm *pcm) { } else { int page_size = sysconf(_SC_PAGE_SIZE); if (pcm->mmap_status) - munmap(pcm->mmap_status, page_size); + pcm->ops->munmap(pcm->data, pcm->mmap_status, page_size); if (pcm->mmap_control) - munmap(pcm->mmap_control, page_size); + pcm->ops->munmap(pcm->data, pcm->mmap_control, page_size); } pcm->mmap_status = NULL; pcm->mmap_control = NULL; @@ -813,7 +813,7 @@ int pcm_close(struct pcm *pcm) if (pcm->flags & PCM_MMAP) { pcm_stop(pcm); - munmap(pcm->mmap_buffer, pcm_frames_to_bytes(pcm, pcm->buffer_size)); + pcm->ops->munmap(pcm->data, pcm->mmap_buffer, pcm_frames_to_bytes(pcm, pcm->buffer_size)); } snd_utils_close_dev_node(pcm->snd_node); @@ -948,7 +948,7 @@ struct pcm *pcm_open(unsigned int card, unsigned int device, fail: pcm_hw_munmap_status(pcm); if (flags & PCM_MMAP) - munmap(pcm->mmap_buffer, pcm_frames_to_bytes(pcm, pcm->buffer_size)); + pcm->ops->munmap(pcm->data, pcm->mmap_buffer, pcm_frames_to_bytes(pcm, pcm->buffer_size)); fail_close: pcm->ops->close(pcm->data); fail_close_dev_node: @@ -1264,7 +1264,7 @@ int pcm_wait(struct pcm *pcm, int timeout) do { /* let's wait for avail or timeout */ - err = poll(&pfd, 1, timeout); + err = pcm->ops->poll(pcm->data, &pfd, 1, timeout); if (err < 0) return -errno; diff --git a/src/pcm_hw.c b/src/pcm_hw.c index e25cdae..38b2e83 100644 --- a/src/pcm_hw.c +++ b/src/pcm_hw.c @@ -37,6 +37,7 @@ #include <poll.h> #include <sys/ioctl.h> +#include <sys/mman.h> #include <linux/ioctl.h> #include <sound/asound.h> #include <tinyalsa/asoundlib.h> @@ -77,6 +78,25 @@ static int pcm_hw_ioctl(void *data, unsigned int cmd, ...) return ioctl(hw_data->fd, cmd, arg); } +static int pcm_hw_poll(void *data __attribute__((unused)), + struct pollfd *pfd, nfds_t nfds, int timeout) +{ + return poll(pfd, nfds, timeout); +} + +static void *pcm_hw_mmap(void *data, void *addr, size_t length, int prot, + int flags, off_t offset) +{ + struct pcm_hw_data *hw_data = data; + + return mmap(addr, length, prot, flags, hw_data->fd, offset); +} + +static int pcm_hw_munmap(void *data __attribute__((unused)), void *addr, size_t length) +{ + return munmap(addr, length); +} + static int pcm_hw_open(unsigned int card, unsigned int device, unsigned int flags, void **data, struct snd_node *node) { @@ -115,5 +135,8 @@ const struct pcm_ops hw_ops = { .open = pcm_hw_open, .close = pcm_hw_close, .ioctl = pcm_hw_ioctl, + .mmap = pcm_hw_mmap, + .munmap = pcm_hw_munmap, + .poll = pcm_hw_poll, }; diff --git a/src/pcm_io.h b/src/pcm_io.h index 1b68ac8..3c622fd 100644 --- a/src/pcm_io.h +++ b/src/pcm_io.h @@ -30,6 +30,7 @@ #ifndef TINYALSA_SRC_PCM_IO_H #define TINYALSA_SRC_PCM_IO_H +#include <poll.h> #include <sound/asound.h> struct snd_node; @@ -39,6 +40,10 @@ struct pcm_ops { unsigned int flags, void **data, struct snd_node *node); void (*close) (void *data); int (*ioctl) (void *data, unsigned int cmd, ...); + void *(*mmap) (void *data, void *addr, size_t length, int prot, int flags, + off_t offset); + int (*munmap) (void *data, void *addr, size_t length); + int (*poll) (void *data, struct pollfd *pfd, nfds_t nfds, int timeout); }; extern const struct pcm_ops hw_ops; diff --git a/src/pcm_plugin.c b/src/pcm_plugin.c index 695ad2c..15bfc80 100644 --- a/src/pcm_plugin.c +++ b/src/pcm_plugin.c @@ -89,6 +89,24 @@ static unsigned int param_list[] = { SNDRV_PCM_HW_PARAM_PERIODS, }; +static int convert_plugin_to_pcm_state(int plugin_state) +{ + switch (plugin_state) { + case PCM_PLUG_STATE_SETUP: + return PCM_STATE_SETUP; + case PCM_PLUG_STATE_RUNNING: + return PCM_STATE_RUNNING; + case PCM_PLUG_STATE_PREPARED: + return PCM_STATE_PREPARED; + case PCM_PLUG_STATE_OPEN: + return PCM_STATE_OPEN; + default: + break; + } + + return PCM_STATE_OPEN; +} + static void pcm_plug_close(void *data) { struct pcm_plug_data *plug_data = data; @@ -513,8 +531,15 @@ static int pcm_plug_sync_ptr(struct pcm_plug_data *plug_data, struct snd_pcm_sync_ptr *sync_ptr) { struct pcm_plugin *plugin = plug_data->plugin; + int ret = -EBADFD; + + if (plugin->state >= PCM_PLUG_STATE_SETUP) { + ret = plug_data->ops->sync_ptr(plugin, sync_ptr); + if (ret == 0) + sync_ptr->s.status.state = convert_plugin_to_pcm_state(plugin->state); + } - return plug_data->ops->sync_ptr(plugin, sync_ptr); + return ret; } static int pcm_plug_writei_frames(struct pcm_plug_data *plug_data, @@ -545,7 +570,7 @@ static int pcm_plug_ttstamp(struct pcm_plug_data *plug_data, { struct pcm_plugin *plugin = plug_data->plugin; - if (plugin->state != PCM_PLUG_STATE_RUNNING) + if (plugin->state < PCM_PLUG_STATE_SETUP) return -EBADFD; return plug_data->ops->ttstamp(plugin, tstamp); @@ -647,6 +672,38 @@ static int pcm_plug_ioctl(void *data, unsigned int cmd, ...) return ret; } +static int pcm_plug_poll(void *data, struct pollfd *pfd, nfds_t nfds, + int timeout) +{ + struct pcm_plug_data *plug_data = data; + struct pcm_plugin *plugin = plug_data->plugin; + + return plug_data->ops->poll(plugin, pfd, nfds, timeout); +} + +static void *pcm_plug_mmap(void *data, void *addr, size_t length, int prot, + int flags, off_t offset) +{ + struct pcm_plug_data *plug_data = data; + struct pcm_plugin *plugin = plug_data->plugin; + + if (plugin->state != PCM_PLUG_STATE_SETUP) + return NULL; + + return plug_data->ops->mmap(plugin, addr, length, prot, flags, offset); +} + +static int pcm_plug_munmap(void *data, void *addr, size_t length) +{ + struct pcm_plug_data *plug_data = data; + struct pcm_plugin *plugin = plug_data->plugin; + + if (plugin->state != PCM_PLUG_STATE_SETUP) + return -EBADFD; + + return plug_data->ops->munmap(plugin, addr, length); +} + static int pcm_plug_open(unsigned int card, unsigned int device, unsigned int flags, void **data, struct snd_node *pcm_node) { @@ -715,4 +772,7 @@ const struct pcm_ops plug_ops = { .open = pcm_plug_open, .close = pcm_plug_close, .ioctl = pcm_plug_ioctl, + .mmap = pcm_plug_mmap, + .munmap = pcm_plug_munmap, + .poll = pcm_plug_poll, }; diff --git a/utils/Makefile b/utils/Makefile index 2e4bef6..f733c39 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -23,19 +23,19 @@ tinyplay tinycap tinypcminfo tinymix: LDLIBS+=-ldl tinyplay: tinyplay.o libtinyalsa.a -tinyplay.o: tinyplay.c pcm.h mixer.h asoundlib.h +tinyplay.o: tinyplay.c pcm.h mixer.h asoundlib.h optparse.h tinycap: tinycap.o libtinyalsa.a -tinycap.o: tinycap.c pcm.h mixer.h asoundlib.h +tinycap.o: tinycap.c pcm.h mixer.h asoundlib.h optparse.h tinymix: tinymix.o libtinyalsa.a -tinymix.o: tinymix.c pcm.h mixer.h asoundlib.h +tinymix.o: tinymix.c pcm.h mixer.h asoundlib.h optparse.h tinypcminfo: tinypcminfo.o libtinyalsa.a -tinypcminfo.o: tinypcminfo.c pcm.h mixer.h asoundlib.h +tinypcminfo.o: tinypcminfo.c pcm.h mixer.h asoundlib.h optparse.h .PHONY: clean clean: |