All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Anssi Hannula <anssi.hannula@iki.fi>
Cc: alsa-devel@alsa-project.org
Subject: Re: How to handle HBR pass-through? (new PCM_FORMAT?)
Date: Mon, 02 Aug 2010 18:20:35 +0200	[thread overview]
Message-ID: <s5hocdlm1f0.wl%tiwai@suse.de> (raw)
In-Reply-To: <201008021040.17380.anssi.hannula@iki.fi>

At Mon, 2 Aug 2010 10:40:17 +0300,
Anssi Hannula wrote:
> 
> pl bossart kirjoitti maanantai, 2. elokuuta 2010 06:18:35:
> > > What this means is that if just the needed HBR bits are set in the audio
> > > driver, one can play back e.g. TrueHD by passing the IEC-61937 stream to
> > > ALSA as 192kHz 8-channel 16-bit PCM data; of course normal 8-channel PCM
> > > playback wouldn't work anymore then. So the driver would need to know if
> > > this is 8- channel PCM or 8-channel compressed audio.
> > > 
> > > Which brings us to my question: How should the user be able to do this,
> > > i.e. inform the driver whether this is 8-channel PCM data or compressed
> > > audio data?
> > > 
> > > 
> > > One easy option would be to have a separate IEC61937_HBR format in ALSA
> > > which could be used for IEC-61937 streams represented as 8x 16-bit
> > > channels.
> > > 
> > > If that would be considered too specific, we could add a more generic
> > > IEC61937 format, which is the same as above except that "normal" ( = "2
> > > channel") IEC-61937 streams could be used as well. However, as normal
> > > IEC-61937 streams can be used with S/PDIF as well, we'd AFAICS need to
> > > add such format bit to all S/PDIF drivers or have a no-op converter to
> > > the more widely supported 16- bit PCM format.
> > 
> > Could we require that the user sets the channel status bits (with the
> > AESx controls) in case this is compressed. The driver would then make
> > an informed decision to use HBR packets instead of regular PCM 8-ch
> > layout2?
> 
> Indeed, the non-audio flag (AES0 & 0x02) could be used for this.
> 
> It seems the only always-available way to set those is as parameters in the 
> device string, correct?

Right.

> Will it always be reset after the user closes the device?

This is usually handled in alsa-lib.  But not in 100% guaranteed.

Some drivers have both "default" and "PCM" status bits -- the latter
is per PCM stream and re-initialized at each open/close.  But, many
drivers including HD-audio have only the former for simplicity.


> > At any rate, supporting such formats entails changes to higher levels
> > of the audio stack, for example gstreamer/alsasink would need
> > additional caps. Changes are not limited to the alsa driver I guess.
> 
> Yes.
> We are in the process of adding support in ffmpeg for the TrueHD-in-IEC61937 
> muxing and after that I'll add support into XBMC for using that functionality.
> 
> Looked at gstreamer, it seems to only have ac3-in-iec61937 support currently. 
> However, I'd guess gstreamer would additionally need some ways to 1) detect if 
> HBR is supported, and 2) detect if the connected receiver supports the 
> specific codec..

Reusing the existing IEC958 status bits is OK for practical POV,
indeed.  This makes also compatible with the existing user-space stuff.

But I feel a bit uncertain when looking forward for future
development.  More discussions needed.


thanks,

Takashi

  reply	other threads:[~2010-08-02 16:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-01 11:23 How to handle HBR pass-through? (new PCM_FORMAT?) Anssi Hannula
2010-08-02  3:18 ` pl bossart
2010-08-02  7:40   ` Anssi Hannula
2010-08-02 16:20     ` Takashi Iwai [this message]
2010-08-02 17:37       ` Anssi Hannula
2010-08-02 19:33       ` pl bossart
2010-08-03  5:51         ` 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=s5hocdlm1f0.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=anssi.hannula@iki.fi \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.