NetBSD Problem Report #51879
From www@NetBSD.org Sun Jan 15 07:35:52 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id DE6427A28E
for <gnats-bugs@gnats.NetBSD.org>; Sun, 15 Jan 2017 07:35:51 +0000 (UTC)
Message-Id: <20170115073550.9DBD57A2B2@mollari.NetBSD.org>
Date: Sun, 15 Jan 2017 07:35:50 +0000 (UTC)
From: isaki@NetBSD.org
Reply-To: isaki@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: vs(4) audio attach failed
X-Send-Pr-Version: www-1.0
>Number: 51879
>Category: kern
>Synopsis: vs(4) audio attach failed
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: nat
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Jan 15 07:40:00 +0000 2017
>Closed-Date: Sun Feb 05 08:19:38 +0000 2017
>Last-Modified: Sun Feb 05 08:19:38 +0000 2017
>Originator: Tetsuya Isaki
>Release: NetBSD-current
>Organization:
NetBSD
>Environment:
NetBSD XXXXX 7.99.59 NetBSD 7.99.59 (GENERIC) #14: Sun Jan 15 14:30:05 JST 2017 isaki@XXXXX/sys/arch/x68k/compile/GENERIC x68k
>Description:
vs(4) audio attach failed in recent x68k kernel.
# dmesg
:
vs0 at intio0 addr 0xe92000 using DMA ch3 intr 0x6a and 0x6b
vs0: MSM6258V ADPCM voice synthesizer
audio0 at vs0: half duplex, playback, capture
Invalid channel format, please check hardware capabilities
vs0: audioattach: audio_set_vchan_defaults() failed
:
Before merging in-kernel mixer, audioattach() uses mu-law/8k/1ch
as default pparams and vs_set_params() (in arch/x68k/dev/vs.c)
supports it (because audioattach() required it).
Now audioattach() uses SLINEAR16/44.1k/2ch as default pparams
and vs_set_params() does not support either stereo or 44.1kHz freq.
Here vs(4) is up to 15.6kHz mono ADPCM device.
I don't know which is right...
1) revert audioattach()'s default parameters to mu-law/8k/1ch.
or
2) support SLINEAR16/44.1k/2ch to vs(4).
I think that MI/MD specification changes should be made carefully.
But I also think that SLINEAR16/44.1k/2ch may be reasonable than
mu-law/8k/1ch for most recent devices.
>How-To-Repeat:
Boot recent x68k kernel and see dmesg.
>Fix:
N/A
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: kern-bug-people->nat
Responsible-Changed-By: nat@NetBSD.org
Responsible-Changed-When: Tue, 17 Jan 2017 01:23:49 +0000
Responsible-Changed-Why:
I'll handle this.
From: "Nathanial Sloss" <nat@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/51879 CVS commit: src/sys/dev
Date: Sat, 21 Jan 2017 22:22:41 +0000
Module Name: src
Committed By: nat
Date: Sat Jan 21 22:22:41 UTC 2017
Modified Files:
src/sys/dev: audio.c
Log Message:
Add auto config for channel/hw format.
Addresses PR kern/51703.
Addresses PR kern/51760.
Addresses PR kern/51879.
To generate a diff of this commit:
cvs rdiff -u -r1.291 -r1.292 src/sys/dev/audio.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->feedback
State-Changed-By: nat@NetBSD.org
State-Changed-When: Mon, 23 Jan 2017 21:32:33 +0000
State-Changed-Why:
Auto configuration of virtual channel parameters has been committed.
From: Tetsuya Isaki <isaki@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: nat@NetBSD.org,
netbsd-bugs@netbsd.org,
gnats-admin@netbsd.org
Subject: Re: kern/51879 (vs(4) audio attach failed)
Date: Fri, 03 Feb 2017 23:27:41 +0900
At Mon, 23 Jan 2017 21:32:33 +0000 (UTC),
> Synopsis: vs(4) audio attach failed
>
> State-Changed-From-To: open->feedback
> State-Changed-By: nat@NetBSD.org
> State-Changed-When: Mon, 23 Jan 2017 21:32:33 +0000
> State-Changed-Why:
> Auto configuration of virtual channel parameters has been committed.
vs(4) still does not work.
By the way, current vchan_autoconfig() (in sys/dev/audio.c)
seems try all frequency formats of all channel numbers of all
precisions. Is it right way?
IMHO, is it not enough that ''try SLINEAR/44.1/2ch first
and if fails then try mulaw/8k/1ch (for backward compatibility)'' ?
Here is the last part of dmesg (with AUDIO_DEBUG=1):
final blksize=272
audio_init_ringbuffer: MI blksize=272
audio_init_ringbuffer: final blksize=272
audio_calcwater: plow=49152 phigh=65536 rlow=0 rhigh=65264
audiostartp: start=0xa870000 used=0(hi=65536 blk=272) mmapped=0
audiostartp: wakeup and return
audiosetinfo sc=0x116d000 ai=0x3507f0
audiosetinfo() Setting record params: enc=7 1ch 8/8bit 8000Hz
audiosetinfo() Setting play params: enc=7 1ch 8/8bit 8000Hz
audio_setup_pfilters: HW-buffer=0x10f59cc pustream=0x10f582c
[0] enc=6 1ch 8/8bit 8000Hz
[1] enc=5 1ch 4/4bit 8000Hz
[HW] enc=5 1ch 4/4bit 8000Hz
audio_setup_rfilters: HW-buffer=0x10f5a30 pustream=0x10f5adc
[HW] enc=5 1ch 4/4bit 8000Hz
[0] enc=5 1ch 4/4bit 8000Hz
[1] enc=6 1ch 8/8bit 8000Hz
audiosetinfo: filter setup is completed.
audio_calc_blksize: record blksize=200
audio_calc_blksize: play blksize=200
audio_initbufs: mode=0x5
audio_init_ringbuffer: MI blksize=192
audio_init_ringbuffer: final blksize=192
audio_init_ringbuffer: MI blksize=192
audio_init_ringbuffer: final blksize=192
audio_calcwater: plow=49152 phigh=65536 rlow=0 rhigh=65344
audiostartp: start=0xa870000 used=0(hi=65536 blk=192) mmapped=0
audiostartp: wakeup and return
audiosetinfo sc=0x116d000 ai=0x3507f0
audiosetinfo() Setting record params: enc=7 1ch 8/8bit 4000Hz
audiosetinfo() Setting play params: enc=7 1ch 8/8bit 4000Hz
audio_setup_pfilters: HW-buffer=0x10f59cc pustream=0x10f582c
[0] enc=6 1ch 8/8bit 4000Hz
[1] enc=5 1ch 4/4bit 4000Hz
[HW] enc=5 1ch 4/4bit 4000Hz
audio_setup_rfilters: HW-buffer=0x10f5a30 pustream=0x10f5adc
[HW] enc=5 1ch 4/4bit 4000Hz
[0] enc=5 1ch 4/4bit 4000Hz
[1] enc=6 1ch 8/8bit 4000Hz
audiosetinfo: filter setup is completed.
audio_calc_blksize: record blksize=100
audio_calc_blksize: play blksize=100
audio_initbufs: mode=0x5
audio_init_ringbuffer: MI blksize=96
audio_init_ringbuffer: final blksize=96
audio_init_ringbuffer: MI blksize=96
audio_init_ringbuffer: final blksize=96
audio_calcwater: plow=49152 phigh=65536 rlow=0 rhigh=65440
audiostartp: start=0xa870000 used=0(hi=65536 blk=96) mmapped=0
audiostartp: wakeup and return
vs0: Virtual format auto config failed!
Please check hardware capabilities
vs0: audioattach: audio_set_vchan_defaults() failed
audio_attach: inputs ports=0x0, input master=-1, output ports=0x0, output master=-1
---
Tetsuya Isaki <isaki@pastel-flower.jp / isaki@NetBSD.org>
From: Tetsuya Isaki <isaki@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: nat@NetBSD.org,
gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: kern/51879 (vs(4) audio attach failed)
Date: Sun, 05 Feb 2017 16:40:40 +0900
vs(4) now attached on current/20170204.
vs0 at intio0 addr 0xe92000 using DMA ch3 intr 0x6a and 0x6b
dmac0: allocating ch 3 for vs.
vs0: MSM6258V ADPCM voice synthesizer
audio0 at vs0: half duplex, playback, capture
vs0: Virtual format configured - Format SLINEAR, precision 16,
channels 1, frequency 16000
:
but it seems that it cannot play correctly.
I will check it.
Please close the PR. Thanks nat@.
---
Tetsuya Isaki <isaki@pastel-flower.jp / isaki@NetBSD.org>
State-Changed-From-To: feedback->closed
State-Changed-By: nat@NetBSD.org
State-Changed-When: Sun, 05 Feb 2017 08:19:38 +0000
State-Changed-Why:
Submitter has confirmed that audio now attaches.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.