diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2012-01-02 00:14:44 +0100 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2012-01-02 00:14:44 +0100 |
commit | 4236fc397aaf1ebc0b0cb375c4b9e02d50aec604 (patch) | |
tree | 354c0c86550427d5313bbc6bbb00b95fc9186667 | |
parent | 352dad23c7847d234e11c1034e1354fbd9a8349a (diff) | |
download | fmrxd-4236fc397aaf1ebc0b0cb375c4b9e02d50aec604.tar.gz fmrxd-4236fc397aaf1ebc0b0cb375c4b9e02d50aec604.zip |
workaround a race condition on startup
-rw-r--r-- | capture.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -112,10 +112,14 @@ bool configure_mixer(bool on) if (on) { res = mixer_set_enum_value(mixer, "Mode Switch", "Rx"); + // The above uploads firmware and a few other things, + // so let's give it some time. + usleep(500000); res &= mixer_set_enum_value(mixer, "Codec Mode", "FmRx"); res &= mixer_set_enum_value(mixer, "Audio Switch", "Digital"); } else { - res = mixer_set_enum_value(mixer, "Codec Mode", "Bt"); + res = mixer_set_enum_value(mixer, "Audio Switch", "Analog"); + res &= mixer_set_enum_value(mixer, "Codec Mode", "Bt"); res &= mixer_set_enum_value(mixer, "Mode Switch", "Off"); } |