mikebrady / shairport-sync

AirPlay and AirPlay 2 audio player
Other
7.29k stars 574 forks source link

send metadata to serial port [Solved] #596

Closed PE1NDO closed 5 years ago

PE1NDO commented 7 years ago

Hi Mike,

  1. thanks for this beautiful piece of software
  2. I know very little about linux
  3. I know a lot about avr's which I program in basic ( I'm not sorry about that :-) )
  4. I like to send the metadata to a serial port where I can catch it and make my 128x64 LCD show the data. (because I can't speak python etc.) this works a little. all I see is this:
73736e636d64656e10 etc. when I configure the .conf file to use /dev/ttyUSB0 I even tried a esp8266 with esp-link on socket 23 which does the same. What do I have to do to let the serial port show the metadata?
PE1NDO commented 7 years ago

ok read the other posts (#465) . yeah but first try to understand what is happening. ok so it seems I am trying to read the pipe from multiple places. now I have to understand which places :-) not really there yet

PE1NDO commented 7 years ago

right. I really don't get it anymore. as far as I can tell there are no double reads from the pipe and still there is only the same stuff to see as in post #465 this is the verbose text from shairport-sync pi@raspberrypi:~ $ shairport-sync -v alsa output device name is "default". Version: "3.1.2-OpenSSL-Avahi-ALSA-metadata-sysconfdir:/etc" statistics_requester status is 0. daemon status is 0. deamon pid file is "/var/run/shairport-sync/shairport-sync.pid". rtsp listening port is 5000. udp base port is 6001. udp port range is 100. player name is "Tuinhuis". backend is "(null)". on-start action is "(null)". on-stop action is "(null)". wait-cmd status is 0. on-start returns output is 0. mdns backend "(null)". stuffing option is "0" (0-basic, 1-soxr). resync time is 0.050000 seconds. allow a session to be interrupted: 0. busy timeout time is 120. drift tolerance is 0.001995 seconds. password is "(null)". ignore_volume_control is 0. volume_max_db is not set playback_mode is 0 (0-stereo, 1-mono, 1-reverse_stereo, 2-both_left, 3-both_righ t). disable_synchronization is 0. use_mmap_if_available is 1. output_rate is 44100. output_format is 3 (0-unknown, 1-S8, 2-U8, 3-S16, 4-S24, 5-S24_3LE, 6-S24_3BE, 7 -S32). audio backend desired buffer length is 0.150000 seconds. audio backend latency offset is 0.000000 seconds. audio backend silence lead-in time is -1.000000 seconds. A value -1.0 means use the default. volume range in dB (zero means use the range specified by the mixer): 0. zeroconf regtype is "_raop._tcp". decoders_supported field is 1. use_apple_decoder is 0. alsa_use_playback_switch_for_mute is 0. no special mdns service interface was requested. configuration file name "/etc/shairport-sync.conf" resolves to "/etc/shairport-s ync.conf". metadata enabled is 1. metadata pipename is "/dev/ttyUSB0". metadata socket address is "(null)" port 0. metadata socket packet size is "500". get-coverart is 0. loudness is 0. loudness reference level is -20.000000 Successful Startup avahi: avahi_register. avahi: register_service. avahi: request to add "_raop._tcp" service with metadata avahi: service 'A3BEBFCF3D05@Tuinhuis' successfully added. New RTSP connection from [2a02:1810:8582:8600:83b:c03d:2da2:5fe1]:53052 to self at [2a02:1810:8582:8600:3954:c67a:b9ba:20cc]:5000 on conversation thread 0. Play connection from user agent "AirPlay/320.20" on RTSP conversation thread 0. Active-Remote string seen: "2592166473". DACP-ID string seen: "140C403A0810AE19". Set up play connection from 2a02:1810:8582:8600:83b:c03d:2da2:5fe1 to self at 2a 02:1810:8582:8600:3954:c67a:b9ba:20cc on RTSP conversation thread 0. Output frame bytes is 4. Output bit depth is 16. New RTSP connection from 192.168.0.233:53053 to self at 192.168.0.100:5000 on co nversation thread 1. RTSP conversation thread 1 terminated. Ignore received picture item (include_cover_art = no). Hammerton Decoder used on encrypted audio. Output written using MMAP Ignore received picture item (include_cover_art = no).

can you push me in the right direction please?

mikebrady commented 7 years ago

Hi there, and thanks for the post. Have a look at the sample Shairport Sync metadata reader repository. It’s written in straight C, not too far from Basic. There is lot to learn about Linux/Unix, especially if you’re coming from Windows, but there are lots of good introductions on the Internet. Also, it’s worth it — Unix is probably the most powerful and widely known operation system in existence.

PE1NDO commented 7 years ago

It's working! The only thing I wanted was for the metadata to come out of the raspi's ttyS0 port. the (my) way I went is to get a console on the GPIO serial port. which didn't work. it stopped after about 5 seconds into dmesg (silly enough there are the lines for I2C and my USB audio so I thought that was the problem) this morning I omitted the line shairport-sync -a Tuinhuis -- -d hw:1 -c PCM from /etc/rc.local and I got my console. ??? ssh'd into the pi , started shairport with above line and started shairport-sync-metadata-reader (this doesn't get faster after typing it 5000 times :-D ) in the ttyS0 console. and now I can start to program my AVR to filter relevant metadata from the console output. and have my 1933 radio with 2016 amplifier and 2017 LCD, display what's playing. :-) thanks!

mikebrady commented 7 years ago

I’m glad you got something working — good luck with your project.