You are not logged in.

#1 2021-02-15 15:28:58

diederick76
Member
Registered: 2010-02-14
Posts: 157

Timidity/Jack: Couldn't open ALSA pcm device (`s')

Timidity fails: Couldn't open ALSA pcm device (`s')

Hi all,

Been pulling my hair out over this today (good thing in fact, barbers are closed since December). My end goal is playing MIDI files in Rosegarden over my motherboard's Generic HDA Intel sound chip, but I understood that I first need to install a software synthesizer. I've tried both fluidsynth and timidity++, and they both are unable to play anything. For timidity I followed the steps at https://wiki.archlinux.org/index.php/Timidity%2B%2B until I start the service, which fails, complaining about Jack:

● timidity.service - TiMidity++ Daemon
     Loaded: loaded (/usr/lib/systemd/user/timidity.service; enabled; vendor pr>
     Active: failed (Result: exit-code) since Mon 2021-02-15 15:42:18 CET; 7s a>
    Process: 50704 ExecStart=/usr/bin/timidity -iA (code=exited, status=1/FAILU>
   Main PID: 50704 (code=exited, status=1/FAILURE)

feb 15 15:42:18 zaphod timidity[50704]: JackShmReadWritePtr::~JackShmReadWriteP>
feb 15 15:42:18 zaphod timidity[50704]: jack_client_new: deprecated
feb 15 15:42:18 zaphod timidity[50704]: Cannot connect to server socket err = N>
feb 15 15:42:18 zaphod timidity[50704]: Cannot connect to server request channel
feb 15 15:42:18 zaphod timidity[50704]: jack server is not running or cannot be>
feb 15 15:42:18 zaphod timidity[50704]: JackShmReadWritePtr::~JackShmReadWriteP>
feb 15 15:42:18 zaphod timidity[50704]: JackShmReadWritePtr::~JackShmReadWriteP>
feb 15 15:42:18 zaphod timidity[50704]: Couldn't open output device
feb 15 15:42:18 zaphod systemd[1221]: timidity.service: Main process exited, co>
feb 15 15:42:18 zaphod systemd[1221]: timidity.service: Failed with result 'exi>

I'm unsure why timidity++ would need Jack, but since the end goal is Rosegarden, I went along and installed Jack, following https://wiki.archlinux.org/index.php/JA … ection_Kit. It does appear to start, but with a complaint about firewire, but I don't think that's the point right now. Is it?

$ jackd -d alsa -d hw:Generic
jackdmp 1.9.17
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2021 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
Could not open component .so '/usr/lib/jack/jack_firewire.so': libffado.so.2: cannot open shared object file: No such file or directory
Could not open component .so '/usr/lib/jack/jack_firewire.so': libffado.so.2: cannot open shared object file: No such file or directory
jack_get_descriptor : dll 
jack_get_descriptor returns null for 'jack_firewire.so'
Could not open component .so '/usr/lib/jack/jack_firewire.so': libffado.so.2: cannot open shared object file: No such file or directory
JACK server starting in realtime mode with priority 10
self-connect-mode is "Don't restrict self connect requests"
audio_reservation_init
Acquire audio card Audio1
creating alsa driver ... hw:Generic|hw:Generic|1024|2|48000|0|0|nomon|swmeter|-|32bit
configuring for 48000Hz, period = 1024 frames (21.3 ms), buffer = 2 periods
ALSA: final selected sample format for capture: 32bit integer little-endian
ALSA: use 2 periods for capture
ALSA: final selected sample format for playback: 32bit integer little-endian
ALSA: use 2 periods for playback

So, when I retry timidity++, I now get a new output:

$ timidity KONAMIX.MID
Requested buffer size 32768, fragment size 8192
ALSA pcm 'default' can't set hw_params
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 44100
PERIOD_TIME: (42666 85334)
PERIOD_SIZE: (1881 2048)
PERIOD_BYTES: (7524 15056)
PERIODS: (2 5)
BUFFER_TIME: (185759 185760)
BUFFER_SIZE: 8192
BUFFER_BYTES: 32768
TICK_TIME: ALL
Couldn't open ALSA pcm device (`s')

A web search led me to believe pulseaudio was in the way, but turning off both the socket and service appeared to make no difference for timidity.

Can someone tell my what this device 's' is and why timidity can't open it?

Offline

#2 2021-02-15 18:40:26

diederick76
Member
Registered: 2010-02-14
Posts: 157

Re: Timidity/Jack: Couldn't open ALSA pcm device (`s')

Also, when i use aplay to play a WAV file while jack is running,  the sound is really stuttering. When jack runs and I use mplayer to play an audio file, I get a lot of these:

Starting playback...
A:   0.0 (unknown) of 175.0 (02:55.0) ??,?% 
Audio device got stuck!
A:   0.0 (unknown) of 175.0 (02:55.0) ??,?% 
Audio device got stuck!
A:   0.0 (unknown) of 175.0 (02:55.0) ??,?% 
Audio device got stuck!

Also, YouTube videos in Firefox halt while jack is playing.

Last edited by diederick76 (2021-02-15 20:22:11)

Offline

#3 2022-02-12 04:54:53

amca01
Member
Registered: 2008-12-28
Posts: 57

Re: Timidity/Jack: Couldn't open ALSA pcm device (`s')

Unfortunately this is not an answer but a request: if you ever solved your problem - can you remember how?  I'm going out of my tiny mind trying to get MIDI files to be played.  None of aplaymidi, timidity, audacious will work, as all give errors about the jack audio system.  (Which I can't uninstall as apparently it's "required" according to pacman, for lots of audio apps).  I used to think networking in Linux was hard, but that's easy compared to working with sound...   (To rub salt in the wound, I've taken delivery of a new Windows machine which I need for work, and sound works perfectly out of the box.)

Thanks!

Offline

#4 2022-02-12 14:05:39

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,844

Re: Timidity/Jack: Couldn't open ALSA pcm device (`s')

I strongly suggest you use fluidsynth and properly configure it according to the audio system you are actually using for a software midi synthesizer. https://wiki.archlinux.org/title/FluidSynth fluidsynth has native support for whatever and you can easily configure it to play along with pulse/pipewire.

Offline

Board footer

Powered by FluxBB