[Jack-Devel] Capture problems with jack2 on Axia-Alsa device

classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[Jack-Devel] Capture problems with jack2 on Axia-Alsa device

Christian Affolter
Hi everyone,

capturing from ALSA capture devices via the Jack2 sound server (1.9.12),
results in too high pitched wav files (they are playing "too fast" and
sound like the "chipmunks"). If I run the same capture directly from the
ALSA devices (without Jack involved), everything sounds as expected
without any problems.

Audio examples:
Capture via jackrec: https://filebin.ca/3pyMxBw8cexQ/test-jackrec.wav
Capture via arecord: https://filebin.ca/3pyOPjcKGym5/test-arecord.wav

The device in question is a "virtual" Axia-ALSA (Livewire+) audio device
on CentOS 7 which operates at a sample rate of 48kHz and a bit depth of
either 16 or 32. As far as I can see, the sample rate and format
detection on the Jack side looks correct. I'm therefore looking for some
guidance on how to further debug this, I most certainly missed something
obvious.

I've also tried to play an mp3 file via mpg123 over jack (without the
involvement of the Alsa device) and record it again with jackrec. This
works and sounds correct.

Here is what I've tried and what the environment looks like:

# Capabilities of the Axia-ALSA device
arecord -D hw:0 --dump-hw-params

Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
HW Params of device "hw:0":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S16_LE S32_LE
SUBFORMAT:  STD
SAMPLE_BITS: [16 32]
FRAME_BITS: [16 256]
CHANNELS: [1 8]
RATE: 48000
PERIOD_TIME: (41 1365334)
PERIOD_SIZE: [2 65536]
PERIOD_BYTES: [64 131072]
PERIODS: [1 1024]
BUFFER_TIME: (41 1365334)
BUFFER_SIZE: [2 65536]
BUFFER_BYTES: [64 131072]
TICK_TIME: ALL
--------------------
arecord: set_params:1299: Sample format non available
Available formats:
- S16_LE
- S32_LE


# Capture via arecord directly from the ALSA device (without jackd)
# This works as expected and the WAV file sounds fine
arecord -D hw:0 -c 2 -d 10 -r 48000 -f S32_LE -v /tmp/test-arecord.wav

Recording WAVE '/tmp/test-arecord.wav' : Signed 32 bit Little Endian,
Rate 48000 Hz, Stereo
Hardware PCM card 0 'Axia' device 0 subdevice 0
Its setup is:
  stream       : CAPTURE
  access       : RW_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 4096
  period_time  : 85333
  tstamp_mode  : NONE
  tstamp_type  : MONOTONIC
  period_step  : 1
  avail_min    : 4096
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
  appl_ptr     : 0
  hw_ptr       : 0


# playing arecord wav (via my local notebook's HDA Intel PCH
# device), sounds correct
aplay test-arecord.wav

Playing WAVE 'test-arecord.wav' : Signed 32 bit Little Endian, Rate
48000 Hz, Stereo



# Starting jackd
# Verbose output at: https://pastebin.com/YzHEGSnR
jackd -d alsa -d hw:0

jackdmp 1.9.12
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2017 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
no message buffer overruns
no message buffer overruns
no message buffer overruns
JACK server starting in realtime mode with priority 20
self-connect-mode is "Don't restrict self connect requests"
audio_reservation_init
Acquire audio card Audio0
creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit
configuring for 48000Hz, period = 1024 frames (21.3 ms), buffer = 2 periods
ALSA: final selected sample format for capture: 32bit integer little-endian
ALSA: use 2 periods for capture
ALSA: final selected sample format for playback: 32bit integer little-endian
ALSA: use 2 periods for playback


# Capture via jackrec
# This results in a too high pitched WAV file
# Verbose output at: https://pastebin.com/PCnymKLA
jackrec -f /tmp/test-jackrec.wav -d 10 -b 32 system:capture_1
system:capture_2

# playing jackrec wav (via my local notebook's HDA Intel PCH
# device), sounds incorrect
aplay test-jackrec.wav

Playing WAVE 'test-jackrec.wav' : Signed 32 bit Little Endian, Rate
48000 Hz, Stereo


System environment:
Distribution: CentOS 7.4.1708
Kernel:       3.10.0-693.17.1.el7.x86_64
ALSA Utils:   1.1.3
Jackd:        1.9.12

The jackd was rebuilt from Fedora source RPM to be able to test with the
latest version:
https://build.opensuse.org/package/show/home:radiorabe:audio/jack-audio-connection-kit


Many thanks and best regards
Chris
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Capture problems with jack2 on Axia-Alsa device

Thomas Brand

Hi Chris,

this sounds like a SR mismatch but it's not obvious.

before you debug more, can you try to record with
https://github.com/kmatheussen/jack_capture ?

A simple test is to connect system:capture to system:playback and see if
you get what's expected on your headphone/speakers. You can then go on to
see if jack_capture solves the issue for you.

Greetings
Thomas

On Tue, January 30, 2018 12:35, Christian Affolter wrote:

> Hi everyone,
>
>
> capturing from ALSA capture devices via the Jack2 sound server (1.9.12),
> results in too high pitched wav files (they are playing "too fast" and
> sound like the "chipmunks"). If I run the same capture directly from the
> ALSA devices (without Jack involved), everything sounds as expected
> without any problems.
>
> Audio examples:
> Capture via jackrec: https://filebin.ca/3pyMxBw8cexQ/test-jackrec.wav
> Capture via arecord: https://filebin.ca/3pyOPjcKGym5/test-arecord.wav
>
>
> The device in question is a "virtual" Axia-ALSA (Livewire+) audio device
> on CentOS 7 which operates at a sample rate of 48kHz and a bit depth of
> either 16 or 32. As far as I can see, the sample rate and format detection
> on the Jack side looks correct. I'm therefore looking for some guidance on
> how to further debug this, I most certainly missed something obvious.
>
> I've also tried to play an mp3 file via mpg123 over jack (without the
> involvement of the Alsa device) and record it again with jackrec. This
> works and sounds correct.
>
> Here is what I've tried and what the environment looks like:
>
>
> # Capabilities of the Axia-ALSA device
> arecord -D hw:0 --dump-hw-params
>
> Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
> HW Params of device "hw:0":
> --------------------
> ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
> FORMAT:  S16_LE S32_LE
> SUBFORMAT:  STD
> SAMPLE_BITS: [16 32]
> FRAME_BITS: [16 256]
> CHANNELS: [1 8]
> RATE: 48000
> PERIOD_TIME: (41 1365334)
> PERIOD_SIZE: [2 65536]
> PERIOD_BYTES: [64 131072]
> PERIODS: [1 1024]
> BUFFER_TIME: (41 1365334)
> BUFFER_SIZE: [2 65536]
> BUFFER_BYTES: [64 131072]
> TICK_TIME: ALL
> --------------------
> arecord: set_params:1299: Sample format non available
> Available formats:
> - S16_LE
> - S32_LE
>
>
>
> # Capture via arecord directly from the ALSA device (without jackd)
> # This works as expected and the WAV file sounds fine
> arecord -D hw:0 -c 2 -d 10 -r 48000 -f S32_LE -v /tmp/test-arecord.wav
>
> Recording WAVE '/tmp/test-arecord.wav' : Signed 32 bit Little Endian,
> Rate 48000 Hz, Stereo
> Hardware PCM card 0 'Axia' device 0 subdevice 0
> Its setup is:
> stream       : CAPTURE access       : RW_INTERLEAVED format       : S32_LE
> subformat    : STD channels     : 2 rate         : 48000 exact rate   :
> 48000 (48000/1)
> msbits       : 32 buffer_size  : 16384 period_size  : 4096 period_time  :
> 85333
> tstamp_mode  : NONE tstamp_type  : MONOTONIC period_step  : 1 avail_min
  :

> 4096
> period_event : 0 start_threshold  : 1 stop_threshold   : 16384
> silence_threshold: 0
> silence_size : 0 boundary     : 4611686018427387904 appl_ptr     : 0 hw_ptr
> : 0
>
>
>
> # playing arecord wav (via my local notebook's HDA Intel PCH
> # device), sounds correct
> aplay test-arecord.wav
>
> Playing WAVE 'test-arecord.wav' : Signed 32 bit Little Endian, Rate
> 48000 Hz, Stereo
>
>
>
>
> # Starting jackd
> # Verbose output at: https://pastebin.com/YzHEGSnR
> jackd -d alsa -d hw:0
>
> jackdmp 1.9.12 Copyright 2001-2005 Paul Davis and others.
> Copyright 2004-2016 Grame.
> Copyright 2016-2017 Filipe Coelho.
> jackdmp comes with ABSOLUTELY NO WARRANTY This is free software, and you
> are welcome to redistribute it under certain conditions; see the file
> COPYING for details
> no message buffer overruns no message buffer overruns no message buffer
> overruns JACK server starting in realtime mode with priority 20
> self-connect-mode is "Don't restrict self connect requests"
> audio_reservation_init Acquire audio card Audio0
> creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit
> configuring for 48000Hz, period = 1024 frames (21.3 ms), buffer = 2
> periods ALSA: final selected sample format for capture: 32bit integer
> little-endian ALSA: use 2 periods for capture
> ALSA: final selected sample format for playback: 32bit integer
> little-endian ALSA: use 2 periods for playback
>
>
>
> # Capture via jackrec
> # This results in a too high pitched WAV file
> # Verbose output at: https://pastebin.com/PCnymKLA
> jackrec -f /tmp/test-jackrec.wav -d 10 -b 32 system:capture_1
> system:capture_2
>
>
> # playing jackrec wav (via my local notebook's HDA Intel PCH
> # device), sounds incorrect
> aplay test-jackrec.wav
>
> Playing WAVE 'test-jackrec.wav' : Signed 32 bit Little Endian, Rate
> 48000 Hz, Stereo
>
>
>
> System environment:
> Distribution: CentOS 7.4.1708
> Kernel:       3.10.0-693.17.1.el7.x86_64
> ALSA Utils:   1.1.3
> Jackd:        1.9.12
>
>
> The jackd was rebuilt from Fedora source RPM to be able to test with the
> latest version:
> https://build.opensuse.org/package/show/home:radiorabe:audio/jack-audio-c
> onnection-kit
>
>
> Many thanks and best regards
> Chris
> _______________________________________________
> Jack-Devel mailing list
> [hidden email]
> http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
>
>


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Capture problems with jack2 on Axia-Alsa device

Kjetil Matheussen-2
In reply to this post by Christian Affolter
I see a posssible bug in jackrec. Don't know if this is the cause though:

diff --git a/example-clients/capture_client.c b/example-clients/capture_client.c
index d3360b4..da11fd8 100644
--- a/example-clients/capture_client.c
+++ b/example-clients/capture_client.c
@@ -167,7 +167,7 @@ jack_shutdown (void *arg)
 static void
 setup_disk_thread (jack_thread_info_t *info)
 {
-   SF_INFO sf_info;
+ SF_INFO sf_info = {0}
        int short_mask;


On Tue, Jan 30, 2018 at 12:35 PM, Christian Affolter <[hidden email]> wrote:
Hi everyone,

capturing from ALSA capture devices via the Jack2 sound server (1.9.12),
results in too high pitched wav files (they are playing "too fast" and
sound like the "chipmunks"). If I run the same capture directly from the
ALSA devices (without Jack involved), everything sounds as expected
without any problems.

Audio examples:
Capture via jackrec: https://filebin.ca/3pyMxBw8cexQ/test-jackrec.wav
Capture via arecord: https://filebin.ca/3pyOPjcKGym5/test-arecord.wav

The device in question is a "virtual" Axia-ALSA (Livewire+) audio device
on CentOS 7 which operates at a sample rate of 48kHz and a bit depth of
either 16 or 32. As far as I can see, the sample rate and format
detection on the Jack side looks correct. I'm therefore looking for some
guidance on how to further debug this, I most certainly missed something
obvious.

I've also tried to play an mp3 file via mpg123 over jack (without the
involvement of the Alsa device) and record it again with jackrec. This
works and sounds correct.

Here is what I've tried and what the environment looks like:

# Capabilities of the Axia-ALSA device
arecord -D hw:0 --dump-hw-params

Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
HW Params of device "hw:0":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S16_LE S32_LE
SUBFORMAT:  STD
SAMPLE_BITS: [16 32]
FRAME_BITS: [16 256]
CHANNELS: [1 8]
RATE: 48000
PERIOD_TIME: (41 1365334)
PERIOD_SIZE: [2 65536]
PERIOD_BYTES: [64 131072]
PERIODS: [1 1024]
BUFFER_TIME: (41 1365334)
BUFFER_SIZE: [2 65536]
BUFFER_BYTES: [64 131072]
TICK_TIME: ALL
--------------------
arecord: set_params:1299: Sample format non available
Available formats:
- S16_LE
- S32_LE


# Capture via arecord directly from the ALSA device (without jackd)
# This works as expected and the WAV file sounds fine
arecord -D hw:0 -c 2 -d 10 -r 48000 -f S32_LE -v /tmp/test-arecord.wav

Recording WAVE '/tmp/test-arecord.wav' : Signed 32 bit Little Endian,
Rate 48000 Hz, Stereo
Hardware PCM card 0 'Axia' device 0 subdevice 0
Its setup is:
  stream       : CAPTURE
  access       : RW_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 16384
  period_size  : 4096
  period_time  : 85333
  tstamp_mode  : NONE
  tstamp_type  : MONOTONIC
  period_step  : 1
  avail_min    : 4096
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 16384
  silence_threshold: 0
  silence_size : 0
  boundary     : 4611686018427387904
  appl_ptr     : 0
  hw_ptr       : 0


# playing arecord wav (via my local notebook's HDA Intel PCH
# device), sounds correct
aplay test-arecord.wav

Playing WAVE 'test-arecord.wav' : Signed 32 bit Little Endian, Rate
48000 Hz, Stereo



# Starting jackd
# Verbose output at: https://pastebin.com/YzHEGSnR
jackd -d alsa -d hw:0

