SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Github Development
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Github Development Discussion related to SageTV Open Source Development. Use this forum for development topics about the Open Source versions of SageTV, hosted on Github.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-06-2015, 07:39 PM
rbolande rbolande is offline
Sage User
 
Join Date: Sep 2015
Location: Colorado, USA
Posts: 9
No audio from Linux sageclient

I built sage from the github instructions instructions posted by stuckless and I think client and server are running well together....except for a lack of audio from the client software. I can play video, but I get no sound. I installed the sageclient from the .deb file created by the buildall.sh. In the miniclient.log I get the following output:

Quote:
Tue 10/6 18:48:29.545 stdout:ID_AUDIO_ID=0
Tue 10/6 18:48:29.545 stdout:ID_AID_0_LANG=eng
Tue 10/6 18:48:29.546 stdout:[mkv] Track ID 2: audio (A_AC3), -aid 0, -alang eng
Tue 10/6 18:48:29.546 stdout:ID_SUBTITLE_ID=0
Tue 10/6 18:48:29.547 stdout:ID_SID_0_LANG=und
Tue 10/6 18:48:29.551 Got connection on fd: 40
Tue 10/6 18:48:29.552 stdout:[mkv] Track ID 3: subtitles (S_TEXT/UTF8), -sid 0,
-slang und
Tue 10/6 18:48:29.552 stdout:[mkv] Will play video track 1.
Tue 10/6 18:48:29.552 stdout:Matroska file format detected.
Tue 10/6 18:48:29.552 stdout:VIDEO: [avc1] 1280x718 24bpp 23.976 fps 0.0
kbps ( 0.0 kbyte/s)
Tue 10/6 18:48:29.553 stdout:ID_FILENAME=stv://192.168.1.157//var/media/videos/<filename>.mkv
Tue 10/6 18:48:29.554 stderr:Requested audio codec family [a52] (afm=liba52) not
available.
Tue 10/6 18:48:29.554 stderr:Enable it at compilation.
Tue 10/6 18:48:29.554 stdout:ID_DEMUXER=mkv
Tue 10/6 18:48:29.555 stdout:ID_VIDEO_FORMAT=avc1
Tue 10/6 18:48:29.556 stderr:Requested audio codec family [ac3] (afm=libac3) not
available.
Tue 10/6 18:48:29.556 stderr:Enable it at compilation.
Tue 10/6 18:48:29.557 stderr:Requested audio codec family [hwac3] (afm=hwac3) no
t available.
Tue 10/6 18:48:29.557 stderr:Enable it at compilation.
Tue 10/6 18:48:29.557 stderr:Cannot find codec for audio format 0x2000.
From the output it looks like I need to "Enable it at compilation", but I can't really find any information on specifics of what I need to do. Any help would be appreciated.

Thanks,
REID
Reply With Quote
  #2  
Old 10-06-2015, 09:22 PM
rbolande rbolande is offline
Sage User
 
Join Date: Sep 2015
Location: Colorado, USA
Posts: 9
A little more info... If I connect my Linux client to my Windows server, I can get some audio on some video files. So it isn't as though the client cannot play any audio from videos. Is this simply an issue where some codecs were not included when I compiled it on Linux?

Thanks,
REID

Last edited by rbolande; 10-06-2015 at 09:27 PM.
Reply With Quote
  #3  
Old 10-07-2015, 05:32 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by rbolande View Post
A little more info... If I connect my Linux client to my Windows server, I can get some audio on some video files. So it isn't as though the client cannot play any audio from videos. Is this simply an issue where some codecs were not included when I compiled it on Linux?

Thanks,
REID
I think this is the full list of libraries you need (I took this from the vagrant files that I created)

Code:
apt-get install -y unzip \
		    build-essential \
		    git \
		    libx11-dev libxt-dev libraw1394-dev libavc1394-dev libiec61883-dev libfreetype6-dev yasm autoconf libtool openjdk-7-jdk libfaac0 \
		    libaudio-dev libpulse-dev libasound-dev
