Re: Identifying MPEG-4 HE-AAC (LATM, LAOS) audio formats

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 09.12.24 um 18:23 schrieb Marko Mäkelä:
Fri, Dec 06, 2024 at 10:31:06PM +0100, schorpp wrote:
Am 06.12.24 um 21:32 schrieb Marko Mäkelä:
A couple of weeks ago, Finland took the penultimate step to get rid of DVB-T. Since years, we had DVB-T and DVB-T2 running in parallel. The DVB-T transponders should be shut down in 2025.

same here but h.265 video and aac audio.

Right, it's H.265 video in Germany. I found somewhere a reference to something that would transcode H.265 into H.264 on the fly on a Raspberry Pi 3, so that the Videocore GPU could play it in real time.

Get a 4B at no cost. h.265 h/w decoding supported (at least with libreelec).


The VDR channel search failed to find this transponder; I ran a patched version of https://github.com/mighty-p/t2scan/pull/15/ to generate a new channels.conf. (Is this a bug of VDR, or a feature? I remember that when I originally set up VDR, I had to get a channels.conf from tscan or t2scan.)

have You tried the latest git version of scan in dvb-utils @linuxtx.org repo?

At https://git.linuxtv.org/v4l-utils.git I found a reference to the command dvbv5-scan. An "apt search dvbv5-scan" on my Debian Sid as well as on Raspbian 12.8 yielded two packages: dvb-tools and w-scan-cpp. I vaguely remember that I had used the latter one a few years ago. I just invoked the following on the Raspberry Pi:

w_scan_cpp -c FI

The output during scanning looks convincing, but the program seems to get stuck waiting for something at the end, for several minutes.

I also tried to invoke dvbv5-scan from dvb-tools, but it seems to require a file that contains some initial parameters.

Anyway, I was mainly wondering if it is normal that the EPG update in VDR did not find the new transponder. I guess it is; the search space would be huge if it had to cover satellite, cable, terrestrial and some IPTV sources as well.

The HE-AAC support in rpihddevice is experimental,

as it has been in ffmpeg until today and rpihddevive is based on it?

As in:

#ifdef ENABLE_AAC_LATM
#warning "experimental AAC-LATM frame parser enabled, only 2ch/48kHz supported!"
#endif

Maybe subscribe and CC the ffmpeg-devel list, the alsa guys look too busy.


Have You tried the latest git ffprobe version, does it detect the aac flavor of Your dvb-t2 DVB channels correctly?

I only have 2-channel recordings or DVB-T2 streams available to me. Those already play without any problems. But I don't have any recording with multichannel audio. I would like to implement correct detection and playback of multichannel HE-AAC audio, so that the AAC audio support could be enabled by default in rpihddevice.

Have You tried latest git mediainfo?

I was reading the libmediainfo source code a few days ago. I guess I should just have executed mediainfo on an MPEG-4 TS file inside a debugger, to find out how and where exactly it detects the audio parameters.

Not at all academic. Since AVRs do not implement Fraunhofer codecs we need a HDNI PCM Multichannel driver for the raspberry pi to playback 5.1 channel aac without transcoding it to ac3 which can be done with mplayer on the fly.

Right, also according to the NorDig specification, some transcoding of audio is mandatory for some audio output options.

I've made a HDMI PCM Multichannel output to AVR driver patch for the Allwinner SoC alsa audio driver, look for it on the alsa-dev list archives.

Sorry, I could not find it.

I not too. strange, as i've reactivated my account some weeks before there it was there. Maybe some list admin removed it, I can remember license issues with Allwinner.

I've attached the patch for You here, it was easy to implement, but the driver frontend is incomplete but pulseaudio pavucontrol corrects it, I've provided a detailed setup description on alsa-devel mailinglist.

-Attachment 1: sunxi Allwinner HDMI driver Multichannel PCM patch-

I figured out that AVR here must refer to Audio Video Receiver. The only HDMI output devices that I have are displays with 2 built-in speakers. I believe that I am currently using 2-channel PCM audio output.

