NetBSD-Bugs archive

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

Re: kern/54474: Jetson TK1 audio playback has clicks since isaki-audio2 merge



At Sun, 18 Aug 2019 16:53:08 +0100,
Nick Hudson wrote:
> That said, the click still exists on netbsd-9 - here's the output from a
> netbsd-9 system
> 
> # audiocfg test 0
> 0: [*] audio0 @ hdafg0: NVIDIA Tegra124 HDMI
>         playback: 8ch, 44100Hz
>         record:   2ch, 44100Hz
>         (P-) slinear_le 16/16, 2ch, { 44100 }
>         (P-) slinear_le 16/16, 4ch, { 44100 }
>         (P-) slinear_le 16/16, 6ch, { 44100 }
>         (P-) slinear_le 16/16, 8ch, { 44100 }
>         (PR) slinear_le 16/16, 2ch, 44100-44100Hz
>    testing channel 0... done
>    testing channel 1... done
>    testing channel 2... done
>    testing channel 3... done
>    testing channel 4... done
>    testing channel 5... done
>    testing channel 6... done
>    testing channel 7...write: Resource temporarily unavailable
> #

Please try this commit.
If you can play audio other than "audiocfg test", I hope it fixes
reported problem.

| Committed By:	isaki
| Date:		Sat Aug 24 04:04:10 UTC 2019
| 
| Modified Files:
| 	src/usr.bin/audiocfg: audiodev.c audiodev.h main.c
| 
| Log Message:
| Revert to use single descriptor for "audiocfg test" as before.
| 
| 
| To generate a diff of this commit:
| cvs rdiff -u -r1.8 -r1.9 src/usr.bin/audiocfg/audiodev.c
| cvs rdiff -u -r1.6 -r1.7 src/usr.bin/audiocfg/audiodev.h
| cvs rdiff -u -r1.10 -r1.11 src/usr.bin/audiocfg/main.c


And please test this sample code as well.  This code just plays four
seconds silence to /dev/audio0.  If isaki-audio2 driver is wrong,
it will only fail on >=8.99.39 kernel and will not fail on <8.99.39.
If it fails on both, it may be hardware driver(hdafg)'s issue.

% cat rept.c
#include <err.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
int main()
{
	const char *devaudio = "/dev/audio0";
	char buf[8000];	// 1sec in 8bit-mulaw,1ch,8000Hz
	int fd;
	int r;
	int i;

	memset(buf, 0xff, sizeof(buf));
	for (i = 0; i < 4; i++) {
		fd = open(devaudio, O_WRONLY);
		if (fd == -1)
			err(1, "open: %s", devaudio);
		printf("open ");
		fflush(stdout);

		r = write(fd, buf, sizeof(buf));
		if (r < sizeof(buf))
			err(1, "write");

		close(fd);
		printf("close\n");
	}
	return 0;
}
% gcc -o rept rept.c
% ./rept
---
Tetsuya Isaki <isaki%pastel-flower.jp@localhost / isaki%NetBSD.org@localhost>


Home | Main Index | Thread Index | Old Index