You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported in version: HG 2.0 Reported for operating system, platform: NetBSD, x86
Comments on the original bug report:
On 2020-04-08 14:19:52 +0000, Nia Alarie wrote:
Created attachment 4298
Patch to get and use the current hardware frequency with the AUDIO_GETFORMAT ioctl.
The NetBSD kernel's audio resampling code is much simpler and lower quality than libsamplerate.
Presumably, if SDL always performs I/O on the audio device in its native frequency, we can avoid resampling audio in the kernel and let SDL do it with libsamplerate instead.
On 2020-04-08 14:30:46 +0000, Nia Alarie wrote:
Created attachment 4299
[v2] Patch to get and use the current hardware frequency with the AUDIO_GETFORMAT ioctl.
Actually, we shouldn't set the device "blocksize" at all (the kernel will ignore it and calculate its own), but especially don't set it to the value of spec->size before spec->size is calculated.
On 2020-12-27 09:24:22 +0000, Nia Alarie wrote:
The last version of this patch I uploaded doesn't work with older NetBSD releases so shouldn't be applied.
On 2020-12-27 21:11:58 +0000, Sam Lantinga wrote:
These changes sound useful. Is there a way to make this work with both old and new versions of NetBSD?
On 2020-12-27 21:12:25 +0000, Sam Lantinga wrote:
Waiting for confirmation before resolving this bug.
On 2021-01-06 13:46:09 +0000, Nia Alarie wrote:
Yes, we can easily make this work on older versions of NetBSD by #ifdefing around the AUDIO_GETFORMAT ioctl usage.
I wonder if this is actually how SDL is supposed to work, though. I just assumed that SDL now does the conversions automatically, so to revisit this patch I'd need reassurance about the internal behaviour.
On 2021-01-06 17:29:29 +0000, Sam Lantinga wrote:
SDL will automatically convert sample rate if the application requests it, so returning the native sample rate is completely reasonable here.
On 2021-01-06 17:30:33 +0000, Sam Lantinga wrote:
Basically the audio driver should change to the requested frequency if the audio hardware can run at that frequency, and return the actual frequency if not.
On 2021-01-08 12:46:29 +0000, Nia Alarie wrote:
Created attachment 4643
[v3] Patch to get and use the current hardware frequency with the AUDIO_GETFORMAT ioctl
Attempt to work with older NetBSD releases.
On 2021-01-08 12:50:42 +0000, Nia Alarie wrote:
OK, new patch uploaded.
Background: The audio device supports any arbitrary sample rate from 1-192kHz. The user can configure a native frequency for the device, which is nearly always 48kHz by default. Audio at a different frequency will play without issue, but will be resampled in the kernel, and we definitely want libsamplerate to be used instead.
v3 of the patch should always set this->spec.freq to the native rate (usually 48kHz) on NetBSD 9.x and newer, but will leave it unchanged on older releases and rely on the in-kernel resampler. Does that sound right?
This bug report was migrated from our old Bugzilla tracker.
These attachments are available in the static archive:
Patch to get and use the current hardware frequency with the AUDIO_GETFORMAT ioctl. (sdl-hwfreq.diff, text/plain, 2020-04-08 14:19:52 +0000, 1952 bytes)Reported in version: HG 2.0
Reported for operating system, platform: NetBSD, x86
Comments on the original bug report:
On 2020-04-08 14:19:52 +0000, Nia Alarie wrote:
On 2020-04-08 14:30:46 +0000, Nia Alarie wrote:
On 2020-12-27 09:24:22 +0000, Nia Alarie wrote:
On 2020-12-27 21:11:58 +0000, Sam Lantinga wrote:
On 2020-12-27 21:12:25 +0000, Sam Lantinga wrote:
On 2021-01-06 13:46:09 +0000, Nia Alarie wrote:
On 2021-01-06 17:29:29 +0000, Sam Lantinga wrote:
On 2021-01-06 17:30:33 +0000, Sam Lantinga wrote:
On 2021-01-08 12:46:29 +0000, Nia Alarie wrote:
On 2021-01-08 12:50:42 +0000, Nia Alarie wrote:
On 2021-01-08 18:10:30 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered: