Add Bluetooth audio/HID/discoverability/alias support, fix SD card hotplug & caller ID matching, and expand ReMEdy J2ME JSRs + 64MB GC
This commit is contained in:
1 parent
456d3fbc42
commit
471916424e
51 files changed
+2961
-305
No files matched your search
@@ -1007,8 +1007,24 @@ class PcmAudioOut {
|
||||
private:
|
||||
void audioThreadMain() {
|
||||
snd_pcm_t* h = nullptr;
|
||||
const char* devs[] = {"hw:0,0", "default", "plughw:0,0"};
|
||||
for (const char* dev : devs) {
|
||||
bool preferDefault = (::access("/run/bluetoothd.pid", F_OK) == 0);
|
||||
if (!preferDefault) {
|
||||
FILE* af = std::fopen("/tmp/sxmo_audio_out_device", "r");
|
||||
if (af) {
|
||||
char abuf[64] = {};
|
||||
if (std::fgets(abuf, sizeof(abuf), af)) {
|
||||
if (std::strstr(abuf, "Bluetooth") || std::strstr(abuf, "bluetooth")) {
|
||||
preferDefault = true;
|
||||
}
|
||||
}
|
||||
std::fclose(af);
|
||||
}
|
||||
}
|
||||
const char* devsHwFirst[] = {"hw:0,0", "default", "plughw:0,0"};
|
||||
const char* devsDefFirst[] = {"default", "hw:0,0", "plughw:0,0"};
|
||||
const char** devs = preferDefault ? devsDefFirst : devsHwFirst;
|
||||
for (int di = 0; di < 3; ++di) {
|
||||
const char* dev = devs[di];
|
||||
if (snd_pcm_open(&h, dev, SND_PCM_STREAM_PLAYBACK, 0) >= 0) {
|
||||
if (configureLowLatency(h)) {
|
||||
break;
|
||||
@@ -1018,7 +1034,8 @@ class PcmAudioOut {
|
||||
}
|
||||
}
|
||||
if (!h) {
|
||||
for (const char* dev : devs) {
|
||||
for (int di = 0; di < 3; ++di) {
|
||||
const char* dev = devs[di];
|
||||
if (snd_pcm_open(&h, dev, SND_PCM_STREAM_PLAYBACK, 0) >= 0) {
|
||||
if (snd_pcm_set_params(h, SND_PCM_FORMAT_S16_LE,
|
||||
SND_PCM_ACCESS_RW_INTERLEAVED, 2, 48000, 1,
|
||||
@@ -2253,6 +2270,10 @@ int main(int argc, char** argv) {
|
||||
usedByAction = true;
|
||||
}
|
||||
}
|
||||
if (!usedByAction && tok == "OK") {
|
||||
actionDown[ACT_A] = isPress;
|
||||
usedByAction = true;
|
||||
}
|
||||
if (isPress && !usedByAction) {
|
||||
if (tok == "1") {
|
||||
cfg.scaleMode = (cfg.scaleMode + 1) % 4;
|
||||
|
||||
Reference in new issue
Block a user