NetBSD Problem Report #45776

From www@NetBSD.org  Wed Jan  4 15:30:23 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id EEAE663DD79
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  4 Jan 2012 15:30:22 +0000 (UTC)
Message-Id: <20120104153022.0968463BC35@www.NetBSD.org>
Date: Wed,  4 Jan 2012 15:30:22 +0000 (UTC)
From: nathanialsloss@yahoo.com.au
Reply-To: nathanialsloss@yahoo.com.au
To: gnats-bugs@NetBSD.org
Subject: audio freezes on when skipping audio on btsco with mplayer sun audio output
X-Send-Pr-Version: www-1.0

>Number:         45776
>Category:       kern
>Synopsis:       audio freezes on when skipping audio on btsco with mplayer sun audio output
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    nat
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 04 15:35:00 +0000 2012
>Closed-Date:    Wed Jun 21 23:36:51 +0000 2017
>Last-Modified:  Wed Jun 21 23:36:51 +0000 2017
>Originator:     Nat Sloss
>Release:        NetBSD 5.0.1
>Organization:
>Environment:
NetBSD beast 5.0.1 NetBSD 5.0.1 (BEAST) #92: Mon Jan  2 23:55:27 EST 2012  build@beast:/home/build/NetBSD-5.0.1_source_tree/usr/src/sys/arch/i386/compile/BEAST i386
>Description:
When skipping audio with mplayer -ao:sun with btsco bluetooth audio the audio output freezes and cannot recover only killed.
>How-To-Repeat:
setup btsco audio. btdev, bthset, scomtu and configuration for ubt sco packets etc.

run mplayer -ao sun:/dev/audio[bluetooth audio device number] something.mp3

skip audio with left arrow or up arrow.

The problem also affects NetBSD-5.99.58.
>Fix:
I don't know if I have done the right thing but I noticed that btsco uses start_output and start_input,  Other drivers seem to use trigger_output/input.

With experimentation I have found that trigger output is called after skipping audio with mplayer but not start_output.

audiostartp is called and then it gets trapped in audio poll endlessly.

So I patched audio.c as follows:

--- audio.c.orig        2009-10-16 16:43:37.000000000 +1100
+++ audio.c     2011-12-22 18:37:47.000000000 +1100
@@ -2559,7 +2559,8 @@
        if (!audio_can_playback(sc))
                return EINVAL;

-       if (!sc->sc_pr.mmapped && used < sc->sc_pr.blksize) {
+       if (!sc->sc_pr.mmapped && used < sc->sc_pr.blksize &&
+           sc->hw_if->trigger_output != NULL) {
                wakeup(&sc->sc_wchan);
                DPRINTF(("%s: wakeup and return\n", __func__));
                return 0;

This means that start_output is called and audio_pint as with trigger_output.  I fixes the problem but I'm not sure I've done the right thing.

I hope this helps,

Regards,

Nat.

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->nat
Responsible-Changed-By: nat@NetBSD.org
Responsible-Changed-When: Mon, 23 Jan 2017 21:26:37 +0000
Responsible-Changed-Why:
I'll handle this.


State-Changed-From-To: open->closed
State-Changed-By: nat@NetBSD.org
State-Changed-When: Wed, 21 Jun 2017 23:36:51 +0000
State-Changed-Why:
Patch from this pr no longer applies.  There have been changes to audio/btsco
which fixes this.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(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-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.