mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
spa: alsa: autodetect supported iec958 codecs via ELD info
The alsa/acp code already supports getting a user-friendly monitor name
using the EDID-Like Data (ELD) information available from cards that follow
the Intel HDA specification.
This patch adds support for also parsing the SAD fields of the ELD, and
exposing the results as a "iec958.codecs.detected" property on the
corresponding node, which should make it possible to provide more
user-friendly configuration UIs and defaults.
The default value will take effect if the session manager does not set a
different value.
Brief example:
test@test:~/checkouts/pipewire$ pw-dump | grep -E "(iec958.codecs.detected|iec958.codecs)\":"
"iec958.codecs": "[\"PCM\",\"AC3\",\"EAC3\",\"TrueHD\"]",
"iec958.codecs.detected": "[\"PCM\",\"AC3\",\"EAC3\",\"TrueHD\"]",
<after powering on my receiver>
test@test:~/checkouts/pipewire$ pw-dump | grep -E "(iec958.codecs.detected|iec958.codecs)\":"
"iec958.codecs": "[\"PCM\",\"DTS\",\"AC3\",\"EAC3\",\"TrueHD\",\"DTS-HD\"]",
"iec958.codecs.detected": "[\"PCM\",\"DTS\",\"AC3\",\"EAC3\",\"TrueHD\",\"DTS-HD\"]",
Big thanks to Pauli Virtanen <pav@iki.fi>, who also wrote large paths of the
code for this patch.
This commit is contained in:
parent
0570d1dd00
commit
f33e1bc8c3
5 changed files with 144 additions and 6 deletions
|
|
@ -148,6 +148,12 @@ const char *acp_available_str(enum acp_available status);
|
|||
* like an ALSA control name, but applications must not assume any such relationship.
|
||||
* The group naming scheme can change without a warning.
|
||||
*/
|
||||
#define ACP_KEY_IEC958_CODECS_DETECTED "iec958.codecs.detected"
|
||||
/**< A list of IEC958 passthrough formats which have been auto-detected as being
|
||||
* supported by a given node. This only serves as a hint, as the auto-detected
|
||||
* values may be incorrect and/or might change, e.g. when external devices such
|
||||
* as receivers are powered on or off.
|
||||
*/
|
||||
|
||||
struct acp_device;
|
||||
|
||||
|
|
@ -294,6 +300,9 @@ typedef void (*acp_log_func) (void *data,
|
|||
void acp_set_log_func(acp_log_func, void *data);
|
||||
void acp_set_log_level(int level);
|
||||
|
||||
void acp_iec958_codecs_to_json(const uint32_t *codecs, size_t n_codecs, char *buf, size_t maxsize);
|
||||
size_t acp_iec958_codecs_from_json(const char *str, uint32_t *codecs, size_t max_codecs);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue