From patchwork Sat Jul 19 21:50:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Killer{R} X-Patchwork-Id: 4590091 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 599359F1D6 for ; Sat, 19 Jul 2014 21:51:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9E27B20120 for ; Sat, 19 Jul 2014 21:51:16 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 754842011D for ; Sat, 19 Jul 2014 21:51:14 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 15FAC2625EA; Sat, 19 Jul 2014 23:51:12 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id ECFC1261B23; Sat, 19 Jul 2014 23:51:05 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id A8EB4261B2D; Sat, 19 Jul 2014 23:51:04 +0200 (CEST) Received: from smtp.z8.ru (smtp.z8.ru [80.93.62.204]) by alsa0.perex.cz (Postfix) with ESMTP id 173E8261B1B for ; Sat, 19 Jul 2014 23:50:58 +0200 (CEST) Received: from [212.98.162.147] (helo=kllr) by smtp.z8.ru with esmtpa (Exim 4.71 (FreeBSD)) (envelope-from ) id 1X8cWW-000GYs-9x for alsa-devel@alsa-project.org; Sun, 20 Jul 2014 01:50:32 +0400 Date: Sun, 20 Jul 2014 00:50:33 +0300 From: Killer{R} X-Mailer: The Bat! (v1.61) CD5BF9353B3B7091 Organization: Killer{R} X-Priority: 3 (Normal) Message-ID: <42535576562.20140720005033@killprog.com> To: alsa-devel@alsa-project.org MIME-Version: 1.0 X-SA-Exim-Connect-IP: 212.98.162.147 X-SA-Exim-Mail-From: support@killprog.com X-SA-Exim-Scanned: No (on smtp.z8.ru); SAEximRunCond expanded to false Subject: [alsa-devel] mpd + emu 0404 USB automatic sample rate X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Killer{R} List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Hello alsa-devel, I'm trying to build bit-perfect music playback box using Olinuxino board and EMU 0404 USB sound card running MPD. I have wide collection of lossless songs with different sampling rates - from 44100 to 192000. I set MPD config to play sound via correct alsa device and it works, however whenever I start play song with different sampling rate - MPD (or ALSA?) 'forgets' to switch sampling rate frequency and I hear buzzing sound instead of music. If I run alsamixer and manually switch there sampling rate - it plays OK until I select song with again different sampling rate. It seems I'm not first with such a problem, here is same complain with a workadound: http://murga-linux.com/puppy/viewtopic.php?p=745547#745547 Currently I'm running sunxi Linux kernel: 3.4.90, but same bug reproduced when I used Raspberry PI with kernel 3.6.11 ALSA's version: cat /proc/asound/version Advanced Linux Sound Architecture Driver Version 1.0.25. Seems I was able to fix this on my system, but not sure if this fix is correct, here is diff: --- quirks.c Fri Jul 18 01:20:16 2014 +++ quirks.c Sun Jul 20 00:20:49 2014 @@ -723,7 +723,8 @@ static void set_format_emu_quirk(struct * by playback substream */ if (subs->direction == SNDRV_PCM_STREAM_PLAYBACK) { - if (subs->stream->substream[SNDRV_PCM_STREAM_CAPTURE].interface != -1) + if (subs->stream->substream[SNDRV_PCM_STREAM_CAPTURE].interface != -1 && + subs->stream->substream[SNDRV_PCM_STREAM_CAPTURE].running) return; }