mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-02-16 02:20:42 +00:00
Debug messages about alsa audio done in java
This commit is contained in:
@@ -43,8 +43,6 @@ int nv_alsa_play(const unsigned char* indata, int data_len) {
|
||||
int frames = data_len/4; /* 2 bytes/sample, 2 channels */
|
||||
int rc = snd_pcm_writei(handle, indata, frames);
|
||||
if (rc == -EPIPE) {
|
||||
/* EPIPE means underrun */
|
||||
fprintf(stderr, "underrun occurred\n");
|
||||
snd_pcm_prepare(handle);
|
||||
} else if (rc < 0) {
|
||||
fprintf(stderr,
|
||||
@@ -53,7 +51,9 @@ int nv_alsa_play(const unsigned char* indata, int data_len) {
|
||||
} else if (rc != (int) frames) {
|
||||
fprintf(stderr,
|
||||
"short write, write %d frames\n", rc);
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int nv_alsa_close(void) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.limelight.binding.audio;
|
||||
|
||||
import com.limelight.LimeLog;
|
||||
import com.limelight.nvstream.av.audio.AudioRenderer;
|
||||
|
||||
/**
|
||||
@@ -23,7 +24,12 @@ public class AlsaAudioRenderer implements AudioRenderer {
|
||||
|
||||
@Override
|
||||
public void playDecodedAudio(byte[] bytes, int offset, int length) {
|
||||
AlsaAudio.play(bytes, offset, length);
|
||||
int rc = AlsaAudio.play(bytes, offset, length);
|
||||
|
||||
if (rc<0)
|
||||
LimeLog.warning("Alsa error from writei: "+rc);
|
||||
else if (rc!=length/4)
|
||||
LimeLog.warning("Alsa short write, write "+rc+" frames");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user