alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Mack <zonque@gmail.com>
To: Alan Horstmann <gineera@aspect135.co.uk>
Cc: alsa-devel@alsa-project.org
Subject: Re: USB audio devices on Audio 4DJ and similar
Date: Wed, 11 Apr 2012 17:17:23 +0200	[thread overview]
Message-ID: <4F85A083.2020302@gmail.com> (raw)
In-Reply-To: <201204111159.18537.gineera@aspect135.co.uk>

Hi Alan,

On 11.04.2012 12:59, Alan Horstmann wrote:
> Thanks for your helpful replies; responses below.
> 
> On Sunday 08 April 2012 15:12, Daniel Mack wrote:
>> On 06.04.2012 23:09, Alan Horstmann wrote:
>>> At present I am involved with resolving some issues that have arisen from
>>> people using the Audio 4DJ interface with Portaudio, and I hoped it would
>>> be OK to check a few Alsa details with you?  Unfortunately I have limited
>>> experience of USB audio.
>>
>> What are those issues? Can you elaborate?
> 
> These are essentially issues in the way Portaudio interfaces; I am not 
> suggesting driver bugs etc, but in summary:
> 
> a) The Audio 4DJ uses fixed _BE format, almost uniquely AFAICT from grepping 
> driver source tree.  Portaudio at present requests formats in the host 
> platform endianness - so on a x86 PC an acceptable format is not available 
> from the 'hw' device.  Users seem reluctant to use 'plughw'.

Erm. Class compliant USB cards speak _LE formats only, and I'm not aware
of any hardware that is able to switch endianess on a run-time
configuration base. Does that mean PortAudio is unable to feed these
cards on BE hosts like PowerPC? Does the sound output endianess always
have to match the audio stream format? I certainly doubt that.

>From what I know, PortAudio is just a thin layer on top of ALSA and
other sound APIs to ease the pain of cross-platform development of audio
applications, right? What's wrong with letting ALSA convert the samples
for you then?

> b) Subdevices are not enumerated by Portaudio at present, and so only 2 of the 
> 4 channels can be accessed.  If the unit had presented a single 4-channel 
> device all the channels would have been available.

Ok, I see your problem, but certainly, PortAudio is the place to get
this fixed, not the driver.

>> The device itself implements 4 audio channels which are synced to each
>> other. In other words: the hardware is not able to only enable one of
>> them and leave the other ones paused or set sample rates individually.
>>
>> When I implemented the driver, it seem most logical to follow the way
>> the device denotes it channels though. The documentation and silk screen
>> presents them as pairs of stereo, and so the driver does the same thing.
> 
> I am just interested whether you think it would be possible for the driver to 
> be modified to support a single 4-ch device, perhaps through a module option?

Technically, it would certainly. But the problem is that there are quite
a number of applications out there using these devices and making their
assumptions about the implementation as it stands. So we won't accept a
patch that changes the behaviour of these cards for all users.

So clearly, the issues you're seeing are due to missing features in
PortAudio, and it should be fairly easy to add them there.


Daniel

  reply	other threads:[~2012-04-11 15:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-06 21:09 USB audio devices on Audio 4DJ and similar Alan Horstmann
2012-04-08 14:12 ` Daniel Mack
2012-04-11 10:59   ` Alan Horstmann
2012-04-11 15:17     ` Daniel Mack [this message]
2012-04-11 15:20       ` Daniel Mack
2012-04-11 17:00       ` Alan Horstmann
2012-04-11 17:10         ` Daniel Mack
2012-04-12  7:34         ` Takashi Iwai
2012-04-16 20:55   ` When to use sub-devices? (was Re: USB audio devices on Audio 4DJ and similar) Mark Hills

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=4F85A083.2020302@gmail.com \
    --to=zonque@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=gineera@aspect135.co.uk \
    /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).