if you are using another java, then you can omit openjk7. And I think that after your tests, that libfaad2 and libfaad-dev needs to be added to that list.

https://github.com/stuckless/sagetv-...it/Vagrantfile
Reply With Quote
  #4  
Old 10-07-2015, 09:22 PM
rbolande rbolande is offline
Sage User
 
Join Date: Sep 2015
Location: Colorado, USA
Posts: 9
Thanks for your help! You guys got me headed in the right direction. I found that the issue was that my videos (some of them) have audio encoded using the a52 codec. In order to get things working, I had to do the following (note that I wanted to use jdk8):

Quote:
sudo add-apt-repository ppapenjdk-r/ppa
sudo apt-get update

sudo apt-get install -y --force-yes unzip build-essential git libx11-dev libxt-dev libraw1394-dev libavc1394-dev libiec61883-dev libfreetype6-dev yasm autoconf libtool openjdk-8-jdk libfaac0 libaudio-dev libpulse-dev libasound2-dev libfaad-dev libfaad2 liba52-dev

export JDK_HOME=/usr/lib/jvm/java-8-oracle/
export JAVA_ARCH=amd64
After this I had to edit the buildmplayer.sh to remove the --disable-a52 option.

Then a ./buildall.sh

and after that install the .deb package. This resolved the audio playback with some files and the video duration is read properly (as discussed under a separate thread). Now I just neeed to get the video thumbnails figured out and I'll be good.

Since running this build of the client (with the a52 codec compiled into mplayer) I have noticed some funkiness that I don't think was present before...I presume that is why a52 was disabled to begin with.

Thanks,
REID
Reply With Quote
  #5  
Old 12-05-2015, 10:30 AM
SageWizdom SageWizdom is offline
Sage Advanced User
 
Join Date: Oct 2013
Location: https://github.com/SageWizdom/SageConnect
Posts: 216
A quick grep shows the following. These are the only instances not in ffmpeg or mplayer

Quote:
LinuxMPlayerPlugin.java:448: "-vo xvmc:windowevents=0:ck=set -vc ffmpeg12mc, -cache-seek-min 0" + framedropStr;
miniclient/MiniMPlayerPlugin.java:472: cmdOpt2 = "-vo stv:socket=" + (myConn).getVideoSocket() + " -vc ffmpeg12,";
miniclient/MiniMPlayerPlugin.java:486: " -vo xvmc:windowevents=0:ck=set, -vc ffmpeg12mc, -cache-seek-min 0 -framedrop";
the "-vc" flag

Quote:
-vc <[-|+]codec1,[-|+]codec2,...[,]>
Specify a priority list of video codecs to be used, according to their codec
name in codecs.conf. Use a '-' before the codec name to omit it. Use a '+' before
the codec name to force it, this will likely crash! If the list has a trailing ',' MPlayer
will fall back on codecs not contained in the list.
NOTE: See -vc help for a full list of available codecs.

EXAMPLE:
-vc divx
Force Win32/VfW DivX codec, no fallback.
-vc -divxds,-divx,
Skip Win32 DivX codecs.
-vc ffmpeg12,mpeg12,
Try libavcodec's MPEG-1/2 codec, then libmpeg2, then others.
The comma after the name should allow it to try others... but I am guessing that since ffmpeg12 is in the list and is first in the list, that it uses it in that order. I'll dig in a little further and see if I can make sense of the java around these lines. Anyone remember the original reason for giving a codec list, versus just letting the player figure it out itself (like when I run it on the command line?)


LinuxMPlayerPlugin.java

