INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Broadcasting could not start on the 'ALSA' output [SOLVED]  (Read 873 times)

JohnDoeSama

  • Recent member
  • *
  • Posts: 7

Hello everyone,

After some fruitless research, I'm opening this ticket about a problem I'm having with JRiver on Linux Mint.

Indeed, after setting my audio output to my DAC in direct connection with ALSA, when I start playing a track, I get this error message :
Quote
Diffusion problem

Details :
Broadcasting could not start on the 'ALSA' output in 48hz 2ch format. [...]


To wit:
- I have no problems with the Windows version.
- I can use my DAC outside JRiver
- I've tried to authorize my various sample rates on the pipewire configuration
- It already worked! It didn't work at first, then it started to work, then it doesn't work anymore... I can't figure out what triggered these changes in behavior or how to make it work again.

Attached to the post:
- jriver's error message
- my pipewire config
- my audio output in jriver
- my configuration in dsp


I thank you in advance for your help and remain at your disposal to provide any further information.

EDIT : I corrected my pipewire config (196000 > 96000) but the problem is still there.
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13875
Re: Broadcasting could not start on the 'ALSA' output
« Reply #1 on: July 01, 2024, 11:24:51 am »

MC doesn't use pipewire, it uses ALSA.
Your settings look OK to me.
Try turning on logging and posting a log here or email to bob (at) jriver (dot) com.
The audio device open is extensively logged.
Logged

JohnDoeSama

  • Recent member
  • *
  • Posts: 7
Re: Broadcasting could not start on the 'ALSA' output
« Reply #2 on: July 01, 2024, 01:59:30 pm »

Thanks for your feedback Bob.
Attached are the logs.

The error seems to come from the fact that ALSA is already busy.
Code: [Select]
0005097: 140457560495680: Playback: CALSAPlugin::OpenALSA: Opening audio device hw:CARD=M2496,DEV=0 failed, Error = Périphérique ou ressource occupé
I've investigated and it seems to be coming from the EasyEffect application I'm using as a DSP. When I turn it off, MC works fine.

The problem is that I'd like to be able to cohabit the two.
Any leads?

Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13875
Re: Broadcasting could not start on the 'ALSA' output
« Reply #3 on: July 02, 2024, 08:11:18 am »

Thanks for your feedback Bob.
Attached are the logs.

The error seems to come from the fact that ALSA is already busy.
Code: [Select]
0005097: 140457560495680: Playback: CALSAPlugin::OpenALSA: Opening audio device hw:CARD=M2496,DEV=0 failed, Error = Périphérique ou ressource occupé
I've investigated and it seems to be coming from the EasyEffect application I'm using as a DSP. When I turn it off, MC works fine.

The problem is that I'd like to be able to cohabit the two.
Any leads?
You can't do that if you want to use the hw: device. That's really specifying exclusive access by MC.
You could use the default or pulse audio server entries. That will require DSP studio in MC to be set to whatever the default pulse sample rate is (usually 48k but can be changed) for all sample rates.
Optionally there is a pulse pipewire pseudo device. I don't think you have that shim installed, I don't see it in your audio device list.
If you do a search for pipewire in this forum, you'll see some previous topics that may be useful.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4231
Re: Broadcasting could not start on the 'ALSA' output
« Reply #4 on: July 02, 2024, 10:56:58 am »

Optionally there is a pulse pipewire pseudo device. I don't think you have that shim installed, I don't see it in your audio device list.
this works fine, easyeffects running while MC is configured output to pipewire[ALSA] and you get audio as expected
Logged

JohnDoeSama

  • Recent member
  • *
  • Posts: 7
Re: Broadcasting could not start on the 'ALSA' output
« Reply #5 on: July 04, 2024, 12:45:00 pm »

I'll need to dig a little deeper to figure out how to set-up the pseudo-devices because it's been a failure so far...

However, I'd like the MC audio stream to avoid any processing and be as direct as possible (for real gain? I'll be honest, I don't know but I'll sleep peacefully).
With the almighty chatgpt, I've made a little script that serves as a shortcut that lets me release alsa before launching mediacenter and relaunch easy effect when it closes.


Here's the code for those who might be interested.

EDIT : more efficient, need playerctl installed
Code: [Select]
#!/bin/bash

LOCKFILE="/tmp/alsa_mediacenter_lock"

# Vérifier si le script est déjà en cours d'exécution
if [ -e "$LOCKFILE" ] && kill -0 "$(cat $LOCKFILE)"; then
    echo "Le script est déjà en cours d'exécution."
    exit 1
fi

# Créer un fichier de verrouillage avec le PID du script actuel
echo $$ > "$LOCKFILE"

# Assurer la suppression du fichier de verrouillage à la fin du script ou en cas d'interruption
trap 'rm -f "$LOCKFILE"; exit' INT TERM EXIT

# Mettre en pause la lecture
playerctl pause

# Couper le son dès le début du script
pactl set-sink-mute @DEFAULT_SINK@ true

# Arrêter EasyEffects
flatpak kill com.github.wwmm.easyeffects

# Attendre que EasyEffects soit bien arrêté
while pgrep -x "easyeffects" > /dev/null; do
    sleep 0.5
done

# Désactiver PipeWire et ses services associés
systemctl --user mask pipewire.service pipewire-pulse.service
systemctl --user stop pipewire.service pipewire-pulse.service

