Quantcast

[Jack-Devel] jack_get_sample_rate

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Jack-Devel] jack_get_sample_rate

ROBERT WOLF
Dear All,

According to the documentation jack_get_sample_rate reports the sample rate as was used by jackd.
This does not happen in my case.
I start jackd using different sampling rates (i.e. 22050, ect.).
JACK reports that it does indeed uses the selected sampling rate.

But jack_get_sample_rate always returns 44100.

Why?

Cheers,

Robert


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

Re: jack_get_sample_rate

Kjetil Matheussen-2


On Mon, Dec 12, 2016 at 7:33 AM, ROBERT WOLF <[hidden email]> wrote:
Dear All,

According to the documentation jack_get_sample_rate reports the sample rate as was used by jackd.
This does not happen in my case.
I start jackd using different sampling rates (i.e. 22050, ect.).
JACK reports that it does indeed uses the selected sampling rate.

But jack_get_sample_rate always returns 44100.

Why?


How did Jack report that it used the selected sampling rate?
I.e. where did you read that?



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

Re: jack_get_sample_rate

Kjetil Matheussen-2
Which program shows this window?

(added jack-devel mailing list back to the conversation)

On Tue, Dec 13, 2016 at 8:35 AM, ROBERT WOLF <[hidden email]> wrote:
There is a window with messages and it says this:

configuring for 22050Hz, period = 1024 frames (46.4 ms), buffer = 2 periods



On 13/12/16 11:09, Kjetil Matheussen wrote:


On Mon, Dec 12, 2016 at 7:33 AM, ROBERT WOLF <[hidden email]> wrote:
Dear All,

According to the documentation jack_get_sample_rate reports the sample rate as was used by jackd.
This does not happen in my case.
I start jackd using different sampling rates (i.e. 22050, ect.).
JACK reports that it does indeed uses the selected sampling rate.

But jack_get_sample_rate always returns 44100.

Why?


How did Jack report that it used the selected sampling rate?
I.e. where did you read that?





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

Re: jack_get_sample_rate

Kjetil Matheussen-2
(putting back jack-devel again)

It just says that it configures for 22050Hz, it doesn't say whether it succeeded.
So things seems to work as it should.



On Tue, Dec 13, 2016 at 10:38 AM, ROBERT WOLF <[hidden email]> wrote:
Two programs show this information:

1. QJackCtl.
2. When I run my own program AND jack server is not running, THEN for some reason the jack server gets started (apparently using the command stored in .jackdrc file) and I see the following printout:

jackd 0.122.0
Copyright 2001-2009 Paul Davis, Stephane Letz, Jack O'Quinn, Torben Hohn and others.
jackd 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

