By Date: <-- -->
By Thread: <-- -->

RFC: Improve rxsubchans/audmode definition



The current flags for the rxsubchans field in struct v4l2_tuner 
(VIDIOC_G_TUNER) to denote the received (sub)channels is insufficiently 
precise. In particular NICAM support is poor.

This proposal attempts to fix that by giving a precise list of flags 
that need to be set for each type of transmission.

In my view the rxsubchans field should report which channels are being 
transmitted. Options are: mono (always present), stereo (not really a 
stereo channel but instead it encodes the difference between the left 
and right channels, which is used in combination with the mono channel 
to reconstruct a stereo signal), lang2/sap, lang1 (NICAM only).

Below I give a list of all combinations for each TV standard, and what 
the meaning of audmode will be.

NTSC:

NTSC (or more precisely: the BTSC audio standard) supports four 
possibilities:

MONO, MONO+STEREO, MONO+SAP, MONO+STEREO+SAP

So there can be up to three audio channels that are transmitted. audmode 
settings of mono, stereo or lang2 select the obvious audio channels. An 
audmode setting of lang1 selects stereo if possible, otherwise mono. A 
dual audmode setting selects mono+sap, else stereo, else mono.

PAL/SECAM:

PAL (or more precisely: the A2 audio standard) supports three options:

MONO, MONO+STEREO, MONO+LANG2

Audmode values of mono, stereo or lang2 do the obvious thing. An audmode 
setting of lang1 selects stereo if possible, otherwise mono. If audmode 
is set to dual, then if possible mono+lang2 is used, else stereo, else 
mono.

PAL/SECAM with NICAM:

The NICAM digital audio transmission used by PAL/SECAM can have the 
following channel combinations:

MONO+STEREO
MONO+LANG1
MONO+LANG1+LANG2

MONO is always the analog mono sound transmission. STEREO means that the 
NICAM digital audio encodes stereo audio (real stereo, the analog MONO 
is not used). LANG1 indicates that the NICAM digital audio encodes mono 
audio (this usually is the same language as the analog channel, but it 
does not have to be). LANG1+LANG2 indicates that the NICAM digital 
audio is a bilingual transmission. Again, usually LANG1 is the same 
language as the MONO channel, but not necessarily.

In theory NICAM can also transmit data, so a DATA flag could also be 
introduced, however there is nothing at the moment that can use it.

The audmode handling for mono and lang2 is obvious. If audmode selects 
stereo, then stereo is chosen if available, otherwise LANG1. If audmode 
is lang1, then lang1 is selected if possible, otherwise stereo. If 
audmode if dual, then lang1+lang2 is chosen if possible, otherwise 
stereo, otherwise lang1.

Radio:

For radio two combinations are possible:

MONO, MONO+STEREO.

Actually, a RDS flag might also be appropriate here if a RDS signal can 
be detected. However, no such flag exists at the moment.

Summary:

This proposal would directly map the detected channels to a rxsubchans 
flag. It would also make much more sense for NICAM. E.g. a combination 
like MONO+LANG1+LANG2 is not forseen in the current rxsubchans 
definition. Also a single 'STEREO' value makes no sense as a single 
channel, since it really is a combination of a L+R and a L-R channel 
(except for NICAM stereo).

It also should clarify that selecting audmode MONO means that the MONO 
channel should be output if possible, not a STEREO transmission that is 
later 'monoized' by averaging the left and right channels.

Having looked at how various drivers currently set the rxsubchans values 
it is clear that there has been much confusion over the rxsubchans and 
audmode fields. Given that the v4l1 API is going to be dropped I think 
now is a good time to update the v4l2 definition of these fields before 
the v4l1 drivers are converted.

Comments are welcome.

Regards,

	Hans Verkuil

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request (at) redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list