You are not logged in.

#1 2015-03-27 23:13:20

bernd_b
Member
Registered: 2013-07-30
Posts: 164

Does anyone has realtime ac3 or dts encoding running?

I have a setting where I only can connect to my Dolby/DTS decoder via SPDIF.

I happily was using dca ALSA plugin although it only worked for me via pulseausio. But with upgrade of pulseaudio from version 5 to 6, it makes pulseaudio crash.

The second solution I know of ( ac3jack ) won't get compiled. Even with the help of this gentoo ebuild, I only get to this error:

make[3]: Entering directory '/mnt/Data_bb/sda8/makepkg/ac3jack-2.0.3/src/gui'
g++ -DHAVE_CONFIG_H -I. -I../..    -I../../src   -I/usr/lib/sigc++-1.2/include -I/usr/include/sigc++-1.2  -I/usr/include/libxml2  -I/usr/lib/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -g -O2 -MT gui_app.o -MD -MP -MF .deps/gui_app.Tpo -c -o gui_app.o gui_app.cpp
gui_app.cpp:102:1: error: cannot convert ‘const wchar_t*’ to ‘const char*’ in initialization
 };
 ^
gui_app.cpp:102:1: error: cannot convert ‘const wchar_t*’ to ‘const char*’ in initialization
gui_app.cpp:102:1: error: cannot convert ‘const wchar_t*’ to ‘const char*’ in initialization
gui_app.cpp:102:1: error: cannot convert ‘const wchar_t*’ to ‘const char*’ in initialization
gui_app.cpp:102:1: error: cannot convert ‘const wchar_t*’ to ‘const char*’ in initialization
gui_app.cpp:102:1: error: cannot convert ‘const wchar_t*’ to ‘const char*’ in initialization
gui_app.cpp:102:1: error: cannot convert ‘const wchar_t*’ to ‘const char*’ in initialization
gui_app.cpp:102:1: error: cannot convert ‘const wchar_t*’ to ‘const char*’ in initialization
gui_app.cpp:102:1: error: cannot convert ‘const wchar_t*’ to ‘const char*’ in initialization
gui_app.cpp:102:1: error: cannot convert ‘const wchar_t*’ to ‘const char*’ in initialization
gui_app.cpp:102:1: error: cannot convert ‘const wchar_t*’ to ‘const char*’ in initialization
gui_app.cpp:102:1: error: cannot convert ‘const wchar_t*’ to ‘const char*’ in initialization
gui_app.cpp:102:1: error: cannot convert ‘const wchar_t*’ to ‘const char*’ in initialization
gui_app.cpp:102:1: error: cannot convert ‘const wchar_t*’ to ‘const char*’ in initialization
gui_app.cpp:102:1: error: cannot convert ‘const wchar_t*’ to ‘const char*’ in initialization
gui_app.cpp:102:1: error: cannot convert ‘const wchar_t*’ to ‘const char*’ in initialization
gui_app.cpp:102:1: error: cannot convert ‘const wchar_t*’ to ‘const char*’ in initialization
gui_app.cpp:102:1: error: cannot convert ‘const wchar_t*’ to ‘const char*’ in initialization
gui_app.cpp: In member function ‘virtual bool AC3JACKGui::GuiApp::OnInit()’:
gui_app.cpp:189:27: error: conversion from ‘long int’ to ‘const wxString’ is ambiguous
  logger->SetTimestamp(NULL);
                           ^
gui_app.cpp:189:27: note: candidates are:
In file included from /usr/include/wx-3.0/wx/memory.h:15:0,
                 from /usr/include/wx-3.0/wx/object.h:19,
                 from /usr/include/wx-3.0/wx/wx.h:15,
                 from gui_app.cpp:45:
/usr/include/wx-3.0/wx/string.h:1267:3: note: wxString::wxString(const wchar_t*)
   wxString(const wchar_t *pwz)
   ^
/usr/include/wx-3.0/wx/string.h:1254:3: note: wxString::wxString(const unsigned char*)
   wxString(const unsigned char *psz)
   ^
/usr/include/wx-3.0/wx/string.h:1241:3: note: wxString::wxString(const char*)
   wxString(const char *psz)
   ^
/usr/include/wx-3.0/wx/string.h:1235:3: note: wxString::wxString(wchar_t, size_t)
   wxString(wchar_t ch, size_t nRepeat = 1)
   ^
/usr/include/wx-3.0/wx/string.h:1231:3: note: wxString::wxString(char, size_t)
   wxString(char ch, size_t nRepeat = 1)
   ^
