From: "Måns Rullgård" <mans@mansr.com>
To: Eric Wong <normalperson@yhbt.net>
Cc: sox-devel@lists.sourceforge.net
Subject: Re: [PATCH] use posix_fadvise to increase readahead
Date: Thu, 13 Aug 2020 12:32:22 +0100 [thread overview]
Message-ID: <yw1xft8qsrw9.fsf@mansr.com> (raw)
In-Reply-To: <20200813035350.GA1144@dcvr> (Eric Wong's message of "Thu, 13 Aug 2020 03:53:50 +0000")
Eric Wong <normalperson@yhbt.net> writes:
> Måns Rullgård <mans@mansr.com> wrote:
>> Eric Wong <normalperson@yhbt.net> writes:
>>
>> > Eric Wong <normalperson@yhbt.net> wrote:
>> >> All relevant audio file formats store data sequentially, so
>> >> give a hint to the kernel to perform more readahead. In current
>> >> Linux, the readahead hint doubles readahead pages and can help
>> >> with playback on slow devices.
>> >
>> > Btw, I've been running this for a few years, too; but pretty
>> > much all on FLAC.
>> >
>> > I don't know if there's audio formats we support which aren't
>> > sequential. Maybe there's some wacky audio format which
>> > requires random read all over the place...
>>
>> I can't think of any format that isn't mostly sequential, certainly not
>> that's supported in SoX. There might exist some format that separates
>> channel data such that reading sequentially from multiple starting
>> points is the best strategy.
>
> Yeah, I was wondering about something along those lines,
> especially if exceeding 2 channels...
I know of formats that interleave channel data in blocks of a few
kilobytes, but those don't require seeking. Some MOV/MP4 video files
store the video and audio completely separately, but we don't care about
those.
>> What sort of improvement do you get from this anyway? I'm not opposed
>> to the addition, just curious.
>
> I didn't measure before :x It's more of a "it couldn't hurt"
> thing and let the kernel (and configured per-device readahead)
> decide. It's only intended as a hint for the kernel, after all.
>
> My 7200 RPM HDD has 256 MB cache on it; I couldn't measure any
> difference even with 'echo 3 >/proc/sys/vm/drop_caches' (Linux)
> and reading ~300 MB of stuff before testing in hopes it'd clear
> the internal HDD cache. Maybe slower mounts (optical storage,
> 4200 RPM HDDs, or network FSes) will see the benefit.
>
> I used to play audio on a laptop using an sshfs mount back in
> the day (with FUSE readahead, too), but haven't had the need or
> ability to do that for years, now.
Hmm, I prefer not to add code like this on a hunch. Maybe I'll hook up
some horrible old laptop drive and see if it makes a difference there.
Then again, does anyone care?
--
Måns Rullgård
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel
prev parent reply other threads:[~2020-08-13 11:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-07 1:10 [PATCH] use posix_fadvise to increase readahead Eric Wong
2020-08-12 6:28 ` Eric Wong
2020-08-12 9:39 ` Måns Rullgård
2020-08-13 3:53 ` Eric Wong
2020-08-13 11:32 ` Måns Rullgård [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.sourceforge.net/lists/listinfo/sox-devel
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yw1xft8qsrw9.fsf@mansr.com \
--to=sox-devel@lists.sourceforge.net \
--cc=normalperson@yhbt.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/sox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).