hda: fixes KDL on HDMI, some digital quirks

* avoid crashing in case of lack of playback or record stream
* set format on digital output widgets
* accept digital output on the output path
This commit is contained in:
Jerome Duval 2012-11-12 21:14:43 +01:00
parent 1e6ae0de3a
commit 25a627d880
3 changed files with 13 additions and 2 deletions

View File

@ -1011,6 +1011,7 @@ TRACE("build output tree: %suse mixer\n", useMixer ? "" : "don't ");
int device = CONF_DEFAULT_DEVICE(widget.d.pin.config);
if (device != PIN_DEV_HEAD_PHONE_OUT
&& device != PIN_DEV_DIGITAL_OTHER_OUT
&& device != PIN_DEV_SPEAKER
&& device != PIN_DEV_LINE_OUT)
continue;

View File

@ -770,6 +770,14 @@ hda_stream_setup_buffers(hda_audio_group* audioGroup, hda_stream* stream,
hda_send_verbs(codec, verb, response, 2);
//channelNum += 2; // TODO stereo widget ? Every output gets the same stream for now
dprintf("%ld ", stream->io_widgets[i]);
hda_widget* widget = hda_audio_group_get_widget(audioGroup,
stream->io_widgets[i]);
if ((widget->capabilities.audio & AUDIO_CAP_DIGITAL) != 0) {
verb[0] = MAKE_VERB(codec->addr, stream->io_widgets[i],
VID_SET_DIGITAL_CONVERTER_CONTROL1, format);
hda_send_verbs(codec, verb, response, 1);
}
}
dprintf("\n");

View File

@ -892,12 +892,14 @@ get_buffers(hda_audio_group* audioGroup, multi_buffer_list* data)
|| data->return_record_buffers < STREAM_MIN_BUFFERS)
data->return_record_buffers = STREAM_MIN_BUFFERS;
if (data->return_playback_buffer_size == 0) {
if (data->return_playback_buffer_size == 0
&& audioGroup->playback_stream != NULL) {
data->return_playback_buffer_size = default_buffer_length_for_rate(
audioGroup->playback_stream->sample_rate);
}
if (data->return_record_buffer_size == 0) {
if (data->return_record_buffer_size == 0
&& audioGroup->record_stream != NULL) {
data->return_record_buffer_size = default_buffer_length_for_rate(
audioGroup->record_stream->sample_rate);
}