both read and write can fail, therefore allow recovery
Change-Id: I32462c68aaa2395da11d2969a73ab5b5f28af879
Signed-off-by: Adam Miartus <external.Adam.Miartus@de.bosch.com>
(cherry picked from commit 1996a103ac)
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
error code can now be checked making error handling more
explicit
this change also fixes confusing log in case of idle mode of
operation
the specific error code numbers are not significant because they
were never used in handling errors and in general there is error
log printed each time error occurs
Change-Id: Ieef6c2d72301ba582bfbd101bba7f3a5e228e980
Signed-off-by: Adam Miartus <external.Adam.Miartus@de.bosch.com>
(cherry picked from commit 2ec88d7054)
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
'c' decides what state idle device should be put to during reload
api call, when this option is present logic is to 'close' the idle
device, otherwise leave it 'prepared'
'x' enables the idle devices check for jackd init phase, the check
will behave the same way reload api call check call behaves,
therefore the state of the device will depend on 'c' option, if 'x'
option is not provided, devices will be configured to 'running' state
during jack init.
Change-Id: I3f8461884ef0569229f689412d0ec6ff8aeb39e9
Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com>
Signed-off-by: Adam Miartus <external.adam.miartus@de.bosch.com>
(cherry picked from commit ce2146ef1b)
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
for cases when we need to shutdown jack server or disconnect all devices
Change-Id: Idb3bede50e9f5e86d5997d5f675724846226b0c5
Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com>
(cherry picked from commit 2d7d8b93d0)
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
changes signature of function to allow extending the possible modes
of TargetState()
Change-Id: I394d85f4aac9fabb669fb03eedbfc3c6587a2a8e
Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com>
(cherry picked from commit 9d215ce938)
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
Change-Id: I68228ae98b4b074847abf547810e35e8e9267f31
Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com>
(cherry picked from commit d890538d32)
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
if enabled with '-x' option starts jackd with all devices closed, when
configured, user must provide number of channels for all devices, otherwise
we would not be able to create any jack ports.
we need to create all jack ports, since the only way to start any device
in this condition is to connect a jack port and issue a call
jack_client_reload_master
Change-Id: I63736eff20a2f2db7405ad512fec11e7bd0a9860
Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com>
(cherry picked from commit 55d03f05d0)
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
Change-Id: I3d79e5f2516d8709b70dc700e5c9a04534619661
Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com>
(cherry picked from commit 7a7d3b3524)
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
allow discard duplicate array members as a configurable feature
Change-Id: Ibbbfed9ec5633d2bdd23cc516f726ff4ad98c4ed
Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com>
(cherry picked from commit 65c157936a)
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
in case ALSA_DRIVER_FEAT_LINK_DEVS is defined, driver will attempt to
snd_pcm_link all devices
Change-Id: I7bd54b8414d0b614786bee1078667a9aa595b58f
Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com>
(cherry picked from commit da45a136f5)
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
in case ALSA_DRIVER_FEAT_CLOSE_IDLE_DEVS is defined unused devices are
closed on restart request, otherwise unused devices will be kept in
prepared state
Change-Id: I0cd91deb957a4839c5ea8c679bdabe1d0a3c6720
Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com>
(cherry picked from commit ee4fe3fde6)
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
on restart request desired state of devices is evaluated, devices will be
closed, left prepared, started depending on selected options or their usage
(number or connected ports)
Change-Id: Id512e013556169dfc3837fd5f10845848a211d5b
Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com>
(cherry picked from commit 9bdb9d09de)
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
will be used to ease transporting data between functions, later will be
used as part of alsa_driver_t struct
parsing of input devices moved to driver_initialize
Change-Id: I17ab2f51595aa3c8a77e36f68adfd4b60d8220a1
Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com>
(cherry picked from commit 9414ef5852)
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
linux release 1.0
what was tested:
- playing and recording from multiple devices
- linking devices, fallback for case when some or all devices are not linked
- xrun recovery
notes:
- we should be using epoll instead of poll, ~ +1 manday to implement
- solution can be simplified to remove doubling parameters for capture and playback
device, instead one struct for abstract "device" could be created that has parameter
capture or playaback, this would simplify code and reduce duplicate lines of code
Change-Id: I457b8e7e8ff0d04db18333b44bf64bf26a253bac
Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
for all devices.
This is required for example for some adaptive sample rate converters
which are executed on top of JACK. These SRCs are using the time stamp to
calculate the buffer fill level between playback application and sound
card.
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
Call JackAlsaDriver::Close() when alsa_driver_new() fails, to
release devices acquired just before that call. Otherwise
JackAlsaDriver::Open() will never succeed again, as re-acquiring the
same device will fail with "A handler is already registered" DBus error.
The parameter long description is used through the controlapi/dbus.
Now that jack_control displays the constraints, the dither parameter
long description servers no purpose.
The parameter long description is used through the controlapi/dbus.
Now that jack_control displays the constraints, the dither parameter
long description servers no purpose.
Descriptor initialization reduces risk of mismatch between array size
and element initialization. It also improves code readability by
separating the parameter descriptions separate from the code that
composes the enum constraint structures.
As a side effect this commit makes the self-connect-mode constraint
allocated in dedicated memory chunks, like others enum constraints.
The bug was present in the inital version of the code,
commit ebba58c8ee
There was no memory corruption because while
jack_driver_param_value_enum_t is smaller by 72 bytes than
jack_driver_param_constraint_desc_t, for enum constraints,
the last 240 (on 64bit) bytes are not used.
We recommend using symbolic names like hw:Live but when subdevices are used
regcomp() was failing to parse them. This changeset improves the algorithm
by using less assumptions.
* Don't attempt to use device reservation when card_to_num() mapping
has failed. In case of card_to_num() failures, "Audio-1" device
was reserved on start but not released on stop. This was causing
next start to fail with out of memory error, and since previous
commit, with "A handler is already registered for
/org/freedesktop/ReserveDevice1/Audio-1" error.
* In case of playback device reservation failure, release the
capture device
* Remove unused fReservedCaptureDevice and fReservedPlaybackDevice
data members of the JackAlsaDriver class
Parameter order doesnt matter for jackd but does for jackdbus. jackd
sets parameters (via Control API) in the order they were specified at
commandline. Thus, the jackd user is expected to specify parameters in
correct order. This is not good solution for jackdbus though. jackdbus
settings persistence in ~/.config/jack/jack.xml stores parameter in
the order they are defined by the driver. OTOH the D-Bus interface
itself suggests no particular order. For example the user can change
only one parameter via the jack_control tool. Other parameters either
have their default values or the ones that were previously set are
used.
The particular ordering problem this changeset aims to fix is that when
user specifies capture/playback device and device, the first one(s)
is/are ignored. This happens because the device parameter is set after
the capture/playback device parameters. The alsa then uses the string
from the device parameter for both capture and playback devices,
despite the user wish to override one or both of them.