fredvs / uoslib

Library United Open-libraries of Sound. United library for open-source audio libraries.
Other
10 stars 5 forks source link

simpleplayer_noflat does not compile and problems with multi devices. #2

Open gitarent opened 4 years ago

gitarent commented 4 years ago

git rev: 13e22de 2020-01-01

Free Pascal Compiler version 3.0.4+dfsg-23 [2019/11/25] for x86_64 Copyright (c) 1993-2017 by Florian Klaempfl and others (1002) Target OS: Linux for x86-64 (3104) Compiling simpleplayer_noflat.lpr (3104) Compiling main_sp_nf.pas main_sp_nf.pas(395,45) Error: (3026) Wrong number of parameters specified for call to "create" uos.pas(9689,26) Error: (5088) Found declaration: constructor create; main_sp_nf.pas(418,126) Error: (3026) Wrong number of parameters specified for call to "AddIntoDevOut" uos.pas(4912,24) Error: (5088) Found declaration: AddIntoDevOut(LongInt;Double;LongInt;LongInt;LongInt;LongInt;LongInt):LongInt;main_sp_nf.pas(656,10) Error: (3029) function header doesn't match the previous declaration "DSPReverseBefore(var Tuos_Data;var Tuos_FFT):{Dynamic} Array Of Single;" main_sp_nf.pas(97,10) Error: (5088) Found declaration: DSPReverseBefore(var Tuos_Data;var Tuos_FFT):{Dynamic} Array Of Single; main_sp_nf.pas(678,10) Error: (3029) function header doesn't match the previous declaration "DSPStereo2Mono(var Tuos_Data;var Tuos_FFT):{Dynamic} Array Of Single;" main_sp_nf.pas(100,10) Error: (5088) Found declaration: DSPStereo2Mono(var Tuos_Data;var Tuos_FFT):{Dynamic} Array Of Single; main_sp_nf.pas(759) Fatal: (10026) There were 8 errors compiling module, stopping Fatal: (1018) Compilation aborted Error: /usr/bin/ppcx64 returned an error exitcode

fredvs commented 4 years ago

Hello.

OK, I will check it, thank to note it.

By the way, do you know that uoslib is the library version of uos?

May I ask you what kind of library you want to produce: native or Java?

fredvs commented 4 years ago

Re-hello.

Hum, where did you find simpleplayer_noflat.lpr in /uoslib/example ? It is normal that it does not compile because to produce a library, uoslib needs uos_flat.pas unit.

Please try the demos in uoslib/examples, for example /uoslib/examples/demos/fpc/simpleplayer.lpr

If you are a Pascal developer and want to use uos in your application, you should use uos instead of uoslib. And there there is a simpleplayer_noflat.lpr example (that should work).

gitarent commented 4 years ago

Thanks for responding so quickly :) What I did was:

gitarent commented 4 years ago

May I ask you what kind of library you want to produce: native or Java? I'm looking for basic play/record features for use on windows/mac/linux

fredvs commented 4 years ago

Ha ok, so you are talking about uos project (here you are in uoslib project).

And yes, I just try now the demo uos/examples/simpleplayer_noflat.lpr and indeed, there is a problem.

Thanks to note it.

Do you have problems with other examples, is uos/examples/simpleplayer.lpr working?

I will check+fix it tonight.

Fre;D

fredvs commented 4 years ago

I'm looking for basic play/record features for use on windows/mac/linux

Ha, ok, then you should use uos.

uolib is more for C, Python or Java developers that want to use a native audio library.

fpc developers may use directly uos, not via libuos.so.

fredvs commented 4 years ago

Hello.

OK, simpleplayer_noflat.lpr fixed in last uos commit.

Many thanks to note it.

Fre;D

gitarent commented 4 years ago

Nice, it compiles without errors now. ;)

however, ... I get no sound (player seems to load a file, indicator runs) and then, if I try to close the window:

Project SimplePlayer raised exception class 'External: SIGSEGV'. At address 5B58061

gitarent commented 4 years ago

The console shows:

ALSA lib pcm_dsnoop.c:641:(snd_pcm_dsnoop_open) unable to open slave ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card ALSA lib pcm_dmix.c:1024:(snd_pcm_dmix_open) The dmix plugin supports only playback stream ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave

fredvs commented 4 years ago

I get no sound (player seems to load a file, indicator runs)

What demo are you using?

if I try to close the window: Project SimplePlayer raised exception class 'External: SIGSEGV'.

