I'm talking about this function call:

r = out123_open (sound::mp3_output_handle, "alsa", NULL);

The return value of r is then OUT123_OK, but in the same moment, the status LED on my sound card (JustBoom DAC HAT) is switched off, and the card delivers no sounds any more (until I reboot my Pi, at least). The debug messages emitted when out123_open () is called look quite strange:

[src/libout123/modules/alsa.c:173] debug: open_alsa with (nil)
[src/libout123/modules/alsa.c:270] debug: close_alsa with 0x301918
Chosen output module: alsa

Apparently, when calling init_alsa (), the function close_alsa () is also called and switches off the sound card.

How can this be? Does everybody know hot to prevent ALSA from shutting down the sound card? Thank you.

UPDATE: Upon another user's advice, I found this when calling dmesg:

[  510.964076] pcm512x 1-004d: No SCLK, using BCLK: -2
[  510.970312] pcm512x 1-004d: Failed to request power down: -5

When calling mpg123 from the command line, though, I do get line 1, but not line 2, and the line with close_alsa is also missing in the debug output!

  • Do you have any messages about it on dmesg? sudo dmesg Maybe on /var/log/syslog? – eftshift0 Apr 18 '18 at 20:08
  • Sure! See the update to my original post. – Neppomuk Apr 26 '18 at 18:24

I've just found the source of trouble: the I²C pins of the Raspi! In fact, the JustBoom card does work without I²C control, but I used the I²C pins as GPIO pins for another app, and the sound card thought I was issuing I²C commands, which, of course, were invalid. This is why using the mpg123 command-line app and even the example program at https://www.mpg123.de/api/mpg123__to__out123_8c.shtml did work flawlessly, whereas my app did not.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.