# Attendre que PipeWire soit bien arrêté
while pgrep -x "pipewire" > /dev/null || pgrep -x "pipewire-pulse" > /dev/null; do
    sleep 0.5
done

# Lancer MediaCenter32
mediacenter32 &

# Attendre que MediaCenter32 se ferme
wait $!


# Réactiver PipeWire et ses services associés
systemctl --user unmask pipewire.service pipewire-pulse.service
systemctl --user start pipewire.service pipewire-pulse.service

# Couper le son
pactl set-sink-mute @DEFAULT_SINK@ true


# Attendre que PipeWire soit bien démarré
while ! pgrep -x "pipewire" > /dev/null || ! pgrep -x "pipewire-pulse" > /dev/null; do
    sleep 0.5
done

# Couper le son
pactl set-sink-mute @DEFAULT_SINK@ true

# Démarrer EasyEffects en arrière-plan
flatpak run com.github.wwmm.easyeffects --gapplication-service &

# Attendre qu'EasyEffects soit bien démarré
while ! pgrep -x "easyeffects" > /dev/null; do
    sleep 3
done

# Réactiver le son
pactl set-sink-mute @DEFAULT_SINK@ false

# Supprimer le fichier de verrouillage
rm -f "$LOCKFILE"




As far as I'm concerned, the subject is solved.
Many thanks to you all.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4231
Re: Broadcasting could not start on the 'ALSA' output [SOLVED]
« Reply #6 on: July 04, 2024, 01:38:33 pm »

I don't understand why you want to use the hw directly from MC but use pipewire and easyeffects at other times, is there a reason?

I don't know mint but debian says https://wiki.debian.org/PipeWire

For Debian 12 and newer, pipewire-audio-client-libraries is replaced by pipewire-alsa and pipewire-jack. It is recommended to install the metapackage pipewire-audio which depends on wireplumber (the recommended session manager), pipewire-pulse (to replace PulseAudio), pipewire-alsa (ALSA) and libspa-0.2-bluetooth (for Bluetooth support). Moreover, installing this metapackage will remove pulseaudio to prevent any conflicts between both sound server.

probably mint has some similar packages
Logged

JohnDoeSama

  • Recent member
  • *
  • Posts: 7
Re: Broadcasting could not start on the 'ALSA' output [SOLVED]
« Reply #7 on: July 04, 2024, 02:02:44 pm »

From what I read while researching the term "bitperfect" on Windows, I saw that the audio path led to changes in the sound (resampling, compressor, mixer, etc.). The solution to avoid this was to output MC directly and in exclusive mode to the sound card using Wasapi.

I've just switched to Linux and kept the same logic, and the direct output without any conversion seems very similar to what I had on Windows.

I then apply a series of treatments (EQ, balance, convolution) to my audio stream, either directly in MC or through easyeffect when i'm not using it.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4231
Re: Broadcasting could not start on the 'ALSA' output [SOLVED]
« Reply #8 on: July 04, 2024, 02:39:50 pm »

I can't comment on the specifics of any given audio path but would just ask.... if you have a functioning setup in easyeffects, why then reimplement the same (or similar) in MC?
Logged

JohnDoeSama

  • Recent member
  • *
  • Posts: 7
Re: Broadcasting could not start on the 'ALSA' output [SOLVED]
« Reply #9 on: July 04, 2024, 02:59:39 pm »

There are differences, because via MC :
- I avoid any unwanted/controlled alteration to the audio stream (I can't tell if this is the case on pipewire, but it seems to be on Windows).
- I can automatically apply a specific convolution file per samplerate

Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4231
Re: Broadcasting could not start on the 'ALSA' output [SOLVED]
« Reply #10 on: July 04, 2024, 03:06:12 pm »

you have actually different filters per sample rate or have just resampled them offline?
Logged

JohnDoeSama

  • Recent member
  • *
  • Posts: 7
Re: Broadcasting could not start on the 'ALSA' output [SOLVED]
« Reply #11 on: July 04, 2024, 03:24:45 pm »

Not sure I understand "have just resampled them offline". (lost in translation), but I haven't resampled the same filter.


I do have different filters per samplerate.
I generated them from a digital room correction plugin from my DAW.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4231
Re: Broadcasting could not start on the 'ALSA' output [SOLVED]
« Reply #12 on: July 04, 2024, 03:42:57 pm »

I mean are the filters the same but in different sample rates or fundamentally different?
Logged

JohnDoeSama

  • Recent member
  • *
  • Posts: 7
Re: Broadcasting could not start on the 'ALSA' output [SOLVED]
« Reply #13 on: July 04, 2024, 04:08:22 pm »

Ok I understand. It applies the same modification, just to a different sample rate.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4231
Re: Broadcasting could not start on the 'ALSA' output [SOLVED]
« Reply #14 on: July 05, 2024, 01:49:59 am »

ok that's what I meant by resample offline (i.e. some other app/tool has resampled the filter to the target sample rate rather than doing it on demand in the DSP engine)

I guess that leaves the potential for unknown activity in pipewire, https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/FAQ#what-about-bit-perfect-playback (along with other parts of that faq) might be relevant to you (along with the various guides such as https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Guide-Rates)  if you want to simplify your setup onto a single system wide dsp engine.
Logged
Pages: [1]   Go Up