Did you use the debugger? Because it is a known problem with gdb, it raise a exception at at closing uos application.

fredvs commented 4 years ago

Please could you try the consoleplay.prj example and give the result here.

gitarent commented 4 years ago

JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card ALSA lib pcm_dmix.c:1024:(snd_pcm_dmix_open) The dmix plugin supports only playback stream ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave

Libraries are loaded.

InputIndex1 = 0 OutputIndex1 = 0

Title: Strings

Artist: Barry White

Ciao...

fredvs commented 4 years ago

Do you have pulseaudio installed?

sudo apt-get install pulseaudio

There is indeed problem with last alsa library with some last new audio cards.

Also pulseaudio has a new audio driver that works much better than the old alsa driver.

gitarent commented 4 years ago

pulseaudio is already the newest version (1:13.99.1-1ubuntu3.3)

gitarent commented 4 years ago

inxi -A Audio: Device-1: NVIDIA GP107GL High Definition Audio driver: snd_hda_intel Device-2: Advanced Micro Devices [AMD] Family 17h HD Audio driver: snd_hda_intel Sound Server: ALSA v: k5.4.0-39-generic

fredvs commented 4 years ago

Hello.

About consoleplay.prj, did you listen to the sound or was it only text as result?

Did you try installing pulseaudio?

What is your OS?

gitarent commented 4 years ago

no sound, just text, OS: Ubuntu 20.04

sudo apt-get install pulseaudio:

Reading package lists... Done Building dependency tree
Reading state information... Done pulseaudio is already the newest version (1:13.99.1-1ubuntu3.3). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

fredvs commented 4 years ago

Hum, all seems ok in your side then.

Very strange, it seems that pulseaudio is not recognized.

Here the result I get on Debian 10.2 running consoleplay and there is sound:

fred@fiens ~> /home/fred/uos/examples/consoleplay ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map Cannot connect to server socket err = Aucun fichier ou dossier de ce type Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock Cannot connect to server socket err = Aucun fichier ou dossier de ce type Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port ALSA lib pcm_a52.c:823:(_snd_pcm_a52_open) a52 is only for playback ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card ALSA lib pcm_dmix.c:1043:(snd_pcm_dmix_open) The dmix plugin supports only playback stream

Libraries are loaded.

InputIndex1 = 0 OutputIndex1 = 0

Title: Strings

Artist: Barry White

Ciao...

fredvs commented 4 years ago

Could you try the example "deviceinfos.lpi" and see the result?

Here my result:

Capture d’écran_2020-06-26_15-11-26

fredvs commented 4 years ago

Maybe completely stupid, but are you sure that the general volume of pulse audio is set > 0 ? (You may check it clicking on the sound icon of the taskbar and see the volume of the output sliders.)

gitarent commented 4 years ago

afbeelding

gitarent commented 4 years ago

pavucontrol:

afbeelding

fredvs commented 4 years ago

Very, very strange. All seems ok for you.

I dont have idea now why you dont get sound.

Do you have sound with other application, like Audacity (that uses also PortAudio as audio driver)?

gitarent commented 4 years ago

audicity provides sound at all visible playback-devices, default, pulse, HDMI1 and HDMI2

fredvs commented 4 years ago

Could you try to use PortAudio library of your system (not the one from uos)?

For this, in example consoleplay.pas, at line 53, change this:

PA_FileName := ordir + 'lib/Linux/64bit/LibPortaudio-64.so';

with this:

PA_FileName := 'system' ;

And recompile + run to see it there is sound.

gitarent commented 4 years ago

Silence...

ALSA lib pcm_dsnoop.c:641:(snd_pcm_dsnoop_open) unable to open slave ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock

Libraries are loaded.

InputIndex1 = 0 OutputIndex1 = 0

Title: Strings

Artist: Barry White

Ciao...

fredvs commented 4 years ago

Aaaargh, and the library load without problem.

Are you using Jack server? On my system it is not installed.

fredvs commented 4 years ago

May I ask you to try a demo done with uos: StrumPract. You dont have to install anything, just download the release, unzip it and run StrumPract.

https://github.com/fredvs/strumpract/releases/

Do you have some sound with it?

gitarent commented 4 years ago

I'm using Ardour sometimes that 'needs' jack, but as soon that is running all other sound is disabled (due to jack?). I'm using timidity for midi-output

gitarent commented 4 years ago

Pushed every play button I could find: just silence text output:

./strumpract ALSA lib pcm_dsnoop.c:641:(snd_pcm_dsnoop_open) unable to open slave ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock

gitarent commented 4 years ago

I also tried consoleplay with jack running:

ALSA lib pcm_dsnoop.c:641:(snd_pcm_dsnoop_open) unable to open slave ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side Jack: JackClient::SetupDriverSync driver sem in flush mode Jack: JackLinuxFutex::Connect name = jack_sem.1000_default_alsa-jack.jackC.93719.0 Jack: Clock source : system clock via clock_gettime Jack: JackLibClient::Open name = alsa-jack.jackC.93719.0 refnum = 6 Jack: jack_client_close Jack: JackClient::Close ref = 6 Jack: JackClient::Deactivate Jack: JackSocketClientChannel::Stop Jack: JackPosixThread::Kill

resulting in Error: Project consoleplay raised exception class 'External: SIG32'. In file '../sysdeps/unix/sysv/linux/read.c' at line 26

fredvs commented 4 years ago

I dont have no more idea. I will install Jack and see if there is problem after this.

Write you later.

fredvs commented 4 years ago

OK, installed Jack with sudo apt-get install jackd

This is the result with Jack not started and sound is ok:

fred@fiens ~> /home/fred/uos/examples/consoleplay ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map Cannot connect to server socket err = Aucun fichier ou dossier de ce type Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock Cannot connect to server socket err = Aucun fichier ou dossier de ce type Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port ALSA lib pcm_a52.c:823:(_snd_pcm_a52_open) a52 is only for playback ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card ALSA lib pcm_dmix.c:1043:(snd_pcm_dmix_open) The dmix plugin supports only playback stream

Libraries are loaded.

InputIndex1 = 0 OutputIndex1 = 0

Title: Strings

Artist: Barry White

Ciao...

And this the result with Jack started. Here NO crash but NO sound:

fred@fiens ~> /home/fred/uos/examples/consoleplay ALSA lib pcm_dsnoop.c:638:(snd_pcm_dsnoop_open) unable to open slave ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side Cannot lock down 82280346 byte memory area (Ne peut allouer de la mémoire) Cannot lock down 82280346 byte memory area (Ne peut allouer de la mémoire) ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port ALSA lib pcm_a52.c:823:(_snd_pcm_a52_open) a52 is only for playback ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card ALSA lib pcm_dmix.c:1043:(snd_pcm_dmix_open) The dmix plugin supports only playback stream ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave

Libraries are loaded.

InputIndex1 = 0 OutputIndex1 = 0

Title: Strings

Artist: Barry White

Ciao...

Imho, there is something wrong in your system it is not normal that consolepay crash when Jack is running.

Sure we will find the solution.

fredvs commented 4 years ago

Do you have more than 1 sound card ? Maybe the sound is sent to a other device than the default. If you have usb sound cards, could you try to remove the usb-audio-card and see if it is working with the main sound card?

fredvs commented 4 years ago

Maybe you can try to change the defaut device used by PortAudio.

To do this, in consoleplay.pas, line 147, according to deviceinfo change the device number parameter, it is the second parameter: OutputIndex1 := uos_AddIntoDevOut(PlayerIndex1, -1, -1, -1, -1, -1, -1, -1) ;

Here declaration of uos_AddIntoDevOut:

function uos_AddIntoDevOut(PlayerIndex: cint32; Device: cint32; Latency: CDouble;
  SampleRate: cint32; Channels: cint32; SampleFormat: cint32 ;
   FramesCount: cint32 ; ChunkCount: cint32): cint32;
// Add a Output into Device Output
// Device ( -1 is default device )
// Latency  ( -1 is latency suggested )
// SampleRate : delault : -1 (44100)
// Channels : delault : -1 (2:stereo) (0: no channels, 1:mono, 2:stereo, ...)
// SampleFormat : default : -1 (1:Int16) (0: Float32, 1:Int32, 2:Int16)
// FramesCount : default : -1 (= 65536)
// ChunkCount : default : -1 (= 512)
//  result :  Output Index in array  -1 = error
fredvs commented 4 years ago

And what about using only PortAudio?

Did you try uos/examples/consolesynth.lpi?

Still silence?

gitarent commented 4 years ago

