Commit Graph

302 Commits

Author SHA1 Message Date
Nedko Arnaudov e1202d714b linux/alsa/alsa_rawmidi.c: Fix potential snprintf() truncation 2023-08-29 22:35:31 +03:00
Nedko Arnaudov e60d202fd1 linux/alsa/alsa_rawmidi.c: Adjust default port metadata
See also b83d2340a5
2023-08-29 22:34:49 +03:00
Nedko Arnaudov 59a8aad4e1 Merge jackaudio/develop into LADI/main 2023-08-29 21:40:09 +03:00
Albert Graef b83d2340a5
Jack MIDI portnames (fixes #944) (#945)
* Rework the seqmidi aliases.

- The 1st alias is now the Jack1 MIDI port name with alsa_midi prefix.

- This 2nd alias is basically the same as the 1st alias with the
  alsa_midi prefix stripped, so that devices are listed under the ALSA
  names.

Also fixed the "capture" and "playback" port type names which were the
wrong way round.

* Rework the rawmidi alias.

Like in alsa_seqmidi.c, the 1st alias is now the Jack1 MIDI port name
with alsa_midi prefix.

* Rework pretty-name metadata.

The rawmidi and seqmidi pretty-name metadata now uses the same Jack1
port name as the 1st alias, without the alsa_midi: prefix.
2023-08-29 16:07:54 +02:00
Nedko Arnaudov 014e2000c5 linux/alsa/alsa_rawmidi.c: Adjust port aliases to match these of linux/alsarawmidi/* 2023-07-23 20:52:10 +03:00
Nedko Arnaudov 25d398b580 linux/alsa/alsa_rawmidi.c: Add my copyright line 2023-07-19 00:57:48 +03:00
Nedko Arnaudov 7342f76922 linux/alsa/alsa_seqmidi.c: adjust alias prefix to alsa_midi:
This is partial cherry-pick of https://github.com/agraef/jack2
commit 71c9e64019a45c363cfedfec5f3ff9d5f2d9a1cc

Kudos to @agraef
2023-07-19 00:05:59 +03:00
Nedko Arnaudov c5b3bf222c linux/alsa/alsa_rawmidi.c: Adjust port aliases to match alsa_pcm naming scheme 2023-07-18 23:41:58 +03:00
Nedko Arnaudov 4a125dcfbb linux/alsa/alsa_rawmidi.c: Use string id in alias
This commit also renames the name member to alias, so to match reality.
The alias max size was extended to 4096 bytes (jack port registration limitations still aplly)
2023-07-18 23:17:20 +03:00
Claudio Cabral 719fa1d545 Add 32 bit support for ALSA driver (#811)
* apply changes without whitespace

* remove neon intrinsics and fix indentation

* update float_32 macro and fix misspellings

* check msbits to determine number of bits in alsa driver

* add better error messages and support for SND_PCM_FORMAT_S32_BE

* log when sample format is not equal to bits

Co-authored-by: Claudio Cabral <clca@bang-olufsen.dk>
Co-authored-by: Claudio Cabral <cl@udio.co>
2022-01-15 15:09:56 +00:00
Camille Gonnet 8d51e9a005 ALSA: convert properly S24_LE 2022-01-15 15:09:55 +00:00
Adam Miartus 87da6c7d38 jack alsa: reoganize code for readability
Change-Id: I3d79e5f2516d8709b70dc700e5c9a04534619661
Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com>
(cherry picked from commit 7a7d3b3524877533c0d5a9d3490d862d4323d280)
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
2020-10-11 22:43:49 +02:00
Adam Miartus 4f8849bdc6 alsa_driver: remove unused variable
Change-Id: I98fc02a877a830d375b458f0346fc9a43993e72c
Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com>
2020-10-11 22:42:51 +02:00
falkTX dedf85e95a
Revert "alsa: fix the poll interval"
This reverts commit d9f84dcca3.
2020-09-13 00:47:33 +01:00
falkTX 17574b4634
Revert "Remove `floor` call in timeout calculation"
This reverts commit 0393da5868.
2020-09-13 00:46:47 +01:00
falkTX 9455cea656
Revert "Fix integer conversion for poll_timeout_ms"
This reverts commit 0e5f15dbda.
2020-09-13 00:46:33 +01:00
falkTX 0e5f15dbda
Fix integer conversion for poll_timeout_ms
Signed-off-by: falkTX <falktx@falktx.com>
2020-07-16 20:24:26 +01:00
falkTX 0393da5868
Remove `floor` call in timeout calculation
See #614

Signed-off-by: falkTX <falktx@falktx.com>
2020-07-16 13:43:43 +01:00
Adam Miartus 994ebbc6ee alsa: in case of poll timeout print error
This is always an audible issue. Therefore print the coresponding
error message also in non verbose mode.

Signed-off-by: Adam Miartus <external.Adam.Miartus@de.bosch.com>
(cherry picked from commit 5b8c373318382183b0ec08a2a450cdfe75937892)
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>

Change-Id: I5e1380776f76814409f198a4ad874d4ae46007e3
2020-06-11 11:17:34 +02:00
Adam Miartus 1180f86400 alsa: add log in case of poll was interrupted
poll may be interrupted due to signal, in that case print
error log

Change-Id: I1b2b2543a4b056b50af7617efc80fe517bddaaae
Signed-off-by: Adam Miartus <external.Adam.Miartus@de.bosch.com>
(cherry picked from commit 20883aa404c3d5eb0370eaa8ab2337f3b95c1bf9)
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
2020-06-11 11:16:48 +02:00
Adam Miartus d9f84dcca3 alsa: fix the poll interval
should be set in milliseconds

Signed-off-by: Adam Miartus <external.Adam.Miartus@de.bosch.com>
(cherry picked from commit 17031895ded6a1d53a3b851059134d11f12c9ce6)
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>

Change-Id: I3d32e4602c1bdf15474b14496173727aa130c924
2020-06-10 23:18:05 +02:00
Adam Miartus 4d251434e8 alsa: fix typo in error output
Change-Id: I45e1ccf2e1b955db187eb72127a536fe5eb0b81e
Signed-off-by: Adam Miartus <external.Adam.Miartus@de.bosch.com>
(cherry picked from commit 865cad2003b57e8dd175636a5d7070a4a470e3ac)
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
2020-06-10 22:37:29 +02:00
Adam Miartus b2d9868550 alsa: fix define conflict with std algorithm
Change-Id: If3582834e0ca33bf36203a38fe7fd262d96a6827
Signed-off-by: Adam Miartus <external.adam.miartus@de.bosch.com>
2020-06-10 22:31:35 +02:00
Luciano Iam a5093f06ca Rename PortSetDeviceMetadata to PortSetDefaultMetadata 2019-10-28 11:24:12 +01:00
falkTX f19176657c Fix blocking DBus device reservation, so it plays nice with others 2019-10-28 11:16:09 +01:00
falkTX 37250ff470
Use strncpy in some calls for alsa_rawmidi.c
Signed-off-by: falkTX <falktx@falktx.com>
2019-10-06 23:02:59 +01:00
Luciano Iam ab536f67bc Rename system_midi:* back to system:midi_* 2019-10-05 21:27:37 +01:00
Luciano Iam 0f015fc53b Set pretty-name for ALSA seq MIDI ports 2019-10-05 21:27:37 +01:00
Luciano Iam a11fa07e5e Set pretty-name for ALSA raw MIDI ports 2019-10-05 21:27:37 +01:00
falkTX c8fd3f6a0f
Set "seq" alsa midi driver to maximum resolution possible
Signed-off-by: falkTX <falktx@falktx.com>
2019-10-05 21:17:42 +01:00
Laxmi Devi 4341f8086f alsa_driver: Execute recovery on ALSA poll timeout
On ALSA poll time out, retry polling after executing the recovery.
Retry max limit is set with MAX_RETRY_COUNT.

Signed-off-by: Laxmi Devi <Laxmi.Devi@in.bosch.com>
2019-09-11 19:25:50 +01:00
Laxmi Devi 45ab755883 alsa_driver: Moved the check for poll timeout before getting the revents
Currently only poll_result is checked for < 0 before doing the further
processing, and not for timeout. After this movement the revents is checked
only if the poll doesn't timeout.


Signed-off-by: Laxmi Devi <Laxmi.Devi@in.bosch.com>
2019-09-11 19:25:50 +01:00
Laxmi Devi fb11c75fdc alsa_driver: Exiting loop for need_playback and need_capture on XRUN to execute recovery
Currently even on XRUN, the xrun recovery is not executed as the
need_playback or need_capture flag is still true and so it goes
and waits on poll again.

Signed-off-by: Laxmi Devi <Laxmi.Devi@in.bosch.com>
2019-09-11 19:22:28 +01:00
luz.paz a93b210134 FIx doxygen and user facing and non-facing typos
Found via `codespell -q 3`
2019-09-11 19:17:07 +01:00
falkTX a24777a16c
Use CLOCK_MONOTONIC_RAW when available
Signed-off-by: falkTX <falktx@falktx.com>
2019-06-02 20:21:50 +02:00
Arnout Diels 487632577d Changed jackd alsa driver to reprepare the kernel alsa driver upon each xrun 2019-03-22 12:52:07 +01:00
Rui Nuno Capela 05bc08c64e memops-alsa_bad_sound-fix-1 (#426)
* Revert "oss_driver: Use float to S32 conversion if requested"

This reverts commit c5a0f5ea1c.

* Revert "alsa_in/out: Use float to S32 conversion if requested"

This reverts commit 148c8d8e6a.

* Revert "alsa_driver: Use float to S32 conversion if requested"

This reverts commit d017e1fffe.

* Revert "memops: Provide function for float to S32 conversion"

This reverts commit bb99e09b99.

* Revert "memops: Align S24LE and S32LE to float conversion"

This reverts commit b4ea23df6a.

* Revert "memops: Provide function for S32 to float conversion"

This reverts commit 244fc27e29.

* Revert "memops: Align float to S24LE and S32LE conversion"

This reverts commit 4455fe020c.

* Revert "memops: Remove not used conversion macros"

This reverts commit a82f3f2fb4.

* Revert "memops: Use right-aligned S24LE to float conversion"

This reverts commit e753254313.

* Revert "memops: Use right-aligned float to S24LE conversion"

This reverts commit 831163e516.
2019-02-08 22:22:53 +01:00
Timo Wischer d017e1fffe alsa_driver: Use float to S32 conversion if requested
sample_move_d32u24_sS() converts into samples like 0x00****** but S32
format expects samples like 0x********. Therefore it will not use the
full volume range when also using sample_move_d32u24_sS() for S32.

Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
2019-01-17 00:56:39 +01:00
falkTX 53f1a87bdf
Revert a test change.
Sorry!

Signed-off-by: falkTX <falktx@gmail.com>
2018-11-13 23:06:00 +01:00
falkTX 7dfdbe133a
Cleanup some warnings
Signed-off-by: falkTX <falktx@gmail.com>
2018-11-13 23:01:23 +01:00
falkTX fb59d62c7f
Fix build against old alsa versions
Signed-off-by: falkTX <falktx@gmail.com>
2018-10-10 20:32:48 +02:00
falkTX 756b4fa1cb ALSA: Always enable tstamp mode, other small fixes 2018-10-10 11:19:57 +02:00
Karl Linden f5f22c6bef
Revert "Fix unused{,-but-set}-variable compiler warnings."
This reverts commit dde9f29a8e.

The commit introduced the following compiler error:

[100/255] Compiling posix/JackNetUnixSocket.cpp
../posix/JackNetUnixSocket.cpp: In member function 'int Jack::JackNetUnixSocket::NewSocket()':
../posix/JackNetUnixSocket.cpp:126:32: error: 'tos' was not declared in this scope
         socklen_t len = sizeof(tos);
2018-10-06 13:15:11 +02:00
Karl Linden dde9f29a8e Fix unused{,-but-set}-variable compiler warnings. 2018-10-06 12:57:32 +02:00
Timo Wischer 67e4b4368e alsa driver: Provide option to enable time stamp mode
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>
2018-07-27 08:39:23 +02:00
Adrian Knoth c5dac6270e More spelling fixes from Debian QA 2018-02-25 19:06:46 +01:00
Stephane Letz 02f74a659a String management fix. 2016-01-01 20:40:22 +01:00
Jacek Konieczny 57e16b9a05 Release audio devices when alsa_driver_new fails
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.
2015-12-06 18:42:14 +01:00
escitalopram 400f318adb Fix CPU hogging of the midi_thread()
The midi thread was always late after 2^31-1 Samples (~13.5h at 44.1kHz), because when there's no time limit, a uint64_t sample counter was compared against a signed 32bit INT_MAX to determine lateness. Now the CPU lockup will occur only after ~3 million years (at 192kHz), and because of the overflow it will presumably fix itself after a few milliseconds.
2015-10-27 10:06:26 +01:00
Markus Seeber e1935e630e increase size of array to fit initializer string
- fixed compiler warning
- fixed possible cropping of output
2014-12-15 19:06:29 +01:00