snapcast icon indicating copy to clipboard operation
snapcast copied to clipboard

Support for ALSA floating point samples?

Open dustin-richards-was-here opened this issue 7 months ago • 0 comments

Is your feature request related to a problem? Please describe. Attempting to use an ALSA plugin (an equalizer) that doesn't support any sample format other than floating point little endian, at least that's my interpretation of this snapclient log snippet after skimming the source.

2023-11-22 23-14-59.825 [Info] (Player) Player name: alsa, device: plugequal, description: <none>, idx: 8, sharing mode: unspecified, parameters: <none>
2023-11-22 23-14-59.825 [Info] (Player) Mixer mode: software, parameters: <none>
2023-11-22 23-14-59.825 [Info] (Player) Sampleformat: 44100:16:2, stream: 44100:16:2
2023-11-22 23-14-59.825 [Info] (Alsa) Using default buffer_time: 80 ms, default fragments: 4
2023-11-22 23-15-00.101 [Error] (Alsa) Exception: Can't set format: Invalid argument, supported: FLOAT_LE , code: 0
2023-11-22 23-15-00.102 [Fatal] (Snapclient) Exception: Can't set format: Invalid argument, supported: FLOAT_LE 
2023-11-22 23-15-00.102 [Notice] (Snapclient) Snapclient terminated.

Describe the solution you'd like Add support for floating point ALSA PCM sample types SND_PCM_FORMAT_FLOAT_LE, SND_PCM_FORMAT_FLOAT_BE, SND_PCM_FORMAT_FLOAT64_LE, and SND_PCM_FORMAT_FLOAT64_BE. Enum is here in the ALSA docs.

Describe alternatives you've considered Alternate solution is attempt to get support for ALSA integer types into alsaequal, but the project seems like it hasn't been touched in a while and it seems like a decent goal (in my possibly naive opinion) for snapclient to be highly compatible.

Additional context I am willing to work on this!