<div dir="ltr">I see a posssible bug in jackrec. Don't know if this is the cause though:<div><br></div><div><div>diff --git a/example-clients/capture_client.c b/example-clients/capture_client.c</div><div>index d3360b4..da11fd8 100644</div><div>--- a/example-clients/capture_client.c</div><div>+++ b/example-clients/capture_client.c</div><div>@@ -167,7 +167,7 @@ jack_shutdown (void *arg)</div><div> static void</div><div> setup_disk_thread (jack_thread_info_t *info)</div><div> {</div><div>-   SF_INFO sf_info;</div><div>+ SF_INFO sf_info = {0}</div><div>        int short_mask;</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 30, 2018 at 12:35 PM, Christian Affolter <span dir="ltr"><<a href="mailto:c.affolter@purplehaze.ch" target="_blank">c.affolter@purplehaze.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi everyone,<br>
<br>
capturing from ALSA capture devices via the Jack2 sound server (1.9.12),<br>
results in too high pitched wav files (they are playing "too fast" and<br>
sound like the "chipmunks"). If I run the same capture directly from the<br>
ALSA devices (without Jack involved), everything sounds as expected<br>
without any problems.<br>
<br>
Audio examples:<br>
Capture via jackrec: <a href="https://filebin.ca/3pyMxBw8cexQ/test-jackrec.wav" rel="noreferrer" target="_blank">https://filebin.ca/<wbr>3pyMxBw8cexQ/test-jackrec.wav</a><br>
Capture via arecord: <a href="https://filebin.ca/3pyOPjcKGym5/test-arecord.wav" rel="noreferrer" target="_blank">https://filebin.ca/<wbr>3pyOPjcKGym5/test-arecord.wav</a><br>
<br>
The device in question is a "virtual" Axia-ALSA (Livewire+) audio device<br>
on CentOS 7 which operates at a sample rate of 48kHz and a bit depth of<br>
either 16 or 32. As far as I can see, the sample rate and format<br>
detection on the Jack side looks correct. I'm therefore looking for some<br>
guidance on how to further debug this, I most certainly missed something<br>
obvious.<br>
<br>
I've also tried to play an mp3 file via mpg123 over jack (without the<br>
involvement of the Alsa device) and record it again with jackrec. This<br>
works and sounds correct.<br>
<br>
Here is what I've tried and what the environment looks like:<br>
<br>
# Capabilities of the Axia-ALSA device<br>
arecord -D hw:0 --dump-hw-params<br>
<br>
Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono<br>
HW Params of device "hw:0":<br>
--------------------<br>
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED<br>
FORMAT:  S16_LE S32_LE<br>
SUBFORMAT:  STD<br>
SAMPLE_BITS: [16 32]<br>
FRAME_BITS: [16 256]<br>
CHANNELS: [1 8]<br>
RATE: 48000<br>
PERIOD_TIME: (41 1365334)<br>
PERIOD_SIZE: [2 65536]<br>
PERIOD_BYTES: [64 131072]<br>
PERIODS: [1 1024]<br>
BUFFER_TIME: (41 1365334)<br>
BUFFER_SIZE: [2 65536]<br>
BUFFER_BYTES: [64 131072]<br>
TICK_TIME: ALL<br>
--------------------<br>
arecord: set_params:1299: Sample format non available<br>
Available formats:<br>
- S16_LE<br>
- S32_LE<br>
<br>
<br>
# Capture via arecord directly from the ALSA device (without jackd)<br>
# This works as expected and the WAV file sounds fine<br>
arecord -D hw:0 -c 2 -d 10 -r 48000 -f S32_LE -v /tmp/test-arecord.wav<br>
<br>
Recording WAVE '/tmp/test-arecord.wav' : Signed 32 bit Little Endian,<br>
Rate 48000 Hz, Stereo<br>
Hardware PCM card 0 'Axia' device 0 subdevice 0<br>
Its setup is:<br>
  stream       : CAPTURE<br>
  access       : RW_INTERLEAVED<br>
  format       : S32_LE<br>
  subformat    : STD<br>
  channels     : 2<br>
  rate         : 48000<br>
  exact rate   : 48000 (48000/1)<br>
  msbits       : 32<br>
  buffer_size  : 16384<br>
  period_size  : 4096<br>
  period_time  : 85333<br>
  tstamp_mode  : NONE<br>
  tstamp_type  : MONOTONIC<br>
  period_step  : 1<br>
  avail_min    : 4096<br>
  period_event : 0<br>
  start_threshold  : 1<br>
  stop_threshold   : 16384<br>
  silence_threshold: 0<br>
  silence_size : 0<br>
  boundary     : 4611686018427387904<br>
  appl_ptr     : 0<br>
  hw_ptr       : 0<br>
<br>
<br>
# playing arecord wav (via my local notebook's HDA Intel PCH<br>
# device), sounds correct<br>
aplay test-arecord.wav<br>
<br>
Playing WAVE 'test-arecord.wav' : Signed 32 bit Little Endian, Rate<br>
48000 Hz, Stereo<br>
<br>
<br>
<br>
# Starting jackd<br>
# Verbose output at: <a href="https://pastebin.com/YzHEGSnR" rel="noreferrer" target="_blank">https://pastebin.com/YzHEGSnR</a><br>
jackd -d alsa -d hw:0<br>
<br>
jackdmp 1.9.12<br>
Copyright 2001-2005 Paul Davis and others.<br>
Copyright 2004-2016 Grame.<br>
Copyright 2016-2017 Filipe Coelho.<br>
jackdmp comes with ABSOLUTELY NO WARRANTY<br>
This is free software, and you are welcome to redistribute it<br>
under certain conditions; see the file COPYING for details<br>
no message buffer overruns<br>
no message buffer overruns<br>
no message buffer overruns<br>
JACK server starting in realtime mode with priority 20<br>
self-connect-mode is "Don't restrict self connect requests"<br>
audio_reservation_init<br>
Acquire audio card Audio0<br>
creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|<wbr>nomon|swmeter|-|32bit<br>
configuring for 48000Hz, period = 1024 frames (21.3 ms), buffer = 2 periods<br>
ALSA: final selected sample format for capture: 32bit integer little-endian<br>
ALSA: use 2 periods for capture<br>
ALSA: final selected sample format for playback: 32bit integer little-endian<br>
ALSA: use 2 periods for playback<br>
<br>
<br>
# Capture via jackrec<br>
# This results in a too high pitched WAV file<br>
# Verbose output at: <a href="https://pastebin.com/PCnymKLA" rel="noreferrer" target="_blank">https://pastebin.com/PCnymKLA</a><br>
jackrec -f /tmp/test-jackrec.wav -d 10 -b 32 system:capture_1<br>
system:capture_2<br>
<br>
# playing jackrec wav (via my local notebook's HDA Intel PCH<br>
# device), sounds incorrect<br>
aplay test-jackrec.wav<br>
<br>
Playing WAVE 'test-jackrec.wav' : Signed 32 bit Little Endian, Rate<br>
48000 Hz, Stereo<br>
<br>
<br>
System environment:<br>
Distribution: CentOS 7.4.1708<br>
Kernel:       3.10.0-693.17.1.el7.x86_64<br>
ALSA Utils:   1.1.3<br>
Jackd:        1.9.12<br>
<br>
The jackd was rebuilt from Fedora source RPM to be able to test with the<br>
latest version:<br>
<a href="https://build.opensuse.org/package/show/home:radiorabe:audio/jack-audio-connection-kit" rel="noreferrer" target="_blank">https://build.opensuse.org/<wbr>package/show/home:radiorabe:<wbr>audio/jack-audio-connection-<wbr>kit</a><br>
<br>
<br>
Many thanks and best regards<br>
Chris<br>
______________________________<wbr>_________________<br>
Jack-Devel mailing list<br>
<a href="mailto:Jack-Devel@lists.jackaudio.org">Jack-Devel@lists.jackaudio.org</a><br>
<a href="http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org" rel="noreferrer" target="_blank">http://lists.jackaudio.org/<wbr>listinfo.cgi/jack-devel-<wbr>jackaudio.org</a><br>
</blockquote></div><br></div>