Not a single sound :(

ALSA lib pcm_dsnoop.c:641:(snd_pcm_dsnoop_open) unable to open slave ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card ALSA lib pcm_dmix.c:1024:(snd_pcm_dmix_open) The dmix plugin supports only playback stream ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave Result of loading (if 0 => ok ) : 0 PortAudio V19-devel (built Jul 12 2012 01:53:44) | Sndfile: | Mpg123:

gitarent commented 4 years ago

Changing device to: 0 - silence 1 - sound! 2 - sound! 3: silence + error 4: silence + error 5: silence 6: silence 7: silence 8: SIGSEGV

error:

JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock

Libraries are loaded.

InputIndex1 = 0 Expression 'parameters->channelCount <= maxChans' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1514 Expression 'ValidateParameters( outputParameters, hostApi, StreamDirection_Out )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2825 OutputIndex1 = -1 Ciao...

fredvs commented 4 years ago

1 - sound! 2 - sound!

Huh, does it mean that the solution is not far? If you have sound changing the device, it is a excellent news.

Now how to set automatically the working device... Strange that your default device raise a error.

gitarent commented 4 years ago

Two (of three) HDMI-screens produce sound, (resp device=1, device=2) the third (device=0) does not, and the analog output (device=?) which was to be default remains quiet also.

fredvs commented 4 years ago

What do you get if you set, with pavucontrol, Configuration-Audio Internal to "Duplex Analogic Stereo"?

Capture d’écran_2020-06-26_21-14-30

gitarent commented 4 years ago

already set to afbeelding

fredvs commented 4 years ago

And if you set GP107GL controller to "Analog Stereo Duplex" ? This to find where is the problem.

Here result of consoleplay + pavucontrol on my system:

Capture d’écran_2020-06-26_21-28-26

gitarent commented 4 years ago

Choices for GP107GL are: Digital Stereo (HDMI) Output Digital Stereo (HDMI 3) Output Digital Stereo (HDMI 2) Output Digital Surround 7.1 (HDMI ) Output Digital Surround 5.1 (HDMI ) Output Off

for device 1:

ALSA lib pcm_dsnoop.c:641:(snd_pcm_dsnoop_open) unable to open slave ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock

Libraries are loaded.

InputIndex1 = 0 OutputIndex1 = 0

Title: Strings

Artist: Barry White

Ciao...

fredvs commented 4 years ago

I have to confess that I did try uos with 2 sound cards long time ago.

But on my actual laptop i5 there is only one sound-card, the build-in.

So I am lost because I cannot test.

fredvs commented 4 years ago

Is your audio controller i17H Stereo Analog Duplex set as default device?

Because it appears as second device.

https://unix.stackexchange.com/questions/14454/changing-default-audio-device-in-pulseaudio

gitarent commented 4 years ago

If you connect any HDMI/displayport monitor, it would be seen as another output device - imo those unintended sound devices can make audio quite complicated. It would get probably even more complicated if I'd connect my X-Air18 (18 channel digital mixer via USB)...

Routing of audio signals is increasingly getting more complex; ALSA/pulseaudio/JACK where to start? I'm most of all looking for a (very basic) audio component that encapsulates all the hardware/os differences.

fredvs commented 4 years ago

I did try just now to connect a monitor to the HDMI port of my ThinkPad and sound works via uos.

And yes it is complicated because the order of the devices change once you connect a monitor.

You may try with Bass library, it works very well (but not open source and free only for no commercial) but not sure it is simpler to deal with devices.

fredvs commented 4 years ago

There is a PortAudio branch with PulseAudioHost as backend: https://app.assembla.com/spaces/portaudio-pulseaudio/git/source/PulseAudioHostAPImulti?type=branch

I did compile it for Linux 64, it works on my only one audio-card system, maybe you can try loading this one on your system:

[EDIT] Here PortAudio with PulseAudioHost (previous was not correctly compiled) I get more devices!

LibPortaudio-64.so.zip

fredvs commented 4 years ago

There is a PortAudio branch with PulseAudioHost as backend: https://app.assembla.com/spaces/portaudio-pulseaudio/git/source/PulseAudioHostAPImulti?type=branch

I did compile it for Linux 64, it works on my only one audio-card system, maybe you can try loading this one on your system:

[EDIT] Here PortAudio with PulseAudioHost (previous was not correctly compiled) I get more devices!

LibPortaudio-64.so.zip

To compile PortAudio, first download the source here: https://app.assembla.com/spaces/portaudio-pulseaudio/git/source/PulseAudioHostAPImulti?type=branch

Then create a directory and unzip the source into it.

Then in console go to that directory and do:

 autoreconf -fim
./configure --with-pulseaudio
make clean
make all

The library will be in hidden directory: /thedirectory/lib/.libs/libportaudio.so.2.0.0