Skip to content

Commit

Permalink
switch to custom tinyplay
Browse files Browse the repository at this point in the history
  • Loading branch information
funneld committed Feb 2, 2023
1 parent 16f2557 commit 9a4cda7
Show file tree
Hide file tree
Showing 14 changed files with 2,592 additions and 11 deletions.
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ all: jni/*

install: all
install -d ipk/airunit/data/opt/etc/preload.d/
install libs/armeabi-v7a/lib*.so ipk/airunit/data/opt/etc/preload.d/
install -d ipk/glasses/data/opt/etc/preload.d/
install libs/armeabi-v7a/liblive_audio_v2_au.so ipk/airunit/data/opt/etc/preload.d/
install libs/armeabi-v7a/libtinyalsa.so ipk/glasses/data/opt/etc/preload.d/
install libs/armeabi-v7a/tinyplay_udp ipk/glasses/data/opt/bin/

ipk: all
$(MAKE) -C ipk clean
$(MAKE) install
chmod +x ipk/glasses/data/opt/bin/tinyplay_udp
$(MAKE) -C ipk
mv ipk/airunit/*.ipk ./
mv ipk/glasses/*.ipk ./
Expand All @@ -17,4 +21,6 @@ clean:
rm -f *.ipk
rm -rf libs
rm -rf obj
rm ipk/airunit/data/opt/etc/preload.d/liblive_audio_v2_au.so
rm ipk/airunit/data/opt/etc/preload.d/liblive_audio_v2_au.so
rm ipk/glasses/data/opt/etc/preload.d/libtinyalsa.so
rm ipk/glasses/data/opt/bin/tinyplay_udp
2 changes: 1 addition & 1 deletion ipk/airunit/control/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: live-audio-v2-airside
Version: 0.0.4
Version: 0.0.5
Maintainer: funnel
Description: Live audio V2 airside.
Homepage: https://github.com/funneld/djifpv_live_audio_V2
Expand Down
3 changes: 2 additions & 1 deletion ipk/airunit/data/opt/bin/live_audio_v2_airside.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ if grep -q "WM150" /system/etc/dji.json; then
echo "SD card found. Live audio will start only while recording."
else
echo "No SD card found. Start tinycap."
LD_PRELOAD="/opt/etc/preload.d/liblive_audio_v2_au.so" tinycap /dev/null -r 48000 -b 16
sleep 3
LD_PRELOAD="/opt/etc/preload.d/liblive_audio_v2_au.so" tinycap /dev/null -r 48000 -b 16 > /dev/null 2>&1
fi
else
echo "Airunit not compatible. Exit."
Expand Down
4 changes: 2 additions & 2 deletions ipk/glasses/control/control
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: live-audio-v2-glasses
Version: 0.0.2
Version: 0.0.3
Maintainer: funnel
Description: Live audio V2.
Homepage: https://github.com/funneld/djifpv_live_audio_V2
Architecture: pigeon-glasses
Depends: dinit, ffmpeg
Depends: dinit
4 changes: 2 additions & 2 deletions ipk/glasses/data/opt/bin/live_audio_v2_glasses.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/system/bin/sh

mkfifo /tmp/audiopipe
ffmpeg -y -probesize 32 -fflags nobuffer -flags low_delay -err_detect aggressive -fflags discardcorrupt -f u16le -ar 48000 -ac 2 -i udp://localhost:45151 -f u16le /tmp/audiopipe | tinyplay /tmp/audiopipe -i raw -d 0 -r 48000 -b 16 -c 2
sleep 5
LD_PRELOAD="/opt/etc/preload.d/libtinyalsa.so" /opt/bin/tinyplay_udp > /dev/null 2>&1
18 changes: 15 additions & 3 deletions jni/Android.mk
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_CFLAGS += -fPIC -std=c99
LOCAL_CFLAGS += -fPIC -std=c99 -O3
LOCAL_LDFLAGS += -fPIC
LOCAL_LDLIBS := -llog

LOCAL_MODULE := live_audio_v2_au
LOCAL_SRC_FILES := live_audio_v2_au.c
include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_CFLAGS += -fPIC -std=c99 -O3
LOCAL_LDFLAGS += -fPIC
LOCAL_SRC_FILES:= tinyalsa/mixer.c tinyalsa/pcm.c
LOCAL_MODULE := libtinyalsa
include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_CFLAGS += -fPIC -std=c99 -O3
LOCAL_LDFLAGS += -fPIC
LOCAL_SRC_FILES:= tinyplay_udp.c
LOCAL_MODULE := tinyplay_udp
LOCAL_SHARED_LIBRARIES:= libtinyalsa
include $(BUILD_EXECUTABLE)
Loading

0 comments on commit 9a4cda7

Please sign in to comment.