You are not logged in.

#1 2022-05-20 19:45:40

pradtf
Member
Registered: 2009-06-10
Posts: 134

SOLVED pipewire pw-* questions

i have pipewire, pipewire-alsa, pipewire-jack and wireplumber installed and running.
everything i've tried seems to be working perfectly - i can even record audio with rosegarden!

however, i'm having some difficulty with some of the pw-* commands (likely because i don't really understand how they work yet).

for instance, i tried to play a midi file with:

pw-midiplay Dream.midi
stream node 55 error: no node available
remote error: id=2 seq:6 res:-2 (No such file or directory): no node available

ok so i look for nodes:

pw-cli ls Node                    
        id 28, type PipeWire:Interface:Node/3
                object.serial = "28"
                factory.id = "10"
                priority.driver = "20000"
                node.name = "Dummy-Driver"
        id 29, type PipeWire:Interface:Node/3
                object.serial = "29"
                factory.id = "10"
                priority.driver = "19000"
                node.name = "Freewheel-Driver"
        id 35, type PipeWire:Interface:Node/3
                object.serial = "35"
                factory.id = "10"
                client.id = "32"
                node.name = "Midi-Bridge"
                media.class = "Midi/Bridge"
        id 42, type PipeWire:Interface:Node/3
                object.serial = "42"
                object.path = "alsa:pcm:2:front:2:playback"
                factory.id = "18"
                client.id = "32"
                device.id = "40"
                priority.session = "1009"
                priority.driver = "1009"
                node.description = "USB Audio Device Analog Stereo"
                node.name = "alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo"
                node.nick = "USB Audio Device"
                media.class = "Audio/Sink"
        id 43, type PipeWire:Interface:Node/3
                object.serial = "43"
                object.path = "alsa:pcm:2:hw:2:capture"
                factory.id = "18"
                client.id = "32"
                device.id = "40"
                priority.session = "2000"
                priority.driver = "2000"
                node.description = "USB Audio Device Mono"
                node.name = "alsa_input.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.mono-fallback"
                node.nick = "USB Audio Device"
                media.class = "Audio/Source"
        id 44, type PipeWire:Interface:Node/3
                object.serial = "44"
                object.path = "alsa:pcm:0:front:0:playback"
                factory.id = "18"
                client.id = "32"
                device.id = "41"
                priority.session = "1009"
                priority.driver = "1009"
                node.description = "Built-in Audio Analog Stereo"
                node.name = "alsa_output.pci-0000_00_1f.3.analog-stereo"
                node.nick = "ALC891 Analog"
                media.class = "Audio/Sink"

audio is playing just fine on
"alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo"

so i tried

pw-midiplay --target="alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo" file.midi
stream node 55 error: no node available
remote error: id=2 seq:6 res:-2 (No such file or directory): no node available

and using the id 42, client.id 32 or device.id 40, gives the same error.
if i stop wireplumber, i get nothing - not even the error message and i can't play any audio.
(plays just fine though with fluidsynth file.midi)

so what do i have to do to get pw-midiplay to work?

Last edited by pradtf (2022-05-21 20:03:58)


in friendship,
prad

Offline

#2 2022-05-20 20:25:14

progandy
Member
Registered: 2012-05-17
Posts: 5,199

Re: SOLVED pipewire pw-* questions

pipewire does not include a midi synth. You'll have to run one, you could use fluidsynth in daemon mode. The automatic connection still does not work. The only way I was able to get sound was to start fluidsynth with midi type jack and pw-midiplay with target 0. Then I used helvum to connect them.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#3 2022-05-21 20:03:27

pradtf
Member
Registered: 2009-06-10
Posts: 134

Re: SOLVED pipewire pw-* questions

thx for these ideas, @progandy!

after considerable fiddling, i got it to work!

i tried to use pw-link, but couldn't figure out what was going on too well, so i switched to qpwgraph and matched things up with the pw-link -i and pw-link -o, till things made sense.

here's how it worked for me.

0. the linkscape before running the fluidsynth daemon

 pw-link -oI
  38 Midi-Bridge:Midi Through:(capture_0) Midi Through Port-0
  46 alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo:monitor_FL
  48 alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo:monitor_FR
  49 alsa_input.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.mono-fallback:capture_MONO
  51 alsa_output.pci-0000_00_1f.3.analog-stereo:monitor_FL
  53 alsa_output.pci-0000_00_1f.3.analog-stereo:monitor_FR

pw-link -iI
  36 Midi-Bridge:Midi Through:(playback_0) Midi Through Port-0
  45 alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo:playback_FL
  47 alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo:playback_FR
  50 alsa_output.pci-0000_00_1f.3.analog-stereo:playback_FL
  52 alsa_output.pci-0000_00_1f.3.analog-stereo:playback_FR

1. run the fluidsynth daemon with jack

cat /etc/conf.d/fluidsynth
# Mandatory parameters (uncomment and edit)
SOUND_FONT=/usr/share/soundfonts/default.sf2

# Additional optional parameters (may be useful, see 'man fluidsynth' for further info)
OTHER_OPTS='-a alsa -m alsa_seq -r 48000 -j'

(the -j for jack)


2. the linkscape after daemon runs

pw-link -oI
  38 Midi-Bridge:Midi Through:(capture_0) Midi Through Port-0
  46 alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo:monitor_FL
  48 alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo:monitor_FR
  49 alsa_input.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.mono-fallback:capture_MONO
  51 alsa_output.pci-0000_00_1f.3.analog-stereo:monitor_FL
  53 alsa_output.pci-0000_00_1f.3.analog-stereo:monitor_FR
  57 PipeWire ALSA [fluidsynth]:output_FL (ADDED)
  64 PipeWire ALSA [fluidsynth]:output_FR (ADDED)

pw-link -iI
  36 Midi-Bridge:Midi Through:(playback_0) Midi Through Port-0
  37 Midi-Bridge:FLUID Synth (22161):(playback_0) Synth input port (22161:0) (ADDED)
  45 alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo:playback_FL
  47 alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo:playback_FR
  50 alsa_output.pci-0000_00_1f.3.analog-stereo:playback_FL
  52 alsa_output.pci-0000_00_1f.3.analog-stereo:playback_FR

57,64 are the result of the daemon activating the sources.
37 is a new sink presumably for midi and is linked to 38 (don't know why though)

this is essentially the same linkscape that appears if you just ran
fluidsynth file.midi
without starting the daemon.


3. run pw-midiplay --target=0 file.midi
this adds
66 pw-midiplay:out_0
to the output of pw-link -oI

so we link it to 37:
pw-link 66 37


4. issues
a) sometimes when it starts playing it does so at a slow speed for some reason, but if we relink it, things play at the proper speed.

b) i only get acoustic grand - the other instruments like choir voices all come out as acoustic grand.

neither is present when we just run things through fluidsynth file.midi


so, i won't be using pw-midiplay, but i wanted to figure out how to do it and learned about several things in the process.

appreciate your help on this @progandy!


in friendship,
prad

Offline

Board footer

Powered by FluxBB