Get the cheapest DENON AVR for ~200 EUR! Surround Sound is great, without HDTV and bluray is nothing and many stereo sources are dolby pro logic 2 encoded allowing AVR DSPs decoding to 5.1 channel :)


Are there any sample MPEG TS recordings with 5.1 channel AAC audio?

Search Fraunhofer websites for reference samples.

I've a huge archive of dvd backups here, aac 5.1 sample is attached.

Imported with GPAC, if You like the ffmpeg encoders backup a DD/DTS5.1 audio dvd ;)

-Attachment 2: mp4 sample file-

But it's AAC LC if detected correctly:

schorpp@tom3:~$ ffprobe /mnt/data/filme/AAC51channel-sample.mp4
ffprobe version 4.4.5 Copyright (c) 2007-2024 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
configuration: --disable-decoder=amrnb --disable-decoder=libopenjpeg --disable-gnutls --disable-liblensfun --disable-libopencv --disable-podpages --disable-sndio --disable-stripping --enable-avfilter --enable-avresample --enable-chromaprint --enable-frei0r --enable-gcrypt --enable-gpl --enable-ladspa --enable-libaom --enable-libaribb24 --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libdavs2 --enable-libdc1394 --enable-libdrm --enable-libfdk-aac --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libkvazaar --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-nonfree --enable-openal --enable-opencl --enable-opengl --enable-openssl --enable-postproc --enable-pthreads --enable-shared --enable-version3 --enable-vulkan --incdir=/usr/include/x86_64-linux-gnu --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr --toolchain=hardened --enable-vaapi --enable-libmfx --enable-libvmaf --enable-libilbc --disable-altivec --shlibdir=/usr/lib/x86_64-linux-gnu
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/mnt/data/filme/AAC51channel-sample.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf58.76.100
  Duration: 00:01:00.01, start: 0.000000, bitrate: 408 kb/s
Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 407 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
schorpp@tom3:~$

That would be very helpful. In a 2-channel setup, would it be customary to pass through only the first 2 channels and ignore the rest?

VLC is easiest to configure multichannel audio with 5.1 audio output devices and 5.1 to stereo downmix.


     Marko

y
tom
diff --git a/drivers/video/sunxi/hdmi/drv_hdmi.c b/drivers/video/sunxi/hdmi/drv_hdmi.c
index 283d2ae..9cf2cc2 100644
--- a/drivers/video/sunxi/hdmi/drv_hdmi.c
+++ b/drivers/video/sunxi/hdmi/drv_hdmi.c
@@ -314,7 +314,7 @@ __s32 Hdmi_init(struct platform_device *dev)
 	if (err)
 		return err;
 
