Closed vloddot closed 2 months ago
Is it a massive change to use the ma_resource_manager? I haven't looked into it and a bit busy at the moment.
I'm only looking at the simple playback example from the miniaudio documentation since I'm not too knowledgeable about the codebase but here are the differences:
ma_decoder
, ma_resource_manager_data_source
is used.ma_resource_manager
is initialized to allow the initializing of ma_resource_manager_data_source
.You can see the Simple Playback example here and the Resource Manager example here.
Digging through the code, I see that something called ma_data_source_base
is used instead of ma_decoder
.
Edit: A custom data source apparently.
Ok, thank you so much for this!
You're welcome! Sorry for bothering you while you're busy.
I recently reformatted my drive to ext4 instead of btrfs and apparently the cut outs were due to the slow read/write operations by btrfs. Nontheless, this is still an actual issue.
Ok. I just committed the latest to the develop branch, in case you want to play around with it. The internal structure is a bit messy though, I'm more used to OOP than this stuff. But it's a lot of fun.
Wrong issue.. #132
hm?
Your changes were about implementing searching so I assumed you meant to comment on the other issue.
No, I meant this one. Next release is going to have search too, yeah.
I can't seem to find changes relating to using ma_resource_manager
but I'll still try it.
Cool!
Sorry for taking a while to test, I was busy and had to reformat my drive to btrfs to test. Same issue still occurs, I really don't see any difference in the source code that changes how audio is processed.
Oh I didn't make any changes to it. I just thought maybe you wanted to play around with the code, so I pushed the latest stuff I had. You don't have to of course, but if you do you can do it on the latest code. No experienced c programmer except you has showed up yet.
Alright then, I'll try to in my free time. Sorry for misunderstanding.
Sorry, I've been busy the past few weeks. I'll see if I can do anything about it. I'll ask for help if I need it.
I looked at it a little and it seems like a hard thing to change, one reason is because I am linking those decoders together to have gapless playback, and there is quite a bit of code related to that and usage of ma_decoder. I don't know if it's possible to do gapless playback with a ma_resource_manager.
I don't really think it's worth it to use a resource manager then. A custom implementation for drives with low read speeds would help but I wouldn't think the incredibly specific use-case I had would be worth that effort or help many people. btrfs isn't really meant to be used on hard drives anyway. I'm in no place to speak of course but I think this should be marked as unplanned. You're free to do as you want but the problem has been solved for me in the end.
Ok, cool. How did you solve it for yourself? Just moved the music to a ssd?
I recently reformatted my drive to ext4 instead of btrfs and apparently the cut outs were due to the slow read/write operations by btrfs. Nontheless, this is still an actual issue.
SSD or reformatted to a faster filesystem.
Ok, thanks for reporting this issue and helping out. Appreciate it.
Playing a flac file on a hard drive is too slow and cuts audio out a lot. ( every few seconds) I've also noticed that playing the same sound file twice seems to cache it somehow and runs fine but practically, that almost never happens.
Since I know a bit of C programming, I tried to see what was wrong, I looked at the miniaudio documentation and found that using the low-level API (simple playback example) is what causes this issue. Using the high-level API, using an
ma_resource_manager
or moving the flac file to an SSD makes it work perfectly. I'm sure using the low-level API is required for performance but I don't know the internals of why this issue happens exactly.I have not tested a different file format yet so it may be an issue with flac files and hard drives specifically. (or something with my device)
Result of
ffprobe
on one of the files as described in CONTRIBUTING.md:More info: