Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

PC Based Computer music servers, crossovers, and equalization

LADSPA plugin programming for Linux audio crossovers
LADSPA plugin programming for Linux audio crossovers
Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 12th June 2018, 08:54 AM   #471
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Quote:
Originally Posted by RAndyB View Post
Have a look at my thread[HTML]
I reiterate phofman's instructions about ensuring that in "/usr/share/alsa/alsa.conf" the entry " "~/.asoundrc" under "@hooks [" is commented out.
The .asoundrc entry is no problem at all. If commented out, it will ignore the user's configuration. I am not sure that is what schaudio wants.

The problem in ubuntu/debian is the file /usr/share/alsa/alsa.conf.d/pulse.conf which instructs the alsa-lib configuration module to lazy-load /usr/share/alsa/pulse-alsa.conf upon accessing the device, if pulseaudio is running. The pulse-alsa.conf config overrides the default device, making any default device definition in /etc/asound.conf or .asoundrc ineffective.
  Reply With Quote
Old 12th June 2018, 04:38 PM   #472
RAndyB is offline RAndyB  United Kingdom
diyAudio Member
 
Join Date: May 2005
Location: Herefordshire
phofman,
apologies for clouding the discussion. Standard Raspbian doesn't install pulseaudio, so it is not an issue for me.
The issue that may remain is .asoundrc being (annoyingly, needlessly) overwritten at every reboot in some distributions, so using /etc/asound.conf and commenting out the call to .asoundrc is worthwhile.
Andy
  Reply With Quote
Old 12th June 2018, 04:54 PM   #473
francolargo is offline francolargo  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Twin Cities, MN
Quote:
Originally Posted by phofman View Post
The pulse-alsa.conf config overrides the default device, making any default device definition in /etc/asound.conf or .asoundrc ineffective.
Thanks for the clarification!
  Reply With Quote
Old 12th June 2018, 04:57 PM   #474
RAndyB is offline RAndyB  United Kingdom
diyAudio Member
 
Join Date: May 2005
Location: Herefordshire
Quote:
Originally Posted by rlim View Post
Does anyone know if this sound processing is doable when watching youtube videos or hoopla videos? Like how do you pipe the audio into ecasound/ladspa so we can utilize the software-configured crossovers to get the movie experience through the loudspeakers.
Thanks,
Richard
A little late, but ....
I use alsaloop to listen to the TV sound and have no lipsync. problems:

alsaloop -d -C plughw:CARD=RPiCirrus -P default -t 50000

RPiCirrus sound card handles the S/PDIF input from the TV, default is the asound.conf with crossovers and eq.
-t 50000 is called latency in the manual. It seems to increase buffer size, avoiding digital artifacts which were occurring regularly without it.

Is this what you were having problems with? If you are playing the videos on the same machine as the crossovers, then the video software should just find the
"default" "device".
Andy

Last edited by RAndyB; 12th June 2018 at 05:07 PM. Reason: clarification
  Reply With Quote
Old 13th June 2018, 01:12 PM   #475
francolargo is offline francolargo  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Twin Cities, MN
I didn't know about 'alsaloop' so I looked up its debian manpage [here]. It looks quite adaptable and preferable to sox for applications involving signal synch. I will experiment with it as I revamp the software in my own Debian-based system! In the past I tried other commands like aplay, which worked, but sox proved superior.

One capability in sox, which simply trumps other looping-type commands for routing, is its built-in convolver. It will run FIR filter sets on the fly for pre-ALSA equalization without mucking up the signal phase. So it has proved to be slightly better sounding for sources where the PCM frequency does not shift to follow native sample rates - like spdif. Theoretically, it could preemptively reverse the phase shift of LADSPA IIR crossovers. Unfortunately, my little A8 CPU can't manage a very large coefficient set, so for me it is best for mid and higher frequency manipulations. Perhaps the new RPi could manage significantly more coefficients.

Example syntax:
Code:
chrt -f 45 sox --buffer 1024 -r 48000 -c 2 -t alsa hw:1,0 -t alsa plug:alsa_entry_point  gain -h fir /usr/filter/fir2peak48mild.txt &
  # /usr/filter/fir2peak48mild.txt  is the path to the text file containing the filter coefficients.  
  # I generate EQ filter sets using matlab.
  # "chrt -f 45" increases the priority of sox to preempt casual OS traffic.  To stop it you need to kill from the command line.

Last edited by francolargo; 13th June 2018 at 01:15 PM.
  Reply With Quote
Old 13th June 2018, 09:43 PM   #476
schaudio is offline schaudio  Germany
diyAudio Member
 
Join Date: Apr 2012
Quote:
Originally Posted by phofman View Post
schaudio: I am afraid you have hit debian/ubuntu configuration "deficiency" where the default device cannot be overriden in .asoundrc without further changes in /usr/share/alsa. I tested your problem (without the ladspa plugins) of unchanged default and ended up with the same result. Here is my communication with the lead alsa developer who explains the situation [alsa-devel] Order of device overrides in config files

Try to remove the extra config /usr/share/alsa/alsa.conf.d/pulse.conf, or comment out the relevant lines of /usr/share/alsa/pulse-alsa.conf where !default is defined. That should let your .asoundrc define your own !default as described in alsa documentation.

phofman, thank you very much for your answer. I'm using Ubuntu (16.04) and changed /usr/share/alsa/pulse-alsa.conf by commenting out
Code:
#pcm.!default {
#    type pulse
#    hint {
#        show on
#        description "Playback/recording through the #PulseAudio sound server"
#    }
#}

#ctl.!default {
#    type pulse
#}
by running "speaker-test -c 2" I received the message:


"speaker-test: pcm_params.c:170: snd1_pcm_hw_param_get_min: Zusicherung »!snd_interval_empty(i)« nicht erfüllt."


I could get it working by changing the beginning of my .asoundrc from
pcm.!default {
type plug
slave.pcm LXmini
}
to
pcm.!default {
type asym
playback.pcm LXmini
}
(but don't know how/ why that works. If someone can explain it to me, I'd be interested).
Now "speaker-test -c 2" works fine.


After disabling Pulse as described in chapter 2.2 of PulseAudio/HOW-TO: Disable PulseAudio and use ALSA (without removing PulseAudio) for Ubuntu - Official Kodi Wiki
and restarting the computer or killing pulse by "pulseaudio --kill"

I can play music using the standard video player (totem) and rythymbox.



But currently I don't get sound from VLC (no matter whether I switch the output to "Automatic" or "ALSA") and I don't get sound from Firefox either (for flash videos or audio streams).
Does anyone know, how to get this sound working too?


Best regards,
schaudio

Last edited by schaudio; 13th June 2018 at 10:08 PM. Reason: additional info
  Reply With Quote
Old 14th June 2018, 07:38 AM   #477
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
As for the asym plugin - look at ALSA User — Re: Using "plughw" in .asoundrc: snd1_pcm_hw_param_get_min: Assertion `!snd_interval_empty(i)' failed. . I would try to remove the second plug definition, e.g. by naming the LXmini device directly "!default".

When posting messages here always try to run with English locales, e.g. by running before your commands:

Code:
export LC_ALL=C
Instead of non-verbose speaker-test, try to use aplay with parameter -v (--verbose). It lists the whole chain and operations done by each plugin. Very useful for troubleshooting.

Code:
aplay -v -D yourdevice somemusic.wav
You can create any wav of any channel count/samplerate/sample length with sox.

When testing alsa on specific soundcard on pulseaudio-enabled distribution (e.g. ubuntu), it is possible to tell PA to avoid using a specific soundcard. That way PA-only softwares (e.g. skype) will continue to work on other soundcards, yet that specific soundcard will be ignored by PA and available to your software. Just install pavucontrol (apt-get) and set the specific soundcard to "Off". E.g. I use this in my measurement station Headless Amplifier Measurement Workstation where the actual measurement is performed by ESI Juli via wine/Arta + alsa directly and synthesized voice announcements proceed through regular mint/ubuntu sound system - python -> espeak in default configuration -> PA -> internal soundcard -> internal speaker. Juli is never touched by PA.

The VLC/Firefox problem - I would start simple first. Configure your alsa !default without the added ladspa filters, verify correct function, and start adding new parts of your chain, always verifying each step. Troubleshooting such complicated chain without detailed logs (like in aplay -v) is usually just random trial/error.

AFAIK Firefox dropped alsa support some time ago, leaving PA as the only option Firefox Goes PulseAudio Only, Leaves ALSA Users With No Sound - OMG! Ubuntu!

Last edited by phofman; 14th June 2018 at 07:42 AM.
  Reply With Quote

Reply


LADSPA plugin programming for Linux audio crossoversHide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Loaded .xml file for different miniDSP plugin and now the plugin doesn't work anymore keyser miniDSP 5 15th December 2011 01:38 AM
8 channel Linux audio with active crossovers oublie PC Based 7 21st February 2011 09:29 AM


New To Site? Need Help?

All times are GMT. The time now is 03:10 AM.


Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 14.29%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
Copyright ©1999-2018 diyAudio
Wiki