quiniouben / vban

VBAN protocol open-source implementation
GNU General Public License v3.0
450 stars 63 forks source link

receptor at 24 bit #23

Open pistamek opened 5 years ago

pistamek commented 5 years ago

Hi,

16 bit 48000 kHz from windows to linux receptor works fine, but when switching to 24 bit, vban_receptor exists with:

Info: audio_set_stream_config: new stream config is nb channels 2, sample rate 48000, bit_fmt 24I
ALSA lib pcm.c:8382:(snd_pcm_set_params) Sample format not available for PLAYBACK: Invalid argument
Error: alsa_open: set_params error: Invalid argument

isn't 24 bit supported?

thanks a lot!

pistamek commented 5 years ago

Made a little progress by setting the card to alsa default card.

vban_receptor can switch to 24i format, but sound turns into a loud hiss. and log shows:

Info: audio_set_stream_config: new stream config is nb channels 2, sample rate 48000, bit_fmt 24I
Error: alsa_write: snd_pcm_writei failed: Broken pipe
ALSA lib pcm.c:8306:(snd_pcm_recover) underrun occurred
quiniouben commented 5 years ago

Hi, thank you for reporting. @pistamek: Can you give a little more info:

This below basically means what it says: the output doesn't support 24 bits: Info: audio_set_stream_config: new stream config is nb channels 2, sample rate 48000, bit_fmt 24I ALSA lib pcm.c:8382:(snd_pcm_set_params) Sample format not available for PLAYBACK: Invalid argument Error: alsa_open: set_params error: Invalid argument

This, well, some underrun / overrun are to be expected when changing sampling rate or bit format, but audio should resume ok: Info: audio_set_stream_config: new stream config is nb channels 2, sample rate 48000, bit_fmt 24I Error: alsa_write: snd_pcm_writei failed: Broken pipe ALSA lib pcm.c:8306:(snd_pcm_recover) underrun occurred

quiniouben commented 5 years ago

@pistamek: any feedback ?

pistamek commented 5 years ago

Hi,

still working on it. seems a special ALSA configuration is needed to enable 24bit audio because 16 and 32 is supported on raspberry (raspbian OS) by default.

However, 16 bit works fine during my tests, only minor glitches are present on wifi.

24 bit is still my target.. the reason is, this way bit perfect wireless Tidal MQA streaming could be achieved which means ultimate digital quality.. to me (and many others out there).

quiniouben commented 5 years ago

Hi, I am very busy these days. Have you found some way to enable 24bit audio in your setup ? Again, maybe you can give some info about your system: do you use the native audio interface ?

net147 commented 5 years ago

I have same issue. I get noise with default VBAN format of PCM 24 bits from Voicemeeter Banana running on Windows 7.

Here is output from running vban_receptor with loglevel 3:

vban_receptor version 2.1.0

Info: socket_open: opening socket with port 6980 Info: socket_open with port: 6980 Info: audio_init: config is direction out, backend , device , buffer size 3072 Info: audio_backend_get_by_name: taking default backend alsa Info: audio_set_map_config: new map config is nb channels 0 Info: audio_set_stream_config: new stream config is nb channels 2, sample rate 48000, bit_fmt 24I

Changing the VBAN format to PCM 16 bits on the Windows machines makes the sound play properly on Linux.

quiniouben commented 4 years ago

Hi there, still in a very busy year, sorry about that. I don't forget you, let's see if I can try to reproduce at mine. I let you know

pistamek commented 4 years ago

Hey, what an awesome guy you are, haven't forgot! :)

(this year was also busy for me, sorry about that, had no time to deal with wireless audiophile stuff. )

But as far as i remember... The problem was mainly related to my ALSA configuration, which is: on raspberry (which would have been the reciever unit with the USB DAC plugged in to it) only handled 16 or 32bit stream. For 24bit (i'm not sure, but) it converted (pad out the remaining places with zero bits?) to 32 first and then it sends the stream to the DAC, which did not accept it properly. So i think the problem is basically not around vban side (at least i hope), but i failed to recompile ALSA succesfully to handle 24bit properly.

Once i will have opportunity to try out on a native linux desktop with default ALSA, i will get back to you.

For others who reads this: please feel free to try it out: to get ultimate wireless bit perfect Tidal MQA streaming.

pistamek commented 4 years ago

I have same issue. I get noise with default VBAN format of PCM 24 bits from Voicemeeter Banana running on Windows 7.

Here is output from running vban_receptor with loglevel 3:

vban_receptor version 2.1.0 Info: socket_open: opening socket with port 6980 Info: socket_open with port: 6980 Info: audio_init: config is direction out, backend , device , buffer size 3072 Info: audio_backend_get_by_name: taking default backend alsa Info: audio_set_map_config: new map config is nb channels 0 Info: audio_set_stream_config: new stream config is nb channels 2, sample rate 48000, bit_fmt 24I

Changing the VBAN format to PCM 16 bits on the Windows machines makes the sound play properly on Linux.

net147: are you using vban_receptor on a raspberry device?

net147 commented 4 years ago

I am running on Arch Linux x86_64 with pulseaudio on KDE Plasma desktop.

quiniouben commented 4 years ago

Hi,

The problem was mainly related to my ALSA configuration, which is: on raspberry (which would have been the reciever unit with the USB DAC plugged in to it) only handled 16 or 32bit stream. For 24bit (i'm not sure, but) it converted (pad out the remaining places with zero bits?) to 32 first and then it sends the stream to the DAC, which did not accept it properly.

Ok, then it would make sense. I mean I tested 24 bits on my machine with the integrated Intel HDA PCH chip with success. So it makes sense that the trouble occur because of a different behavior / expected encoding of different hardware. If I get it right, you would need an integrated bit format converter ? Thus the source could stream 24 bits and the receiver would convert to 32 bits for your hardware.