vdr uses this ioctl to check the currently selected audio channel:
     audio_status_t as;
     CHECK(ioctl(fd_audio, AUDIO_GET_STATUS, &as));
     return as.channel_select;

see also /usr/include/linux/dvb/audio.h:

typedef struct audio_status {
        int                    AV_sync_state;  /* sync audio and video? */
        int                    mute_state;     /* audio is muted */
        audio_play_state_t     play_state;     /* current playback state */
        audio_stream_source_t  stream_source;  /* current stream source */
        audio_channel_select_t channel_select; /* currently selected channel */
        int                    bypass_mode;    /* pass on audio data to */
        audio_mixer_t          mixer_state;    /* current mixer state */
} audio_status_t;                              /* separate decoder hardware */

The corresponding ioctl to set a new audio channel is AUDIO_CHANNEL_SELECT, 
and this is supported by ivtv. But as ivtv has no AUDIO_GET_STATUS, I can`t 
use the function properly with vdr.

And there is another problem: 
ivtv uses a different ioctl (AUDIO_BILINGUAL_CHANNEL_SELECT) in case the 
decoder receives a bilingual audio. Maybe I will have to think longer about 
it, but it seems to be unnecessarily complicated. 

To use the right ioctl I would need to know if the driver is in 
audio_stereo_mode or audio_bilingual_mode. How can I detect this? 
AUDIO_GET_STATUS has no value for it.

Or should I simply call always two different ioctls? But then again, why 
does AUDIO_CHANNEL_SELECT not set both values for 
CX2341X_DEC_SET_AUDIO_MODE ? My understanding is that every time an 
application uses AUDIO_CHANNEL_SELECT it wants to change the current audio 
channel immidiately - no matter if the stream is stereo or bilingual.

I think the driver could set the default behaviour (initial setting) without 
having two different ioctls.

Greets,

Martin

_______________________________________________
ivtv-devel mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-devel

Reply via email to