jpoet / HauppaugeUSB

MythTV wrapper around the Hauppauge HD-PVR2/Colossus2 driver
GNU General Public License v3.0
16 stars 5 forks source link

Initializing CS8416 chip doesn't work on devices without S/PDIF #6

Closed stevenviola closed 5 years ago

stevenviola commented 5 years ago

On models of the PVR2 which don't include S/PDIF, specifically model 157310, whenever trying to record any input, HauppaugeUSB exits out with the following error message:

000:00:04.867405 N 29875 [main] HauppaugeDev.cpp:127 (set_input_format) - Input width: 1920 height: 1080 interlaced: 1 vFreq: 60 audio SR: 0
000:00:04.867625 E 29875 [main] FX2Device.cpp:115 (I2CWriteRead) - I2C: Improper answer: status 07
terminate called after throwing an instance of 'std::runtime_error'
  what():  CS8416: device is not ready

This appears to be because the CS8416 chipset is being initialized regardless of what the audio input is. The same issue occurs when trying to use HDMI on models without S/PDIF, making it impossible to use HauppaugeUSB with this particular model. I am unsure of why CS8416 is being used when the audio input is HDMI, but testing on two different models (157310 & 157320), removing the CS8416 audio selection has no impact on the HDMI audio input.

Keeping all of the audio_CS8416 stuff in the spdif conditional ensures PVR2 devices without S/PDIF input are still able to run.

jpoet commented 5 years ago

Hi Steven. Thank you for tracking this down. Unfortunately, your proposed patch breaks AC3 via HDMI. I have just pushed a change which hopefully fixes the issues for you, while maintaining that functionality.

stevenviola commented 5 years ago

Awesome, I didn't realize that was needed for getting AC3 on HDMI. I think the initializing of audio_CS8416 needs to happen within the try statement though, since that will still cause errors whey just trying to record any input type (such as component) on models without the chipset. This is what originally turned me on to the issue. I've modified the PR to include this and to keep your changes in place so we can still use AC3 audio on HDMI if the chipset is available.

jpoet commented 5 years ago

Thank you Steven. I have pushed that change.