-	audio_info.channel_num = 2;
+	audio_info.channel_num = 8;
 #if 0
 	{ /* for audio test */
 		hdmi_audio_t audio_para;
diff --git a/sound/soc/sunxi/hdmiaudio/sndhdmi.c b/sound/soc/sunxi/hdmiaudio/sndhdmi.c
index 1c306d2..4563010 100644
--- a/sound/soc/sunxi/hdmiaudio/sndhdmi.c
+++ b/sound/soc/sunxi/hdmiaudio/sndhdmi.c
@@ -85,7 +85,9 @@ static int sndhdmi_hw_params(struct snd_pcm_substream *substream,
 		return -EINVAL;
 	}
 
-	if (4 == hdmi_para.channel_num)
+	if (2 < hdmi_para.channel_num)
+		hdmi_para.channel_num = 8;
+	if (2 > hdmi_para.channel_num)
 		hdmi_para.channel_num = 2;
 
 	g_hdmi_func.hdmi_set_audio_para(&hdmi_para);
@@ -129,11 +131,11 @@ struct snd_soc_dai_ops sndhdmi_dai_ops = {
 /* codec dai */
 struct snd_soc_dai_driver sndhdmi_dai = {
 	.name = "sndhdmi",
-	/* playback capabilities */
+	/* playback capabilities, hdmi_core::audio_config() claims 8ch cap */
 	.playback = {
 		.stream_name = "Playback",
-		.channels_min = 1,
-		.channels_max = 2,
+		.channels_min = 2,
+		.channels_max = 8,
 		.rates = SNDHDMI_RATES,
 		.formats = SNDHDMI_FORMATS,
 	},
diff --git a/sound/soc/sunxi/hdmiaudio/sunxi-hdmiaudio.c b/sound/soc/sunxi/hdmiaudio/sunxi-hdmiaudio.c
index 12da1a6..80dd3b9 100644
--- a/sound/soc/sunxi/hdmiaudio/sunxi-hdmiaudio.c
+++ b/sound/soc/sunxi/hdmiaudio/sunxi-hdmiaudio.c
@@ -34,8 +34,8 @@
 #include <plat/sys_config.h>
 #include <plat/dma_compat.h>
 
-static struct sunxi_dma_params sunxi_hdmiaudio_pcm_stereo_out = {
-	.client.name	=	"HDMIAUDIO PCM Stereo out",
+static struct sunxi_dma_params sunxi_hdmiaudio_pcm_iec60958_out = {
+	.client.name	=	"HDMIAUDIO PCM IEC60958 out",
 #if defined CONFIG_ARCH_SUN4I || defined CONFIG_ARCH_SUN5I
 	.channel	=	DMACH_HDMIAUDIO,
 #endif
@@ -67,7 +67,7 @@ static int sunxi_hdmiaudio_hw_params(struct snd_pcm_substream *substream,
 	rtd = substream->private_data;
 
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
-		dma_data = &sunxi_hdmiaudio_pcm_stereo_out;
+		dma_data = &sunxi_hdmiaudio_pcm_iec60958_out;
 	else
 		printk("error:hdmiaudio can't support capture:%s,line:%d\n",
 							__func__, __LINE__);
@@ -182,8 +182,8 @@ static struct snd_soc_dai_driver sunxi_hdmiaudio_dai = {
 	.resume			= sunxi_hdmiaudio_resume,
 	.remove			= sunxi_hdmiaudio_dai_remove,
 	.playback		= {
-		.channels_min	= 1,
-		.channels_max	= 2,
+		.channels_min	= 2,
+		.channels_max	= 8,
 		.rates		= SUNXI_HDMI_RATES,
 		.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE,
 	},
diff --git a/sound/soc/sunxi/hdmiaudio/sunxi-hdmipcm.c b/sound/soc/sunxi/hdmiaudio/sunxi-hdmipcm.c
index 4916b51..3266061 100644
--- a/sound/soc/sunxi/hdmiaudio/sunxi-hdmipcm.c
+++ b/sound/soc/sunxi/hdmiaudio/sunxi-hdmipcm.c
@@ -45,8 +45,8 @@ static const struct snd_pcm_hardware sunxi_pcm_hardware = {
 					SNDRV_PCM_RATE_KNOT,
 	.rate_min		= 8000,
 	.rate_max		= 192000,
-	.channels_min		= 1,
-	.channels_max		= 2,
+	.channels_min		= 2,
+	.channels_max		= 8,
 	.buffer_bytes_max	= 128*1024, /* value must be (2^n)Kbyte size */
 	.period_bytes_min	= 1024*4,
 	.period_bytes_max	= 1024*32,
@@ -347,7 +347,7 @@ static void sunxi_pcm_free_dma_buffers(struct snd_pcm *pcm)
 	struct snd_dma_buffer *buf;
 	struct snd_pcm_substream *substream;
 
-	for (stream = 0; stream < 2; stream++) {
+	for (stream = 0; stream < 8; stream++) {
 		substream = pcm->streams[stream].substream;
 		if (!substream)
 			continue;
@@ -375,6 +375,8 @@ static int sunxi_pcm_new(struct snd_soc_pcm_runtime *rtd)
 	if (!card->dev->coherent_dma_mask)
 		card->dev->coherent_dma_mask = 0xffffffff;
 
+	strcpy(rtd->pcm->name, "sunxi HDMI PCM");
+
 	if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
 		ret = sunxi_pcm_preallocate_dma_buffer(pcm,
 			SNDRV_PCM_STREAM_PLAYBACK);

Attachment: AAC51channel-sample.mp4
Description: video/mp4


[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux