git: 8be87b77e419 - stable/14 - sound: Initialize channels with sane default rate and format

From: Christos Margiolis <christos_at_FreeBSD.org>
Date: Tue, 04 Mar 2025 15:46:56 UTC
The branch stable/14 has been updated by christos:

URL: https://cgit.FreeBSD.org/src/commit/?id=8be87b77e419d959339f815325a763da83d24123

commit 8be87b77e419d959339f815325a763da83d24123
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2025-02-25 11:43:26 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2025-03-04 15:46:05 +0000

    sound: Initialize channels with sane default rate and format
    
    There is no good reason to initialize with AFMT_U8 at 8000Hz.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Reviewed by:    dev_submerge.ch
    Differential Revision:  https://reviews.freebsd.org/D48434
    
    (cherry picked from commit e89ee05b7cf1a54d0d6ed56e4d451fdd9a10db43)
---
 sys/dev/sound/pcm/channel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
index 4d275d00762a..58315610312e 100644
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -1205,8 +1205,8 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls,
 	c->direction = direction;
 	c->type = dir;
 	c->unit = alloc_unr(chn_getunr(d, c->type));
-	c->format = SND_FORMAT(AFMT_U8, 1, 0);
-	c->speed = DSP_DEFAULT_SPEED;
+	c->format = SND_FORMAT(AFMT_S16_LE, 2, 0);
+	c->speed = 48000;
 	c->pid = -1;
 	c->latency = -1;
 	c->timeout = 1;