jackdmp 1.9.12
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2017 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
no message buffer overruns
no message buffer overruns
no message buffer overruns
JACK server starting in realtime mode with priority 20
self-connect-mode is "Don't restrict self connect requests"
audio_reservation_init
Acquire audio card Audio0
creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit
configuring for 48000Hz, period = 1024 frames (21.3 ms), buffer = 2 periods
ALSA: final selected sample format for capture: 32bit integer little-endian
ALSA: use 2 periods for capture
ALSA: final selected sample format for playback: 32bit integer little-endian
ALSA: use 2 periods for playback


# Capture via jackrec
# This results in a too high pitched WAV file
# Verbose output at: https://pastebin.com/PCnymKLA
jackrec -f /tmp/test-jackrec.wav -d 10 -b 32 system:capture_1
system:capture_2

# playing jackrec wav (via my local notebook's HDA Intel PCH
# device), sounds incorrect
aplay test-jackrec.wav

Playing WAVE 'test-jackrec.wav' : Signed 32 bit Little Endian, Rate
48000 Hz, Stereo


System environment:
Distribution: CentOS 7.4.1708
Kernel:       3.10.0-693.17.1.el7.x86_64
ALSA Utils:   1.1.3
Jackd:        1.9.12

The jackd was rebuilt from Fedora source RPM to be able to test with the
latest version:
https://build.opensuse.org/package/show/home:radiorabe:audio/jack-audio-connection-kit


Many thanks and best regards
Chris
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Capture problems with jack2 on Axia-Alsa device

Christian Affolter
In reply to this post by Thomas Brand
Hi Thomas,

thanks for your reply.

On 30.01.2018 13:09, Thomas Brand wrote:
>
> Hi Chris,
>
> this sounds like a SR mismatch but it's not obvious.

Yes, most likely.


> before you debug more, can you try to record with
> https://github.com/kmatheussen/jack_capture ?

This results in the same issue. I've started jack_capture with the
following parameters:

jack_capture -b 32 -c 2 -d 10 -fn /tmp/test-jack_capture.wav \
             -p system:capture_1 \
             -p system:capture_2

The resulting file:
https://filebin.ca/3pykjU8lo2jO/test-jack_capture.wav


> A simple test is to connect system:capture to system:playback and see if
> you get what's expected on your headphone/speakers.

Yes, but unfortunately it's a virtual device running on a headless
server without any speakers attached. The playout would go into the
Livewire+ network where I would have to re-capture it from another system.

> You can then go on to
> see if jack_capture solves the issue for you.
>
> Greetings
> Thomas

Thanks,
Chris

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

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Capture problems with jack2 on Axia-Alsa device

Thomas Brand
On Tue, January 30, 2018 13:37, Christian Affolter wrote:

> Hi Thomas,
>
>
> thanks for your reply.
>
> On 30.01.2018 13:09, Thomas Brand wrote:
>
>>
>> Hi Chris,
>>
>>
>> this sounds like a SR mismatch but it's not obvious.
>
> Yes, most likely.
>
>
>
>> before you debug more, can you try to record with
>> https://github.com/kmatheussen/jack_capture ?
>>
>
> This results in the same issue. I've started jack_capture with the
> following parameters:
>
> jack_capture -b 32 -c 2 -d 10 -fn /tmp/test-jack_capture.wav \ -p
> system:capture_1 \
> -p system:capture_2
>
>
> The resulting file:
> https://filebin.ca/3pykjU8lo2jO/test-jack_capture.wav
>
>
>
>> A simple test is to connect system:capture to system:playback and see
>> if you get what's expected on your headphone/speakers.
>
> Yes, but unfortunately it's a virtual device running on a headless
> server without any speakers attached. The playout would go into the
> Livewire+ network where I would have to re-capture it from another
> system.
>

