-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sndfile-jackplay with more than 16 channels #69
Comments
As a followup : in order to investigate further the problem, I thought I could just suppress 4 channels in the 20 channel file example refered to (using sndfile-deinterleave / sndfile-interleave), in order to demonstrate that sndfile-jackplay could play it without quirks and cracks. But sndfile-deinterleave told me that it could not handle more than 16 channels (also !). Why is this 16 channel limit ? I found where it is hardcoded in sndfile-deinterleave, but unfortunately not in sndfile-jackplay (in fact, this is not hardcoded in this case, but it's unfortunately buggy and I really would like to help finding the problem since this is an important functionnality for me). Best regards, Eric |
Any idea ? Does it have anything to do with the use of #define RB_SIZE (1 << 16) in jackplay.c ? I suspect jackplay outputs zeros because the buffer allocation is not large enough with a large count of channels in 32 bits audio. This should work though since Reaper and Audacity read without problems these files ? I hope you can help with this, do not hesitate to ask me for tests in order to find out what the problem is. Best Regards, Eric |
I really suspect there is a problem with the buffer creation :
Whereas I would think that the ringbuffer creation should not include RB_SIZE but rather something like (number of channels)*(buffer frame length)*sizeof (jack_default_audio_sample_t) , or at least depend on the number of channels in the audio ? When looking at jacktools jack-play.c implementation at https://sources.debian.org/src/jack-tools/20131226-1/jack-play.c/ , their ringbuffer creation at lines 273 -> 278 seems more logical to me, but I'm not a developer ... Hope this helps or creates any interest from the maintainers of sndfile-tools ! Best Regards, Eric |
I have an issue with sndfile-jackplay for 32 bit audio files with more than 16 channels (tested with 20 channels rf64, 36 channels wavex, and 50 channels rf64), which are well handled by audacity, reaper, or ardour.
Jack does not have any xruns, but sndfile-jackplay "cracks" on any of the channels. In order you understand the "cracks" I'm referering to, the sound produced is very similar to a chronometer (like https://www.youtube.com/watch?v=rhEdxtuzaQk ).
Seems the ringbuffer has a problem with this number of channels. Tested with jack buffers at 128, 256, 512,1024,4096 : the cracks always occur, without xruns (but the cracks periodicity seem to be related to the jack buffer : when I set a large jack buffer, the cracks begin to transform to "stop" and "start")
I looked at jackplay.c, and did not find any restriction on the number of channels / or number of bits in the code.
Here is an example of file tested (output of sndfile-info) :
File : drone02.rf64
Length : 2276270184
RF64
WAVE
ds64 : 28
Riff size : 2276270176
Data size : 2276270080
Frames : 28453376
Table length : 0
fmt : 40
Format : 0xFFFE => WAVE_FORMAT_EXTENSIBLE
Channels : 20
Sample Rate : 48000
Block Align : 80
Bit Width : 32
Bytes/sec : 3840000
Valid Bits : 32
Channel Mask : 0x0 (should not be zero)
Subformat
esf_field1 : 0x1
esf_field2 : 0x0
esf_field3 : 0x10
esf_field4 : 0x80 0x0 0x0 0xAA 0x0 0x38 0x9B 0x71
format : pcm
data : 0xFFFFFFFF
End
Sample Rate : 48000
Frames : 28453376
Channels : 20
Format : 0x00220004
Sections : 1
Seekable : TRUE
Duration : 00:09:52.779
Signal Max : 2.85587e+08 (-17.52 dB)
I really hope you will be able to tell me how to fix this as I intended to use sndfile-jackplay with ambisonics recordings, whith a high count of channels.
Best Regards,
Eric
The text was updated successfully, but these errors were encountered: