alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: "Johan Aires Rastén" <johan@oljud.se>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, clemens@ladisch.de, Daniel Mack <daniel@zonque.org>
Subject: Re: usb-audio: I'd like to change two things in usb audio, but I'm not sure if it's right
Date: Tue, 25 Nov 2014 08:39:47 +0100	[thread overview]
Message-ID: <CAMFLXsDPHAQzXOgcG17PL_6CcToEDBTWpdFcTec+sc2uxEkkMA@mail.gmail.com> (raw)
In-Reply-To: <CAMFLXsBpYLeFTbAaqbYUA3FC_emWcZi2TZDSU+7zb41OFmg8Xg@mail.gmail.com>

Managed to misspell Clemens' address in my previous mail.

On 24 November 2014 at 22:16, Johan Aires Rastén <johan@oljud.se> wrote:

> So I'll try again, this time with the proper cc:s and a second question.
>
> I've come across two issues in the usb audio module that are causing
> problems with my sound card, but I'm thinking that changing them might
> break something for some other card.
>
> In sound/usb/mixer.c function check_input_term(...), for the case
> UAC_INPUT_TERMINAL and UAC_VERSION_2:
>
> The recursive call to get clock selectors messes up the naming of my
> terminals. At this stage the terminals are already properly named Mic and
> Line but the call overwrites them both with the unnamed clock selector
> "Unit 22". Are other UAC2 cards different, so that the clock selector
> contains the correct terminal name, or is there some other reasoning here
> that I'm not seeing?
>
> Could the call be removed, or perhaps only done if no terminal name has
> been found yet?
>
> In sound/usb/stream.c function snd_usb_add_audio_stream(...), near the end
> of the function:
>
> A newly created pcm is added with "list_add(&as->list, &chip->pcm_list);"
> which causes devices to be listed in reverse order, i.e. device 0 will be
> at the end of the list, and this leads to that capture streams end up in
> the wrong device under certain circumstances.
>
> The problem arises when the code under "look for an empty stream" earlier
> in the same function executes. It will attach the capture stream to the
> first compatible existing stream, but since they are reversed it will find
> the highest numbered device. In my case analog input will be grouped with
> digital out (device 1) instead of analog out (device 0).
>
> This is assuming that playback streams are defined before capture streams
> but it could happen in the other direction as long as there are several
> streams of one type.
>
> I also suspect that this is what causes the M-Audio Audiophile USB to have
> swapped inputs, for which there's a fix in USB-Audio.conf (
> http://git.alsa-project.org/?p=alsa-lib.git;a=blob;f=src/conf/cards/USB-Audio.conf#l70
> ). Thanks to debianuser on IRC for helping me find it.
>
> I would like to change this call to use list_add_tail for adding new items
> instead, but I'm worried that there are quirks or other fixes that expect
> the current behaviour. There are very few other references to pcm_list and
> none of them seem to care about ordering.
>
> Sorry for being bad at referencing code, I'm new at this.
>
> //Johan Rastén
>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2014-11-25  7:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-24 21:16 usb-audio: I'd like to change two things in usb audio, but I'm not sure if it's right Johan Aires Rastén
2014-11-25  7:39 ` Johan Aires Rastén [this message]
2014-12-05 17:01 ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMFLXsDPHAQzXOgcG17PL_6CcToEDBTWpdFcTec+sc2uxEkkMA@mail.gmail.com \
    --to=johan@oljud.se \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=daniel@zonque.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).