you can try to run jack with --verbose, maybe it gives another hint.
you can run jack_bufsize to be absolutely sure it runs at the correct SR.
you can play a file in jack, record that and see if it's ok. if that's the
case, most probably jack is running ok.
the alsa device could be the issue. you could try to start a dummy jack
and add the alsa device with alsa_in to see if it makes a difference.
also make sure that you use a vanilla jack (git clone
https://github.com/jackaudio/jack2/) to rule out any other side-effect.


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


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Capture problems with jack2 on Axia-Alsa device

Chris Caudle
In reply to this post by Christian Affolter
Here is a hypothesis:  the record software does not correctly handle 32
bits per sample, and stores it as 16 bits per sample at double the rate.

I have tried converting the file with sndfile-convert to 16 and 24 bit
formats, that did not correct the behavior.  Maybe I can force some
conversion with SoX.  I'll play around with it when I get time to see if
that gives some better idea of what is wrong.

--
Chris Caudle



_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Capture problems with jack2 on Axia-Alsa device

Thomas Brand

I think it's not the recording software.
I speculate that the ALSA device is showing the correct information but
indeed delivering something else.
As far as I can see, the driver is closed source. Bump.
Strange that it works with ALSA directly though.

On Tue, January 30, 2018 15:38, Chris Caudle wrote:

> Here is a hypothesis:  the record software does not correctly handle 32
> bits per sample, and stores it as 16 bits per sample at double the rate.
>
> I have tried converting the file with sndfile-convert to 16 and 24 bit
> formats, that did not correct the behavior.  Maybe I can force some
> conversion with SoX.  I'll play around with it when I get time to see if
> that gives some better idea of what is wrong.
>
> --
> Chris Caudle
>
>
>
>
> _______________________________________________
> Jack-Devel mailing list
> [hidden email]
> http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
>
>


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Capture problems with jack2 on Axia-Alsa device

Kjetil Matheussen-2
In reply to this post by Christian Affolter


On Tue, Jan 30, 2018 at 1:37 PM, Christian Affolter <[hidden email]> wrote:
Hi Thomas,

thanks for your reply.

On 30.01.2018 13:09, Thomas Brand wrote:
>
> Hi Chris,
>
> this sounds like a SR mismatch but it's not obvious.

Yes, most likely.


> before you debug more, can you try to record with
> https://github.com/kmatheussen/jack_capture ?

This results in the same issue. I've started jack_capture with the
following parameters:

jack_capture -b 32 -c 2 -d 10 -fn /tmp/test-jack_capture.wav \
             -p system:capture_1 \
             -p system:capture_2

The resulting file:
https://filebin.ca/3pykjU8lo2jO/test-jack_capture.wav


Can you try this?

jack_capture -d 10 -mp3  /tmp/test-jack_capture.mp3 -p system:capture_1 -p system:capture_2

and (if it worked) this?

jack_capture -d 10 -f ogg  /tmp/test-jack_capture.mp3 -p system:capture_1 -p system:capture_2


If it worked to create mp3, we know that it's got something to do with using sndfile.
If it worked to create ogg, we know that it's got something to do with creating wav files with sndfile.


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Capture problems with jack2 on Axia-Alsa device

Kjetil Matheussen-2


On Tue, Jan 30, 2018 at 3:46 PM, Kjetil Matheussen <[hidden email]> wrote:


On Tue, Jan 30, 2018 at 1:37 PM, Christian Affolter <[hidden email]> wrote:
Hi Thomas,

thanks for your reply.

On 30.01.2018 13:09, Thomas Brand wrote:
>
> Hi Chris,
>
> this sounds like a SR mismatch but it's not obvious.

Yes, most likely.


> before you debug more, can you try to record with
> https://github.com/kmatheussen/jack_capture ?

This results in the same issue. I've started jack_capture with the
following parameters:

jack_capture -b 32 -c 2 -d 10 -fn /tmp/test-jack_capture.wav \
             -p system:capture_1 \
             -p system:capture_2

The resulting file:
https://filebin.ca/3pykjU8lo2jO/test-jack_capture.wav


Can you try this?

jack_capture -d 10 -mp3  /tmp/test-jack_capture.mp3 -p system:capture_1 -p system:capture_2

and (if it worked) this?

jack_capture -d 10 -f ogg  /tmp/test-jack_capture.mp3 -p system:capture_1 -p system:capture_2



Sorry, errors in the commands.

To create mp3:
jack_capture -d 10 -mp3 -p system:capture_1 -p system:capture_2 /tmp/test-jack_capture.mp3 

To create ogg:
jack_capture -d 10 -f ogg  -p system:capture_1 -p system:capture_2 /tmp/test-jack_capture.ogg




_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Capture problems with jack2 on Axia-Alsa device

Christian Affolter
In reply to this post by Thomas Brand
Hi Thomas,

On 30.01.2018 14:05, Thomas Brand wrote:

>>> this sounds like a SR mismatch but it's not obvious.
>>
>> Yes, most likely.
>>
>>
>>
>>> before you debug more, can you try to record with
>>> https://github.com/kmatheussen/jack_capture ?
>>>
>>
>> This results in the same issue. I've started jack_capture with the
>> following parameters:
>>
>> jack_capture -b 32 -c 2 -d 10 -fn /tmp/test-jack_capture.wav \ -p
>> system:capture_1 \
>> -p system:capture_2
>>
>>
>> The resulting file:
>> https://filebin.ca/3pykjU8lo2jO/test-jack_capture.wav
>>
>>
>>
>>> A simple test is to connect system:capture to system:playback and see
>>> if you get what's expected on your headphone/speakers.
>>
>> Yes, but unfortunately it's a virtual device running on a headless
>> server without any speakers attached. The playout would go into the
>> Livewire+ network where I would have to re-capture it from another
>> system.
>>
>
> you can try to run jack with --verbose, maybe it gives another hint.

I did that already, see the pastbin links below:

>>>>> # Starting jackd
>>>>> # Verbose output at: https://pastebin.com/YzHEGSnR
>>>>> jackd -d alsa -d hw:0

>>>>>> # Capture via jackrec
>>>>>> # This results in a too high pitched WAV file
>>>>>> # Verbose output at: https://pastebin.com/PCnymKLA



> you can run jack_bufsize to be absolutely sure it runs at the correct SR.

jack_bufsize
buffer size = 1024  sample rate = 48000


> you can play a file in jack, record that and see if it's ok. if that's the
> case, most probably jack is running ok.

I did that with mpg123, which works correctly (see below)

>>>>> I've also tried to play an mp3 file via mpg123 over jack (without the
>>>>> involvement of the Alsa device) and record it again with jackrec.
>>>>> This works and sounds correct.


