18c2ecf20Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
28c2ecf20Sopenharmony_ci.. c:namespace:: DTV.audio
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci.. _audio_fopen:
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci=======================
78c2ecf20Sopenharmony_ciDigital TV audio open()
88c2ecf20Sopenharmony_ci=======================
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ciName
118c2ecf20Sopenharmony_ci----
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ciDigital TV audio open()
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci.. attention:: This ioctl is deprecated
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ciSynopsis
188c2ecf20Sopenharmony_ci--------
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci.. c:function:: int open(const char *deviceName, int flags)
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ciArguments
238c2ecf20Sopenharmony_ci---------
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci.. flat-table::
268c2ecf20Sopenharmony_ci    :header-rows:  0
278c2ecf20Sopenharmony_ci    :stub-columns: 0
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci    -  .. row 1
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci       -  const char \*deviceName
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci       -  Name of specific audio device.
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci    -  .. row 2
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci       -  int flags
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci       -  A bit-wise OR of the following flags:
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci    -  .. row 3
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci       -
448c2ecf20Sopenharmony_ci       -  O_RDONLY read-only access
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci    -  .. row 4
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci       -
498c2ecf20Sopenharmony_ci       -  O_RDWR read/write access
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci    -  .. row 5
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci       -
548c2ecf20Sopenharmony_ci       -  O_NONBLOCK open in non-blocking mode
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci    -  .. row 6
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci       -
598c2ecf20Sopenharmony_ci       -  (blocking mode is the default)
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ciDescription
628c2ecf20Sopenharmony_ci-----------
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ciThis system call opens a named audio device (e.g.
658c2ecf20Sopenharmony_ci/dev/dvb/adapter0/audio0) for subsequent use. When an open() call has
668c2ecf20Sopenharmony_cisucceeded, the device will be ready for use. The significance of
678c2ecf20Sopenharmony_ciblocking or non-blocking mode is described in the documentation for
688c2ecf20Sopenharmony_cifunctions where there is a difference. It does not affect the semantics
698c2ecf20Sopenharmony_ciof the open() call itself. A device opened in blocking mode can later be
708c2ecf20Sopenharmony_ciput into non-blocking mode (and vice versa) using the F_SETFL command
718c2ecf20Sopenharmony_ciof the fcntl system call. This is a standard system call, documented in
728c2ecf20Sopenharmony_cithe Linux manual page for fcntl. Only one user can open the Audio Device
738c2ecf20Sopenharmony_ciin O_RDWR mode. All other attempts to open the device in this mode will
748c2ecf20Sopenharmony_cifail, and an error code will be returned. If the Audio Device is opened
758c2ecf20Sopenharmony_ciin O_RDONLY mode, the only ioctl call that can be used is
768c2ecf20Sopenharmony_ciAUDIO_GET_STATUS. All other call will return with an error code.
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ciReturn Value
798c2ecf20Sopenharmony_ci------------
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci.. flat-table::
848c2ecf20Sopenharmony_ci    :header-rows:  0
858c2ecf20Sopenharmony_ci    :stub-columns: 0
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci    -  .. row 1
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci       -  ``ENODEV``
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci       -  Device driver not loaded/available.
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci    -  .. row 2
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci       -  ``EBUSY``
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci       -  Device or resource busy.
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci    -  .. row 3
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci       -  ``EINVAL``
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci       -  Invalid argument.
104