NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/52586: auconv: LINEARN_LINEAR macro is mostly broken



>Number:         52586
>Category:       kern
>Synopsis:       auconv: LINEARN_LINEAR macro is mostly broken
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 01 04:35:00 +0000 2017
>Originator:     Tetsuya Isaki
>Release:        NetBSD 8.99.3
>Organization:
>Environment:
NetBSD 8.99.3 x68k
>Description:
Linear-to-linear converter generated from LINEARN_LINEAR macro in
auconv.c 1.27 is mostly broken.

I tested all 320 pattern which the macro attempts to support.  i.e.,
5 input prec/valid pairs * 4 output precisions *
2 input (signed/unsigned) * 2 input endianness *
2 output (signed/unsigned) * 2 output endianness.
And it failed on 264 cases (includes 10 infinate loop !).

 full result: http://www.netbsd.org/~isaki/20170930-auconv-result.txt
 adhoc test: http://www.netbsd.org/~isaki/20170930-auconv-test.diff

First point.  It's necessary to provide a parmanent test like atf.
Although I don't know how to do it...

Second point.  Is there a need to provide such a full cross conversion
(occupying kernel text segments)?
At least 24-to-24 will never be used because MI's mixring does not use
24bit precision at present, and unsigned-to-unsigned will also never
be used because MI's mixring only supports SLINEAR.

>How-To-Repeat:
Run "audioplay ulinear8.wav" on x68k (or on a big endian platform
where audio(4) uses slinear16 as virtual channel).

In this case, linear8_8_to_linear16() converter is used.
linear8_8_to_linear16(src=ULINEAR_LE, dst=SLINEAR_BE) should convert
0x01 into 0x8100 (0x81 0x00 on memory on BE) but it got 0x0081.
So it plays very small sound.

>Fix:
It is better to clarify the specification first.



Home | Main Index | Thread Index | Old Index