> the alsa device could be the issue. you could try to start a dummy jack
> and add the alsa device with alsa_in to see if it makes a difference.
> also make sure that you use a vanilla jack (git clone
> https://github.com/jackaudio/jack2/) to rule out any other side-effect.

OK, I will compile from source later an re-run the captures.


Thanks again
Chris

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

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Capture problems with jack2 on Axia-Alsa device

Thomas Brand
In reply to this post by Kjetil Matheussen-2
On Tue, January 30, 2018 15:48, Kjetil Matheussen wrote:

> To create mp3:
> jack_capture -d 10 -mp3 -p system:capture_1 -p system:capture_2
> /tmp/test-jack_capture.mp3
>
>
> To create ogg:
> jack_capture -d 10 -f ogg  -p system:capture_1 -p system:capture_2
> /tmp/test-jack_capture.ogg

interesting approach, leaving out libsndfile...  it just came to mind that
jack_capture also has the --write-to-stdout option so one could inspect
raw data.

funnily enough, if the file is played at 12kHz it sounds lo-fi but ok. 12k
is 1/4 of 48k. there is somewhere a factor 4 where it shouldn't be ~


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Capture problems with jack2 on Axia-Alsa device

Christian Affolter
In reply to this post by Kjetil Matheussen-2
On 30.01.2018 15:48, Kjetil Matheussen wrote:

>         > before you debug more, can you try to record with
>         > https://github.com/kmatheussen/jack_capture
>         <https://github.com/kmatheussen/jack_capture> ?
>
>         This results in the same issue. I've started jack_capture with the
>         following parameters:
>
>         jack_capture -b 32 -c 2 -d 10 -fn /tmp/test-jack_capture.wav \
>                      -p system:capture_1 \
>                      -p system:capture_2
>
>         The resulting file:
>         https://filebin.ca/3pykjU8lo2jO/test-jack_capture.wav
>         <https://filebin.ca/3pykjU8lo2jO/test-jack_capture.wav>
>
>
>     Can you try this?
>
>     jack_capture -d 10 -mp3  /tmp/test-jack_capture.mp3 -p
>     system:capture_1 -p system:capture_2
>
>     and (if it worked) this?
>
>     jack_capture -d 10 -f ogg  /tmp/test-jack_capture.mp3 -p
>     system:capture_1 -p system:capture_2
>
>
>
> Sorry, errors in the commands.
>
> To create mp3:
> jack_capture -d 10 -mp3 -p system:capture_1 -p system:capture_2
> /tmp/test-jack_capture.mp3 
>
> To create ogg:
> jack_capture -d 10 -f ogg  -p system:capture_1 -p system:capture_2
> /tmp/test-jack_capture.ogg

I've tried that. Both, the mp3 and the ogg file have the same issue.

Thanks,
Chris

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Capture problems with jack2 on Axia-Alsa device

Thomas Brand
In reply to this post by Christian Affolter
On Tue, January 30, 2018 16:23, Christian Affolter wrote:
> Hi Thomas,
>
>>> Yes, but unfortunately it's a virtual device running on a headless
>>> server without any speakers attached. The playout would go into the
>>> Livewire+ network where I would have to re-capture it from another
>>> system.

If you try that it will help to rule out to be an issue of any jack client.

>>
>> you can try to run jack with --verbose, maybe it gives another hint.
>
> I did that already, see the pastbin links below:
>
>
>>>>>> # Starting jackd
>>>>>> # Verbose output at: https://pastebin.com/YzHEGSnR
>>>>>> jackd -d alsa -d hw:0
>
>>>>>>> # Capture via jackrec
>>>>>>> # This results in a too high pitched WAV file
>>>>>>> # Verbose output at: https://pastebin.com/PCnymKLA
>>>>>>>

this looks normal so far ..

>
>
>
>> you can run jack_bufsize to be absolutely sure it runs at the correct
>> SR.
>>
>
> jack_bufsize buffer size = 1024  sample rate = 48000
>

as expected ..


>> the alsa device could be the issue. you could try to start a dummy jack
>>  and add the alsa device with alsa_in to see if it makes a difference.
>> also make sure that you use a vanilla jack (git clone
>> https://github.com/jackaudio/jack2/) to rule out any other side-effect.
>>
>
> OK, I will compile from source later an re-run the captures.
>
>
>
> Thanks again
> Chris
>


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Capture problems with jack2 on Axia-Alsa device

Christian Affolter
In reply to this post by Christian Affolter
On 30.01.2018 16:23, Christian Affolter wrote:
>> the alsa device could be the issue. you could try to start a dummy jack
>> and add the alsa device with alsa_in to see if it makes a difference.
>> also make sure that you use a vanilla jack (git clone
>> https://github.com/jackaudio/jack2/) to rule out any other side-effect.
>
> OK, I will compile from source later an re-run the captures.

Just a short update: I've built and run jack2 from Git master (a5e6585)
and face the same issue.

Regards,
Chris

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Capture problems with jack2 on Axia-Alsa device

Christian Affolter
Hi Thomas,

On 30.01.2018 18:15, Christian Affolter wrote:
> On 30.01.2018 16:23, Christian Affolter wrote:
>>> the alsa device could be the issue. you could try to start a dummy jack
>>> and add the alsa device with alsa_in to see if it makes a difference.

This seems to work, the audio gets captured (and can be played)
correctly. Here is what I did:

# Start jackd with the dummy backend
jackd -d dummy

# Add the alsa device via alsa_in
alsa_in -d hw:0 -c 2


# Capture via jack_capture
jack_capture -b 32 -c 2 -d 10 -fn /tmp/test-jack_capture.wav \
             -p alsa_in:capture_1 -p alsa_in:capture_2

# Capture via jackrec
jackrec -f /tmp/test-jackrec.wav -d 10 -b 32 alsa_in:capture_1
alsa_in:capture_2


What I also observed is the fact, that capturing 10 seconds
(jack_capture -d 10 ...) directly from the "-d alsa" jackd takes around
40 seconds (real 0m40.457s) vs. 10 seconds (as one would expect) with
the "-d dummy" jackd (real 0m10.339s)

So I guess we're one step closer.


Thanks a lot for your help
Chris
_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Capture problems with jack2 on Axia-Alsa device

Chris Caudle
On Tue, January 30, 2018 12:46 pm, Christian Affolter wrote:
> What I also observed is the fact, that capturing 10 seconds
> (jack_capture -d 10 ...) directly from the "-d alsa" jackd takes around
> 40 seconds (real 0m40.457s) vs. 10 seconds (as one would expect) with
> the "-d dummy" jackd (real 0m10.339s)

That is very strange, the test-arecord.wav and test-jack_capture.wav files
are the same size, the file captured with jack is not 4 times larger.

Does that CentOS machine have any attached audio hardware?  If so you
could use the alsa_out plugin to play the captured audio, for example
through a USB audio interface, and if that audio path is OK maybe just
jack_rec or jack_capture is causing the problem.  I'm not sure what other
capture programs can run headless and capture from jack, NAMA perhaps?
Actually I just checked and NAMA uses ecasound as the backend, just use
ecasound directly, it has jack support.

How did you get the file to play back at 12kHz?  Could you tell if it was
really distorted like the capture was mis-packing the original data,
taking a 32 bit input word, putting just 16 bits of that into the first
half of a 32 bit word...that only accounts for 2x time, not 4x, and is
really a stretch, I don't see how an error that egregious could slip
through jack or jack_capture.  Very strange.

--
Chris Caudle


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Capture problems with jack2 on Axia-Alsa device

Kjetil Matheussen-2


On Tue, Jan 30, 2018 at 8:35 PM, Chris Caudle <[hidden email]> wrote:
On Tue, January 30, 2018 12:46 pm, Christian Affolter wrote:
> What I also observed is the fact, that capturing 10 seconds
> (jack_capture -d 10 ...) directly from the "-d alsa" jackd takes around
> 40 seconds (real 0m40.457s) vs. 10 seconds (as one would expect) with
> the "-d dummy" jackd (real 0m10.339s)

That is very strange, the test-arecord.wav and test-jack_capture.wav files
are the same size, the file captured with jack is not 4 times larger.

Does that CentOS machine have any attached audio hardware?  If so you
could use the alsa_out plugin to play the captured audio, for example
through a USB audio interface, and if that audio path is OK maybe just
jack_rec or jack_capture is causing the problem.  I'm not sure what other
capture programs can run headless and capture from jack, NAMA perhaps?
Actually I just checked and NAMA uses ecasound as the backend, just use
ecasound directly, it has jack support.

How did you get the file to play back at 12kHz?  Could you tell if it was
really distorted like the capture was mis-packing the original data,
taking a 32 bit input word, putting just 16 bits of that into the first
half of a 32 bit word...that only accounts for 2x time, not 4x, and is
really a stretch, I don't see how an error that egregious could slip
through jack or jack_capture.  Very strange.


I think we probably can rule out errors in jackrec or jack_capture now.
jack_capture not only reports all underruns, but it also fills underruns
with empty samples, so it should never produce shorter audio files.
It seems more likely like jack doesn't call the process callback as
often as it should.



_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Capture problems with jack2 on Axia-Alsa device

Thomas Brand
In reply to this post by Christian Affolter
On Tue, January 30, 2018 19:46, Christian Affolter wrote:

> Hi Thomas,
>
>
> On 30.01.2018 18:15, Christian Affolter wrote:
>
>> On 30.01.2018 16:23, Christian Affolter wrote:
>>
>>>> the alsa device could be the issue. you could try to start a dummy
>>>> jack and add the alsa device with alsa_in to see if it makes a
>>>> difference.
>
> This seems to work, the audio gets captured (and can be played)
> correctly. Here is what I did:
>
> # Start jackd with the dummy backend
> jackd -d dummy
>
> # Add the alsa device via alsa_in
> alsa_in -d hw:0 -c 2
>
>
> # Capture via jack_capture
> jack_capture -b 32 -c 2 -d 10 -fn /tmp/test-jack_capture.wav \ -p
> alsa_in:capture_1 -p alsa_in:capture_2
>
>
> # Capture via jackrec
> jackrec -f /tmp/test-jackrec.wav -d 10 -b 32 alsa_in:capture_1
> alsa_in:capture_2
>
>
>
> What I also observed is the fact, that capturing 10 seconds
> (jack_capture -d 10 ...) directly from the "-d alsa" jackd takes around
> 40 seconds (real 0m40.457s) vs. 10 seconds (as one would expect) with
> the "-d dummy" jackd (real 0m10.339s)
>
> So I guess we're one step closer.
>
>

now that's an interesting find .. in theory it should not make a
difference if jack uses alsa backend or if you attach via alsa_in but
obviously it *does* make a difference.

40 seconds is the length when played at 12k.
4 x 8 bit also fit into 32 bit. something is fishy.

>
> Thanks a lot for your help
> Chris
>
>


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Capture problems with jack2 on Axia-Alsa device

Thomas Brand
In reply to this post by Chris Caudle
On Tue, January 30, 2018 20:35, Chris Caudle wrote:

> On Tue, January 30, 2018 12:46 pm, Christian Affolter wrote:
>
>> What I also observed is the fact, that capturing 10 seconds
>> (jack_capture -d 10 ...) directly from the "-d alsa" jackd takes around
>> 40 seconds (real 0m40.457s) vs. 10 seconds (as one would expect) with
>> the "-d dummy" jackd (real 0m10.339s)
>
> That is very strange, the test-arecord.wav and test-jack_capture.wav
> files are the same size, the file captured with jack is not 4 times
> larger.
>

indeed, very strange

> Does that CentOS machine have any attached audio hardware?  If so you
> could use the alsa_out plugin to play the captured audio, for example
> through a USB audio interface, and if that audio path is OK maybe just
> jack_rec or jack_capture is causing the problem.  I'm not sure what other
>  capture programs can run headless and capture from jack, NAMA perhaps?
> Actually I just checked and NAMA uses ecasound as the backend, just use
> ecasound directly, it has jack support.
>
> How did you get the file to play back at 12kHz?  Could you tell if it was
>  really distorted like the capture was mis-packing the original data,
> taking a 32 bit input word, putting just 16 bits of that into the first
> half of a 32 bit word...that only accounts for 2x time, not 4x, and is
> really a stretch, I don't see how an error that egregious could slip
> through jack or jack_capture.  Very strange.
>
i used a hand-crafted non-released player that can do it. it's just
playing the 48k file as if it would be 12k. any resampler could do it. it
was not distorted but i could hear the 's' is degraded. it could be 7.5
bit or something. very strange.


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Capture problems with jack2 on Axia-Alsa device

Chris Caudle
In reply to this post by Kjetil Matheussen-2
On Tue, January 30, 2018 1:52 pm, Kjetil Matheussen wrote:
> It seems more likely like jack doesn't call the process callback as
> often as it should.

The most likely cause for that would seem to be driver does not interrupt
as frequently as jackd expects.  A driver for a typical bus connected
audio device would interrupt whenever there were enough audio samples to
fill one buffer.
Do you have source for the LiveWire driver?  I think someone mentioned it
was a closed binary, is that correct?

--
Chris Caudle


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
12