Permalink
Browse files

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
  • Loading branch information...
1 parent 1e6ae0d commit 25a627d8800361c42b1f29bd2f2d29b323e9cc2d @korli korli committed Nov 12, 2012
@@ -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;
@@ -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");
@@ -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);
}

0 comments on commit 25a627d

Please sign in to comment.