Code:
  415                                 else*/ if(Sage.MAC_OS_X)
    416                                 {
    417                                   String ret = "";
    418 
    419                                   try {
    420                                     // we have to use reflection to get to the renderer...
    421                                     java.lang.Class reClass = uiMgr.getRootPanel().getRenderEngine().getClass();
    422                                     java.lang.reflect.Method gsvop = reClass.getMethod("getServerVideoOutParams", new Class[]{});
    423 
    424                                     ret = (String)gsvop.invoke(uiMgr.getRootPanel().getRenderEngine(), (Object[])null);
    425                                     //System.out.println("++++++++++++++++++++++++++++++++ macstv vo params: "+ret);
    426                                   } catch(Throwable t) {
    427                                     System.out.println("Exception occurred getting vo module params: "+t);
    428                                   }
    429 
    430                                   cmdOpt2 = ret + " -cache-seek-min 0" + framedropStr;
    431 
    432                                   // if "linux/audio_output_port" is set to SPDIF, add "-afm hwac3"
    433                                   if ("SPDIF".equals(Sage.get("linux/audio_output_port", "Analog")))
    434                                     cmdOpt2 += " -afm hwac3";
    435 
    436                                   canDoFastLoad = false;
    437                                 }
    438                                 else
    439                                 {
    440                                   if (!uiMgr.getBoolean("mplayer/xvmc", false))
    441                                   {
    442                                     cmdOpt2 = "-colorkey 0x"+Integer.toHexString(getDesktopColorKey())+
    443                                         " -vo xv:windowevents=0:ck=set  -cache-seek-min 0" + framedropStr;
    444                                   }
    445                                   else
    446                                   { // Using xvmc
    447                                     cmdOpt2 = "-colorkey 0x"+Integer.toHexString(getDesktopColorKey())+
    448                                         " -vo xvmc:windowevents=0:ck=set -vc ffmpeg12mc, -cache-seek-min 0" + framedropStr;
    449                                   }
    450                                 }
miniclient/MiniMPlayerPlugin.java:

Code:
if (MiniClient.MAC_OS_X)
    453             cmdOpts1 += " -loadmuted"; // we want MPlayer to start in a muted state
    454           // If the cache size is too small then when we pause MPlayer it may think it hit an EOS and
    455           // kill itself. 768 seems like an OK value, 512 was not big enough (testing with 256K streams)
    456           if ("true".equals(MiniClient.myProperties.getProperty("opengl", "true")))
    457           {
    458             if (MiniClient.MAC_OS_X) {
    459               try {
    460                 java.lang.Class reClass = gfxEngine.getClass();
    461                 java.lang.reflect.Method gsvop = reClass.getMethod("getServerVideoOutParams", new Class[]{});
    462 
    463                 cmdOpt2 = (String)gsvop.invoke(gfxEngine, (Object[])null);
    464                 if(cmdOpt2 == null) cmdOpt2 = ""; // null string protection...
    465               } catch(Throwable t) {
    466                 System.out.println("Exception getting video server params: "+t);
    467                 cmdOpt2 = "";
    468               }
    469 
    470               //cmdOpt2 = ((OpenGLGFXCMD)gfxEngine).getVideoOutParams();
    471             } else {
    472               cmdOpt2 = "-vo stv:socket=" + (myConn).getVideoSocket() + " -vc ffmpeg12,";
    473             }
    474             cmdOpt2 += " -cache-seek-min 0 -framedrop";
    475           }
    476           else
    477           {
    478             if ("false".equals(MiniClient.myProperties.getProperty("xvmc", "false")))
    479             {
    480               cmdOpt2 = "-colorkey 0x"+Integer.toHexString(getDesktopColorKey())+
    481                   " -vo xv:windowevents=0:ck=set  -cache-seek-min 0 -framedrop";
    482             }
    483             else
    484             { // Using xvmc
    485               cmdOpt2 = "-colorkey 0x"+Integer.toHexString(getDesktopColorKey())+
    486                   " -vo xvmc:windowevents=0:ck=set, -vc ffmpeg12mc, -cache-seek-min 0 -framedrop";
    487             }
    488           }
