Skip to content

Commit

Permalink
Small ui improvements & pi audio (#675)
Browse files Browse the repository at this point in the history
* show N/A when no info is available on those extra system(s), too

* show N/A when no info is available on those extra system(s), too

* exp rpi 4 audio playback

* exp rpi 4 audio playback

* exp rpi 4 audio playback
  • Loading branch information
Consti10 authored Mar 19, 2024
1 parent e15e29c commit f9d8e3d
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 12 deletions.
15 changes: 14 additions & 1 deletion app/videostreaming/gstreamer/gstrtpaudioplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <sstream>

#include <logging/logmessagesmodel.h>
#include "../util/qopenhd.h"

G_BEGIN_DECLS
// The static plugins we use
Expand Down Expand Up @@ -79,7 +80,19 @@ static std::string construct_gstreamer_pipeline(){
//ss<<"udpsrc port=5610 caps=\"application/x-rtp, media=(string)audio, clock-rate=(int)8000, encoding-name=(string)L16, encoding-params=(string)1, channels=(int)1, payload=(int)96\" ! rtpL16depay ! queue ! autoaudiosink sync=false";
ss<<"udpsrc port=5610 caps=\"application/x-rtp, media=(string)audio, clock-rate=(int)8000, encoding-name=(string)PCMA\"";
ss<<" ! rtppcmadepay ! audio/x-alaw, rate=8000, channels=1 ! alawdec ! ";
ss<<"autoaudiosink sync=false";
if(QOpenHD::instance().is_platform_rpi()){
// RPI FKMS HDMI 0 is card 0, device 0
// BCM audio (the headphone jack) is card 1, device 0
// We 'just' send things to both of them ;)
ss<<" tee name=t ! queue ! ";
ss<<"alsasink device=hw:0,0 "; // No '!' needed before tee
ss<<"t. ! queue ! ";
ss<<"alsasink device=hw:1,0";
//ss<<"alsasink device=hw:3,0";
}else{
ss<<"autoaudiosink sync=false";
}
//ss<<"autoaudiosink sync=false";
//ss<<"openslessink";
return ss.str();
}
Expand Down
49 changes: 38 additions & 11 deletions qml/ui/sidebar/MavlinkChoiceElement2.qml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ BaseJoyEditElement2{
onVisibleChanged: {
if(visible){
populate();
extra_populate();
}
}

Expand Down Expand Up @@ -221,26 +222,52 @@ BaseJoyEditElement2{
// -------------- EXTRA --------------
property int curr_channel_mhz: _ohdSystemAir.curr_channel_mhz
onCurr_channel_mhzChanged: {
if(m_param_id==mPARAM_ID_FREQUENCY){
update_display_text(curr_channel_mhz);
m_param_exists=true;
}
extra_populate();
}
property int curr_mcs_index:_ohdSystemAir.curr_mcs_index;
onCurr_mcs_indexChanged: {
if(m_param_id==mPARAM_ID_RATE){
update_display_text(curr_mcs_index);
m_param_exists=true;
}
extra_populate();
}
property int curr_bandwidth_mhz: _ohdSystemAir.curr_channel_width_mhz
onCurr_bandwidth_mhzChanged: {
if(m_param_id==mPARAM_ID_CHANNEL_WIDTH){
extra_populate();
}
function extra_populate(){
if(!(m_param_id==mPARAM_ID_CHANNEL_WIDTH || m_param_id==mPARAM_ID_FREQUENCY || m_param_id==mPARAM_ID_RATE)){
return;
}
// First, check if the system is alive
if(!m_settings_model.system_is_alive()){
// Do not enable the elements, system is not alive
m_param_exists=false;
populate_display_text="N/A";
return;
}
if(m_param_id==mPARAM_ID_FREQUENCY){
if(curr_channel_mhz<=0){
m_param_exists=false;
populate_display_text="N/A";
return;
}
update_display_text(curr_channel_mhz);
m_param_exists=true;
}else if(m_param_id==mPARAM_ID_RATE){
if(curr_mcs_index<0){
m_param_exists=false;
populate_display_text="N/A";
return;
}
update_display_text(curr_mcs_index);
m_param_exists=true;
}else if(m_param_id==mPARAM_ID_CHANNEL_WIDTH){
if(curr_bandwidth_mhz<=0){
m_param_exists=false;
populate_display_text="N/A";
return;
}
update_display_text(curr_bandwidth_mhz);
m_param_exists=true;
}
}



}

0 comments on commit f9d8e3d

Please sign in to comment.