John_E
(John E)
September 29, 2024, 7:56am
#1
For the first time ever, I recently needed to load a session recorded at 22050Hz - so I selected 22.1KHz in my engine dialog, assuming it was an abbreviation/roundup. But no… Ardour gives me a dialog saying that it can’t run 22050 sessions because it’s running at 22100Hz :-
Or have I misunderstood something?
John_E
(John E)
September 29, 2024, 10:37am
#2
Another weirdness is that I don’t hear any audio with this session (nor see any meters moving). Can anyone see if I need to press a switch somewhere? Sessions at other sample rates are working fine.
x42
(Robin Gareus)
September 29, 2024, 3:20pm
#3
22050Hz is amazingly rare these days, but just 44.1kHz / 2.
I’ve never seen 22100Hz though and find no reference to that in our codebase. However
Ardour asks soundcards drivers about supported rates, and lists those.
x42
(Robin Gareus)
September 29, 2024, 3:23pm
#4
Indeed. I just created a test session, and with sample-rates < 24kHz (8k or 22.05kHz) Ardour remains silent. I also get error messages
2024-09-29T17:22:31 [ERROR]: DiskReader 27443: cannot read 122880 from playlist at sample 0
2024-09-29T17:22:31 [ERROR]: DiskReader player:Audio 1: when refilling, cannot read 122880 from playlist at sample 0 (rv: 0)
2024-09-29T17:22:31 [ERROR]: Butler read ahead failure on dstream Audio 1
colinf
(Colin Fletcher)
September 29, 2024, 3:40pm
#5
Ardour displays a 22,050Hz sample rate as 22.1kHz - ARDOUR_UI_UTILS::rate_as_string (float r) .
Something like
char buf[32];
- if (fmod (r, 1000.0f)) {
+ if (fmod (r, 100.0f)) {
+ snprintf (buf, sizeof (buf), "%.2f kHz", r / 1000.0);
+ } else if (fmod (r, 1000.0f)) {
snprintf (buf, sizeof (buf), "%.1f kHz", r / 1000.0);
ought to do the trick.
1 Like
x42
(Robin Gareus)
September 29, 2024, 3:51pm
#6
and a quick fix to play back sessions with rate <24k
diff --git a/libs/ardour/butler.cc b/libs/ardour/butler.cc
index 274e2cf5ea..1a963c7e13 100644
--- a/libs/ardour/butler.cc
+++ b/libs/ardour/butler.cc
@@ -93,6 +93,7 @@ Butler::config_changed (std::string p)
if (Config->get_buffering_preset () == Custom) {
/* size is in Samples, not bytes */
samplecnt_t audio_playback_buffer_size = (uint32_t)floor (Config->get_audio_playback_buffer_seconds () * _session.sample_rate ());
+ audio_playback_buffer_size = std::max<samplecnt_t> (audio_playback_buffer_size, DiskReader::chunk_samples ());
if (_audio_playback_buffer_size != audio_playback_buffer_size) {
_audio_playback_buffer_size = audio_playback_buffer_size;
_session.adjust_playback_buffering ();
@@ -111,6 +112,7 @@ Butler::config_changed (std::string p)
DiskIOProcessor::set_buffering_parameters (Config->get_buffering_preset ());
samplecnt_t audio_capture_buffer_size = (uint32_t)floor (Config->get_audio_capture_buffer_seconds () * _session.sample_rate ());
samplecnt_t audio_playback_buffer_size = (uint32_t)floor (Config->get_audio_playback_buffer_seconds () * _session.sample_rate ());
+ audio_playback_buffer_size = std::max<samplecnt_t> (audio_playback_buffer_size, DiskReader::chunk_samples ());
if (_audio_capture_buffer_size != audio_capture_buffer_size) {
_audio_capture_buffer_size = audio_capture_buffer_size;
_session.adjust_capture_buffering ();
John_E
(John E)
September 29, 2024, 4:00pm
#7
Thanks guys… I’ll try those changes tomorrow.
x42
(Robin Gareus)
September 29, 2024, 6:37pm
#8
I applied both changes already.
John_E
(John E)
September 30, 2024, 7:04am
#9
Thanks Robin & Colin, that’s working fine now!
BTW Robin… I emailed you yesterday about a Debug assertion after commit #dd4a1a6d73 and I’ve a bit more info to send you (after I’ve had some breakfast!)