JACK compiled with System V SHM support.
loading driver ..
apparent rate = 22050
creating alsa driver ... hw:PCH,0|hw:PCH,0|1024|2|22050|0|0|nomon|swmeter|-|32bit
ALSA lib conf.c:4578:(parse_args) Unknown parameter 1
ALSA lib conf.c:4711:(snd_config_expand) Parse arguments error: No such file or directory
ALSA lib control.c:953:(snd_ctl_open_noupdate) Invalid CTL hw:PCH,0
control open "hw:PCH,0" (No such file or directory)
configuring for 22050Hz, period = 1024 frames (46.4 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

HOWEVER!!!!

jack_get_sample_rate(...); still reports 44100.

How intriguing?!



On 13/12/16 19:53, Kjetil Matheussen wrote:
Which program shows this window?

(added jack-devel mailing list back to the conversation)

On Tue, Dec 13, 2016 at 8:35 AM, ROBERT WOLF <[hidden email]> wrote:
There is a window with messages and it says this:

configuring for 22050Hz, period = 1024 frames (46.4 ms), buffer = 2 periods



On 13/12/16 11:09, Kjetil Matheussen wrote:


On Mon, Dec 12, 2016 at 7:33 AM, ROBERT WOLF <[hidden email]> wrote:
Dear All,

According to the documentation jack_get_sample_rate reports the sample rate as was used by jackd.
This does not happen in my case.
I start jackd using different sampling rates (i.e. 22050, ect.).
JACK reports that it does indeed uses the selected sampling rate.

But jack_get_sample_rate always returns 44100.

Why?


How did Jack report that it used the selected sampling rate?
I.e. where did you read that?







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

Re: jack_get_sample_rate

Kjetil Matheussen-2
(Added jack-devel mailing list again)

Yes, I would think that jack_get_sample_rate is the only way to know the sample rate.

If qjackctl shows different information it must be a bug in qjackctl.
However, I noticed that your jack version is 7 years old. If qjackctl displayed
the wrong information in 2009, it's probably been fixed now.


On Tue, Dec 13, 2016 at 11:00 AM, ROBERT WOLF <[hidden email]> wrote:
In this case I would understand as follows:
1. Starting JACK server with 22050 Hz sampling rate is more-or-less a recommendation only.
2. The way to know the sampling rate for sure is to call jack_get_sample_rate.
3. I can testify that the actual sampling rate is the same as reported by jack_get_sampling_rate, because if it was not then my program would sound differently.

If my understanding is correct then I consider the case closed!

Cheers,

Robert


On 13/12/16 20:13, Kjetil Matheussen wrote:
(putting back jack-devel again)

It just says that it configures for 22050Hz, it doesn't say whether it succeeded.
So things seems to work as it should.



On Tue, Dec 13, 2016 at 10:38 AM, ROBERT WOLF <[hidden email]> wrote:
Two programs show this information:

1. QJackCtl.
2. When I run my own program AND jack server is not running, THEN for some reason the jack server gets started (apparently using the command stored in .jackdrc file) and I see the following printout:

jackd 0.122.0
Copyright 2001-2009 Paul Davis, Stephane Letz, Jack O'Quinn, Torben Hohn and others.
jackd 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

JACK compiled with System V SHM support.
loading driver ..
apparent rate = 22050
creating alsa driver ... hw:PCH,0|hw:PCH,0|1024|2|22050|0|0|nomon|swmeter|-|32bit
ALSA lib conf.c:4578:(parse_args) Unknown parameter 1
ALSA lib conf.c:4711:(snd_config_expand) Parse arguments error: No such file or directory
ALSA lib control.c:953:(snd_ctl_open_noupdate) Invalid CTL hw:PCH,0
control open "hw:PCH,0" (No such file or directory)
configuring for 22050Hz, period = 1024 frames (46.4 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

HOWEVER!!!!

jack_get_sample_rate(...); still reports 44100.

How intriguing?!



On 13/12/16 19:53, Kjetil Matheussen wrote:
Which program shows this window?

(added jack-devel mailing list back to the conversation)

On Tue, Dec 13, 2016 at 8:35 AM, ROBERT WOLF <[hidden email]> wrote:
There is a window with messages and it says this:

configuring for 22050Hz, period = 1024 frames (46.4 ms), buffer = 2 periods



On 13/12/16 11:09, Kjetil Matheussen wrote:


On Mon, Dec 12, 2016 at 7:33 AM, ROBERT WOLF <[hidden email]> wrote:
Dear All,

According to the documentation jack_get_sample_rate reports the sample rate as was used by jackd.
This does not happen in my case.
I start jackd using different sampling rates (i.e. 22050, ect.).
JACK reports that it does indeed uses the selected sampling rate.

But jack_get_sample_rate always returns 44100.

Why?


How did Jack report that it used the selected sampling rate?
I.e. where did you read that?









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

Re: jack_get_sample_rate

John Rigg-16
In reply to this post by Kjetil Matheussen-2
> On Tue, Dec 13, 2016 at 8:35 AM, ROBERT WOLF <
> [hidden email]> wrote:
>
> > There is a window with messages and it says this:
> >
> > configuring for 22050Hz, period = 1024 frames (46.4 ms), buffer = 2 periods

This looks like part of the console messages from jackd when it starts. I'd be
careful here. If the sample rate is set by external hardware (eg. if you have
external converters running on their internal clock, and your soundcard is
clock synced to that) then that jackd message will report whatever rate you
try to start it at, but not necessarily the rate the hardware is running at.

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

Re: jack_get_sample_rate

Adrian Knoth
In reply to this post by Kjetil Matheussen-2
On Tue, Dec 13, 2016 at 10:43:31AM +0100, Kjetil Matheussen wrote:

> It just says that it configures for 22050Hz, it doesn't say whether it
> succeeded.

Probably not:

> > control open "hw:PCH,0" (No such file or directory)

It's an Intel PCH (HDA) controller. I haven't looked at the specs, but
chances are the chip cannot do 22kHz.

$ cat /proc/asound/cards
 0 [HDSPMxf1cd85   ]: HDSPM - RME RayDAT_f1cd85
                      RME RayDAT S/N 0xf1cd85 at 0xef300000, irq 26
 1 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xef440000 irq 85
 2 [NVidia         ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xef080000 irq 36

Get the number (here: 1) and then

$ cat /proc/sound/card1/codec#0

[..]
  PCM:
    rates [0x560]: 44100 48000 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM


or even more direct:

$ grep rates /proc/asound/card1/codec#0
    rates [0x560]: 44100 48000 96000 192000
    rates [0x560]: 44100 48000 96000 192000
    rates [0x560]: 44100 48000 96000 192000
    rates [0x560]: 44100 48000 96000 192000
    rates [0x160]: 44100 48000 96000
    rates [0x160]: 44100 48000 96000
    rates [0x160]: 44100 48000 96000
    rates [0x560]: 44100 48000 96000 192000

See! No 22kHz for that chip, at least not for mine. If the card doesn't
support it, jackd cannot configure it.

Arguably, it shouldn't be able to start, but maybe that's fixed in newer
jackd versions. (I haven't looked in years)

And as others said: jack_get_sample_rate() is authoritative[0].


Cheers

[0] Some RME cards or anything with external clock sync can make the
card run at different rates than indicated by the driver, but that's
advanced territory and clearly not the case for Intel HDA PCH.

--
mail: [hidden email]   http://adi.thur.de        PGP/GPG: key via keyserver

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