/usr/include/wx-3.0/wx/string.h:419:3: note: wxString::wxString(int)
   wxString(int);
   ^
In file included from /usr/include/wx-3.0/wx/wx.h:23:0,
                 from gui_app.cpp:45:
/usr/include/wx-3.0/wx/log.h:507:17: note: initializing argument 1 of ‘static void wxLog::SetTimestamp(const wxString&)’
     static void SetTimestamp(const wxString& ts) { ms_timestamp = ts; }
                 ^
Makefile:429: recipe for target 'gui_app.o' failed
make[3]: *** [gui_app.o] Error 1
make[3]: Leaving directory '/mnt/Data_bb/sda8/makepkg/ac3jack-2.0.3/src/gui'
Makefile:554: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/mnt/Data_bb/sda8/makepkg/ac3jack-2.0.3/src'
Makefile:404: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/mnt/Data_bb/sda8/makepkg/ac3jack-2.0.3'
Makefile:343: recipe for target 'all' failed
make: *** [all] Error 2

The third one (alsa A52 plugin) gives me no sound or distorted sound with the player I tried (mainly vlc and mpv). Via pulse, I can't get it running at all: pavucontrol refuses to accept the associated configuration entry and switches to analogue audio.
   
I would be happy to get at least one of a solution like the three mentioned working in current arch, so any help is much appreciated.

Offline

#2 2015-03-28 08:56:00

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,423

Re: Does anyone has realtime ac3 or dts encoding running?

mplayer and mpv have the audiofilter -af lavcac3enc that always worked for me (i use alsa, not pulseaudio)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Online

#3 2015-03-28 21:55:05

bernd_b
Member
Registered: 2013-07-30
Posts: 164

Re: Does anyone has realtime ac3 or dts encoding running?

Thanks for the hint. I totally forgot about this one, maybe because I failed when I tried then.

So mpv would work for itself, any other options for using with this special setup?

Offline

#4 2015-03-29 06:55:43

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,423

Re: Does anyone has realtime ac3 or dts encoding running?

The defaults seems fine, but if you want the maximum quality, just use:
--af-add=lavcac3enc=bitrate=640

edit- ops, maybe i misunderstood your reply

Last edited by kokoko3k (2015-03-29 06:56:38)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Online

#5 2015-04-03 12:31:07

bernd_b
Member
Registered: 2013-07-30
Posts: 164

Re: Does anyone has realtime ac3 or dts encoding running?

Could it be that lavcac3enc always defaults to stereo?
I get:

$ mpv --autofit=75% --speed=24000/25025 --hwdec=vaapi --deinterlace=yes --vo=vaapi:deint=bob --af scaletempo,lavcac3enc=tospdif=yes:bitrate=640:minch=2 /home/bernd_b/test_videos/channelcheck-large.mp4 2> /tmp/mpv.output.txt
Playing: /home/bernd_b/test_videos/channelcheck-large.mp4
 (+) Video --vid=1 (*) (h264)
 (+) Audio --aid=1 --alang=und (*) (eac3)
Using hardware decoding.
AO: [alsa] 48000Hz stereo 2ch spdif-ac3
VO: [vaapi] 1280x720 vaapi 

Since the input is 5.1, I added he option "--audio-channels 6" - but then I get no sound and these error messages:


$ mpv --autofit=75% --speed=24000/25025 --hwdec=vaapi --deinterlace=yes --vo=vaapi:deint=bob --audio-channels=6 --af scaletempo,lavcac3enc=tospdif=yes:bitrate=640:minch=2 /home/bernd_b/test_videos/channelcheck-large.mp4 2> /tmp/mpv.output.txt
Playing: /home/bernd_b/test_videos/channelcheck-large.mp4
 (+) Video --vid=1 (*) (h264)
 (+) Audio --aid=1 --alang=und (*) (eac3)
Using hardware decoding.
Unable to convert audio input format to output format.
Audio filter chain:
  [in] 48000Hz 5.1(side) 6ch floatp
  [lavrresample] 48000Hz 5.1(side) 6ch float
  [scaletempo] 48000Hz 5.1(side) 6ch float
  [lavrresample] 48000Hz 5.1(side) 6ch floatp
  [lavcac3enc] 48000Hz stereo 2ch spdif-ac3
  [lavrresample] 48000Hz 5.1 6ch float <-
  [out] 48000Hz 5.1 6ch spdif-ac3
  [ao] 0Hz 5.1 6ch ??
Could not create audio filter chain.
Error at audio filter chain pre-init!
Audio: no audio
VO: [vaapi] 1280x720 vaapii

Offline

#6 2015-04-03 21:20:55

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,423

Re: Does anyone has realtime ac3 or dts encoding running?

Nope, it does not default to 2 channels.
I think the problem is in the output device not accepting 6 channels, but i may be wrong.
I'd try without pulseaudio and/or without any custom .asoundrc, works for me with very similar options (24->25 fps conversion in the fly; i always use it because my lcd tv does not support 24hz, but syncs to 50hz)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Online

#7 2015-04-04 09:14:52

bernd_b
Member
Registered: 2013-07-30
Posts: 164

Re: Does anyone has realtime ac3 or dts encoding running?

To be sure, I deinstalled pusleaudio and killed it (or do I need to reboot?)

The lavac3enc filter still reports 2ch, of I add the option --audio-channels=6 I get no sound as shown.

The strange thing is, when I have sound with lavac3enc, mpv reports 2 channels but my amplifier says, the input is "multichannel".

Offline

#8 2015-04-04 10:01:52

bernd_b
Member
Registered: 2013-07-30
Posts: 164

Re: Does anyone has realtime ac3 or dts encoding running?

bernd_b wrote:

I happily was using dca ALSA plugin although it only worked for me via pulseausio. But with upgrade of pulseaudio from version 5 to 6, it makes pulseaudio crash.

I was honoured by an answer of the developer of the dca-plugin. With his help, it runs again with current pulseaudio from 6.01. Here is what he wrote:

Alexander E. Patrakov (via Email) wrote:

... it is not "starting from PulseAudio 6", it is starting from some RealtimeKit update. There is nothing to fix in the dca plugin, the bug is entirely in PulseAudio interaction with RealtimeKit. I have discussed this with PulseAudio developers in person in October 2014.

Basically, at start, PulseAudio asks the plugin to encode 2 seconds of audio. It is also under the restriction imposed by RealtimeKit that it must not spend more than 0.2 seconds without doing any blocking system calls. At that time, the CPU frequency is usually very low due to power-saving features of the Linux kernel, so it misses the deadline and gets killed.

A workaround is to make sure that PulseAudio does not ask the plugin to encode that much at once. Please find the line about module-udev-detect in /etc/pulse/default.pa and edit it as follows:

load-module module-udev-detect tsched_buffer_size=50000

Last edited by bernd_b (2015-04-04 10:06:11)

Offline

#9 2015-04-06 07:07:20

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,423

Re: Does anyone has realtime ac3 or dts encoding running?

I inspected the issue with mpv further and discovered that the spdif output works by pretending that the output stream is plain 2 channels 48khz pcm data, even if it contains ac3 data that represents 6 channels audio.

So, specifying --audio-channels=6 confuses mpv and produces the error (mplayer worked that way; i'll ask mpv devs about that...)

In the end you should get your 6 channel audio with your first try:

$ mpv --autofit=75% --speed=24000/25025 --hwdec=vaapi --deinterlace=yes --vo=vaapi:deint=bob --af scaletempo,lavcac3enc=tospdif=yes:bitrate=640:minch=2 /home/bernd_b/test_videos/channelcheck-large.mp4 2> /tmp/mpv.output.txt

Didn't that worked?

Last edited by kokoko3k (2015-04-06 07:10:58)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Online

#10 2015-04-06 08:18:19

bernd_b
Member
Registered: 2013-07-30
Posts: 164

Re: Does anyone has realtime ac3 or dts encoding running?

It must be like you said.
I got a similar answer from the mpv mailing list, where I asked the same question concern lavac3enc:

From: wm4
spdif transports compressed audio over a 2 channels / 48000 Hz PCM link. The 2 channels are not really what the audio compresses to. So I
suspect your first command works fine. The second can't work, because obviously we can't just remix compressed data.

I fired up a clip with
a) mutltichannel
b) with pure stereo aac

and my amplifier (which is a Dolby Headphone decoder, so I can't trust my ears alone) indicates "multichannel" for a), and only "stereo" for b), although mpv in both cases says:

AO: [alsa] 48000Hz stereo 2ch spdif-ac3

So we have lavac3enc for mpv/mplayer and dca plugin, which is still working for general use with pulse audio (and works for me too directly through alsa with mpv, though not with vlc this way).

Considered the general approach, I still would like to see ac3jack or a52 alsa plugin running , but still no luck here.

Last edited by bernd_b (2015-04-06 11:07:57)

Offline

Board footer

Powered by FluxBB