Reply With Quote
  #6  
Old 12-05-2015, 12:11 PM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,349
From the code, you can see that both usages of the ffmpeg12mc codec are tied to setting the 'xvmc' property in the config. By default this was disabled...so if it's using ffmpeg12mc, then you've had to set that yourself. XVMC is X-Video Motion Compensation...it's GPU offload of certain decoding features and will generally give better decoding performance if it actually works properly (and nowadays its probably does work just fine).

This would have nothing to do with audio issues during playback though.
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #7  
Old 12-05-2015, 05:27 PM
dranockcir dranockcir is offline
Sage Advanced User
 
Join Date: Jul 2004
Location: Jupiter, FL
Posts: 137
I have the problem of no audio with 64 bit sage client on Ubuntu, I'm using an HDHR Prime for my tuners.

I have a 32 bit Ubuntu laptop with the 7.1.9 client on it and it can connect to the new ver. 9 server (on Ubuntu) and play sound with the video.
Reply With Quote
  #8  
Old 12-05-2015, 09:23 PM
SageWizdom SageWizdom is offline
Sage Advanced User
 
Join Date: Oct 2013
Location: https://github.com/SageWizdom/SageConnect
Posts: 216
Having spent an hour or two today playing with it, I realized I'm not using the mplayer that stuckless spent all the time upgrading (Shoot!) so maybe tomorrow I'll get some time to pull that and try again. sigh! Thanks for the pointers thought.

I also very successfully modified the server plugin for about 30 minutes before realizing that I was using the miniclient.
Reply With Quote
  #9  
Old 12-06-2015, 05:35 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by dranockcir View Post
I have the problem of no audio with 64 bit sage client on Ubuntu, I'm using an HDHR Prime for my tuners.

I have a 32 bit Ubuntu laptop with the 7.1.9 client on it and it can connect to the new ver. 9 server (on Ubuntu) and play sound with the video.
I use 64bit ubuntu for building/testing, and I do recall a no audio issue. I'm pretty sure you are just missing a 'bridge' audio library. Make sure you have alsa and pusle audio libraries installed.
Reply With Quote
  #10  
Old 12-06-2015, 07:55 PM
dranockcir dranockcir is offline
Sage Advanced User
 
Join Date: Jul 2004
Location: Jupiter, FL
Posts: 137
Quote:
Originally Posted by stuckless View Post
I use 64bit ubuntu for building/testing, and I do recall a no audio issue. I'm pretty sure you are just missing a 'bridge' audio library. Make sure you have alsa and pusle audio libraries installed.
Yep, you were right. :-) I went back to your post about building sage on Linux and loaded the libraries. Have sound now, just gets way ahead of the video as time goes by. :-)
Reply With Quote
  #11  
Old 12-08-2015, 03:01 PM
dranockcir dranockcir is offline
Sage Advanced User
 
Join Date: Jul 2004
Location: Jupiter, FL
Posts: 137
Quote:
Originally Posted by dranockcir View Post
Yep, you were right. :-) I went back to your post about building sage on Linux and loaded the libraries. Have sound now, just gets way ahead of the video as time goes by. :-)
Fixed the sound being out of sync by updating ffmpeg, currently 2.8.3 is the version I am using and audio is in sync with the video.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
No music Audio and Video is small for SageClient LWM4P SageTV Software 4 11-15-2010 09:14 PM
Linux Placeshifter - Audio but no Video! help! himay SageTV Linux 2 09-25-2008 11:34 AM
Choppy audio in Linux placeshifter Thomas Wischgol SageTV Linux 0 10-05-2007 08:20 AM
Q: SageClient mode w/ Sage Service not saving into SageClient.properties laurenglenn SageTV Software 2 06-17-2007 09:22 PM
"Audio Delay" doesn't work in SageClient 2.1 wazkaren SageTV Software 0 11-07-2004 06:01 PM


All times are GMT -6. The time now is 02:00 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.